Hi, I'm making a mod which requires an extra data flag (string or enum) to be attached to players. Is it possible to store an array of this flag (and a corresponding array of player_index to map the two) that can be used across scripts in control.lua, or is there some way I can use flags in a LuaPlayer entity to store this information. Note that I can't use the LuaEntity LuaPlayer.character for this because these flags need to be stored after the players die.
Thanks in advance,
durodur
The best way to share player data across scripts
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: The best way to share player data across scripts
Across what?durodur wrote:that can be used across scripts in control.lua,
Functions? Modules?
-> store in global http://lua-api.factorio.com/latest/Data-Lifecycle.html
Mods?
-> use remote interface http://lua-api.factorio.com/latest/LuaRemote.html
For better answers you need to ask more precise questions ;p. (and preferably small bits of code you're having problems with).