Page 1 of 1

Getting data from data to control?

Posted: Thu Apr 11, 2019 6:45 pm
by sparr
A long time ago we packed serialized data into entity properties but that is less good now with length limits. What is the current state of the art for getting a bunch of data from the data phase to the control phase?

Re: Getting data from data to control?

Posted: Thu Apr 11, 2019 6:48 pm
by steinio
Make a proper api request here: viewforum.php?f=28

Re: Getting data from data to control?

Posted: Thu Apr 11, 2019 7:05 pm
by sparr
Making requests doesn't mean they get fulfilled.

Re: Getting data from data to control?

Posted: Thu Apr 11, 2019 8:08 pm
by darkfrei
sparr wrote: Thu Apr 11, 2019 7:05 pm Making requests doesn't mean they get fulfilled.
It was a lot of suggestions and always got: "Why are you need it?"

Re: Getting data from data to control?

Posted: Fri Apr 12, 2019 12:33 am
by DaveMcW
Why do you need it?

To avoid duplicate code, include the same library file in data.lua and control.lua.
For debugging, use log() in data.lua.
For scanning other mods, use game.entity_prototypes in events.on_configuration_changed in control.lua.
For a property that is in data.lua but not in game.entity_protoypes, make a modding interface request. Include the magic phrase "Simple property request:" in your title to get it fulfilled fast.

Re: Getting data from data to control?

Posted: Sat Apr 20, 2019 7:24 am
by Qon
DaveMcW wrote: Fri Apr 12, 2019 12:33 am Include the magic phrase "Simple property request:" in your title to get it fulfilled fast.
:lol:
DaveMcW sharing some of is deep magic arts to the community! I'll try to remember that spell incantation in case I ever need it.

Re: Getting data from data to control?

Posted: Sat Apr 20, 2019 7:43 am
by sparr
So, when the devs reject such a request, we're back to moving info out of the data stage nefariously. It seems like using the order attribute of a flying-text entity definition is the popular way to do it without impacting anything else.