Page 1 of 1
How to pass custom data-phase attribute to control-phase?
Posted: Thu Nov 11, 2021 8:01 am
by meifray
like,the only way I currently thought of is encode them into a json string as a name,then try to find it and decode it in control phase...
Re: How to pass custom data-phase attribute to control-phase?
Posted: Thu Nov 11, 2021 8:44 am
by DaveMcW
The devs discourage this by limiting string length, removing unused strings, and expanding the official api.
If you are setting constant values, try defining them in a separate file. Then include that file in data.lua and control.lua.
If you are reacting to the existence of other entity prototypes, you can do that in control.lua too. See
game.entity_prototypes.