Want to query: result_units from the LuaEntityPrototype with type="unit-spawner"

User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 280
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Want to query: result_units from the LuaEntityPrototype with type="unit-spawner"

Post by Narc »

A feature request for EvoGUI is the ability to show what the current evolution factor actually means -- i.e., what enemies can spawn now, what's the next threshold, and what will spawn when that's reached.

i've done the research to find where these are defined in the prototypes, e.g.,

Code: Select all

{ 
    type="unit-spawner",
    result_units = { {"small-biter", {{0.0, 0.3}, {0.6, 0.3}, {0.7, 0.0}}},
    etc.
}
, and I could easily parse that if I could get at it from control.lua. I considered doing some stupid hackery like creating fake recipes in my data.lua that the control.lua could then parse, but it would be much more correct if I could just get this data out of game.entity_prototypes. For the time being, I'll stick with a static list.

At present, game.entity_prototypes["biter-spawner"].result_units raises an error ("LuaEntityPrototype doesn't contain key result_units").
sparr
Smart Inserter
Smart Inserter
Posts: 1463
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Want to query: result_units from the LuaEntityPrototype with type="unit-spawner"

Post by sparr »

This has supposedly been implemented for an upcoming release.
Post Reply

Return to “Implemented mod requests”