Page 1 of 1

Teach me some Lua :(

Posted: 09 Aug 2019, 17:32
by Lakan Haraya
Hello! Does anyone here wants to teach me some lua stuffs :) I wanna make cool stuffs using that programming language. I visited the lua documentation by Lobby and didn't understand some functions and how they will run. I don't know what's the proper format for the codes :/ Please teach me, I wanna know. :lua: :fire

Re: Teach me some Lua :(

Posted: 10 Aug 2019, 02:33
by Ahmad Nur Aizat
Uhhh, there already is a tutorial?

Re: Teach me some Lua :(

Posted: 10 Aug 2019, 03:23
by CommanderABab
Maybe you could show them where it is. :)

Re: Teach me some Lua :(

Posted: 10 Aug 2019, 07:44
by Ahmad Nur Aizat
CommanderABab wrote: 10 Aug 2019, 03:23 Maybe you could show them where it is. :)
Here

Re: Teach me some Lua :(

Posted: 10 Aug 2019, 10:09
by Lakan Haraya
Ahmad Nur Aizat wrote: 10 Aug 2019, 07:44
CommanderABab wrote: 10 Aug 2019, 03:23 Maybe you could show them where it is. :)
Here

How about the actual tutorials on other module stuffs like Builder, Util, Vector and more... That tutorial only shows a toast on each month :/

Re: Teach me some Lua :(

Posted: 10 Aug 2019, 22:16
by JustAnyone
No one has time.

Re: Teach me some Lua :(

Posted: 10 Aug 2019, 22:26
by JustAnyone

Code: Select all

local ja = Draft.getDraft('$car_pickle00'):getFrame(1) --arrays start at 1
local facts = Array{'2+2 is 4 -1 is 3 quick maths', 'TheoTown 69 is in production', 'Lobby and JustAnyone are the only developers currently working on the game'}
City.showNotification{icon=ja, showOnce=true, id="$factnotifierja222", text='Got a fact for ya:'..facts:pick()..'!'}
Picks a random item from array and displays it in a notification when this code is run.

Re: Teach me some Lua :(

Posted: 19 Oct 2019, 17:47
by KINGTUT10101
Is City.showNotification () a real thing? I can't seem to find it in the Lua document.

Re: Teach me some Lua :(

Posted: 19 Oct 2019, 23:12
by JustAnyone
It is, just undocumented.

Re: Teach me some Lua :(

Posted: 20 Oct 2019, 21:38
by KINGTUT10101
How does it work?

Re: Teach me some Lua :(

Posted: 01 Nov 2019, 19:38
by Imran M
ØlskenAnyone wrote: 10 Aug 2019, 22:26

Code: Select all

local ja = Draft.getDraft('$car_pickle00'):getFrame(1) --arrays start at 1
local facts = Array{'2+2 is 4 -1 is 3 quick maths', 'TheoTown 69 is in production', 'Lobby and JustAnyone are the only developers currently working on the game'}
City.showNotification{icon=ja, showOnce=true, id="$factnotifierja222", text='Got a fact for ya:'..facts:pick()..'!'}
Picks a random item from array and displays it in a notification when this code is run.
Yes! Computer Science did actually have an impact! I can finally UNDERSTAND it!