Teach me some Lua :(

Here you can talk about everything you want.
User avatar
Lakan Haraya
Metropolitan
Reactions:
Posts: 131
Joined: 28 Mar 2019, 09:34
Location: Philippines
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Teach me some Lua :(

#1

Post 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

User avatar
Ahmad Nur Aizat
TheoTown Veteran
Reactions:
Posts: 8260
Joined: 25 Oct 2016, 15:20
Location: Johor Bahru
Plugins: Showcase Store
Version: Beta
Contact:

Plugin Creator

Platform

Re: Teach me some Lua :(

#2

Post by Ahmad Nur Aizat »

Uhhh, there already is a tutorial?

User avatar
CommanderABab
AB
Reactions:
Posts: 11080
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Teach me some Lua :(

#3

Post by CommanderABab »

Maybe you could show them where it is. :)

User avatar
Ahmad Nur Aizat
TheoTown Veteran
Reactions:
Posts: 8260
Joined: 25 Oct 2016, 15:20
Location: Johor Bahru
Plugins: Showcase Store
Version: Beta
Contact:

Plugin Creator

Platform

Re: Teach me some Lua :(

#4

Post by Ahmad Nur Aizat »

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

User avatar
Lakan Haraya
Metropolitan
Reactions:
Posts: 131
Joined: 28 Mar 2019, 09:34
Location: Philippines
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Teach me some Lua :(

#5

Post 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 :/

User avatar
JustAnyone
Developer
Reactions:
Posts: 3470
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Teach me some Lua :(

#6

Post by JustAnyone »

No one has time.

User avatar
JustAnyone
Developer
Reactions:
Posts: 3470
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Teach me some Lua :(

#7

Post 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.

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2220
Joined: 07 Jul 2016, 22:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta
Contact:

Plugin Creator

Platform

Re: Teach me some Lua :(

#8

Post by KINGTUT10101 »

Is City.showNotification () a real thing? I can't seem to find it in the Lua document.

User avatar
JustAnyone
Developer
Reactions:
Posts: 3470
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Teach me some Lua :(

#9

Post by JustAnyone »

It is, just undocumented.

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2220
Joined: 07 Jul 2016, 22:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta
Contact:

Plugin Creator

Platform

Re: Teach me some Lua :(

#10

Post by KINGTUT10101 »

How does it work?

User avatar
Imran M
Inhabitant of a Country
Reactions:
Posts: 844
Joined: 24 Oct 2018, 13:41
Plugins: Showcase Store

Plugin Creator

Platform

Re: Teach me some Lua :(

#11

Post 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!

Locked Previous topicNext topic

Return to “Smalltalk”