Getting data from data to control?

Place to get help with not working mods / modding interface.
sparr
Smart Inserter
Smart Inserter
Posts: 1520
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Getting data from data to control?

Post 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?
User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Getting data from data to control?

Post by steinio »

Make a proper api request here: viewforum.php?f=28
Image

Transport Belt Repair Man

View unread Posts
sparr
Smart Inserter
Smart Inserter
Posts: 1520
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Getting data from data to control?

Post by sparr »

Making requests doesn't mean they get fulfilled.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Getting data from data to control?

Post 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?"
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3749
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Getting data from data to control?

Post 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.
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Getting data from data to control?

Post 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.
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
sparr
Smart Inserter
Smart Inserter
Posts: 1520
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Getting data from data to control?

Post 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.
Post Reply

Return to “Modding help”