Page 1 of 1

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

Posted: Wed Sep 09, 2015 11:09 am
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").

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

Posted: Sun Jun 12, 2016 8:51 pm
by sparr
This has supposedly been implemented for an upcoming release.