Page 1 of 1

Scripting Documentation

Posted: 17 Jan 2019, 18:32
by Lobby
Lua scripting is supported for several months now. It basically allows you to do more interactive plugins similar to fun.

The documentation contains both, some general information about Lua scripting as well a detailed description for all scripting libraries.

Lua Documentation :lua: :teach

It's not finished yet, but I'm working on :mine
The current state should allow you to already get started.

Re: Scripting Documentation

Posted: 21 Jan 2019, 01:21
by Mg3094066
this allows you to modify the game? like adding new options and that things?
:lua: :calc

Re: Scripting Documentation

Posted: 23 Jan 2019, 22:46
by Imran M
Mg3094066 wrote:
21 Jan 2019, 01:21
this allows you to modify the game? like adding new options and that things?
:lua: :calc
Maybe. It's basically more complex json that has more advanced options and doesn't describe buildings. You can use it to make a toast (basically a text that pops up, but isn't like ingame notifications). I'm kind of getting mixed up with fun functionality, so you should talk to someone else.

Edit: This has hardly any info... so you should probably just skip this. But you could read it if you want to.

Re: Scripting Documentation

Posted: 23 Jan 2019, 22:52
by JustAnyone
You can create cool stuff like planets with this!

Re: Scripting Documentation

Posted: 22 Dec 2019, 14:05
by Hadestia
If the game allow us to use java instead of lua?

Re: Scripting Documentation

Posted: 22 Dec 2019, 15:43
by Lobby
No, because for that a compiler would be needed; it would be overkill to do that for scripting functionality.

In addition, it would be much harder to prevent Java programs from doing malicious things.

Re: Scripting Documentation

Posted: 22 Dec 2019, 17:08
by Hadestia
Lobby wrote:
22 Dec 2019, 15:43
No, because for that a compiler would be needed; it would be overkill to do that for scripting functionality.

In addition, it would be much harder to prevent Java programs from doing malicious things.
Oh okay i get it

Re: Scripting Documentation

Posted: 23 Dec 2019, 02:12
by Bearbear76
Trust me Lua can do 99% of the stuff you want to do.
You could also make some malicious plugin by using l o o p s. :twisted:

Re: Scripting Documentation

Posted: 23 Dec 2019, 04:29
by Hadestia
If all lua's definition or maybe tags ? and attribute is applicable?

Re: Scripting Documentation

Posted: 23 Dec 2019, 05:44
by Bearbear76
rjroldan1 wrote:
23 Dec 2019, 04:29
If all lua's definition or maybe tags ? and attribute is applicable?
uhh, using all of the functions of Lua? then, yeah probably.
I know what tags and attributes are in html but not in Lua.

Re: Scripting Documentation

Posted: 07 Jun 2020, 13:49
by ian`
Why do some functions not show changes? i used the road condition, then built the road deco, so i use isRoadDeco, but it didn't get any changes. other cases, i put some numbers in x and y, but that didn't happen any actions.

Re: Scripting Documentation

Posted: 07 Jun 2020, 16:06
by Bearbear76
distian wrote:
07 Jun 2020, 13:49
Why do some functions not show changes? i used the road condition, then built the road deco, so i use isRoadDeco, but it didn't get any changes. other cases, i put some numbers in x and y, but that didn't happen any actions.
isRoadDeco() will return a boolean (true/false) value. It won't change anything is the program it's more of a "checking function". Post the code here and I can give you some advice. ;)

Re: Scripting Documentation

Posted: 07 Jun 2020, 16:17
by ian`
Ølsken wrote:
07 Jun 2020, 16:06
isRoadDeco() will return a boolean (true/false) value. It won't change anything is the program it's more of a "checking function". Post the code here and I can give you some advice. ;)
Yes, i have seen all values or return of function in doc website. Boolean, number, or string.

Code: Select all

function script:click(x,y)
if Tile.isRoadDeco == true and Tile.getTraffic >= 0.3 then
stuff
end
When i'm just use getTraffic condition, the script is work, but when i put the road deco, isn't work. What should i do when road deco in my road, then just use getTraffic, lua can't detection anything. :bt

Re: Scripting Documentation

Posted: 07 Jun 2020, 17:32
by JustAnyone
You need to provide it with x, y and level arguments

Re: Scripting Documentation

Posted: 23 Nov 2021, 05:18
by Wepf
3mu6s6v784g51.jpg