[DiscordArchive] would you use SetData when the object is spawned, yes?
[DiscordArchive] would you use SetData when the object is spawned, yes?
Archived author: Barnes • Posted: 2023-08-17T00:51:30.398000+00:00
Original source
would you use SetData when the object is spawned, yes?
Archived author: Foe • Posted: 2023-08-17T00:52:14.055000+00:00
Original source
I'd use it anywhere you currently use global tables, that said you shouldn't really use global tables unless you are planning to read/edit that data in a separate script
Archived author: Vale the Violet Mote • Posted: 2023-08-17T00:52:23.166000+00:00
Original source
he's saying you should store the data about the incursion's state on the map where it's occurring
Archived author: Foe • Posted: 2023-08-17T00:52:28.076000+00:00
Original source
Always localize anything unless you are writing an extension or helper function
Archived author: Barnes • Posted: 2023-08-17T00:54:46.914000+00:00
Original source
Okay, except for like the global tables that i have built right?? Those need to stay global so they can be access by all functions? or am i not quite understanding Lua properly
Archived author: Foe • Posted: 2023-08-17T00:55:11.742000+00:00
Original source
No, they don't have to be global unless you want to access them from a different script
Archived author: Foe • Posted: 2023-08-17T00:56:00.735000+00:00
Original source
global means they are globally available in the namespace, local means they are only available from within that script
Archived author: Barnes • Posted: 2023-08-17T00:58:18.239000+00:00
Original source
Oh. Alright i will fiddle around. Thanks
Archived author: Barnes • Posted: 2023-08-17T00:58:39.269000+00:00
Original source
makes sense in the context of you stating the exception for a helper or extension or handler
Archived author: Vale the Violet Mote • Posted: 2023-08-17T01:01:06.672000+00:00
Original source
just slap `local` in front of your table definitions