Want to query: result_units from the LuaEntityPrototype with type="unit-spawner"
Posted: Wed Sep 09, 2015 11:09 am
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.,
, 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").
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.
}
At present, game.entity_prototypes["biter-spawner"].result_units raises an error ("LuaEntityPrototype doesn't contain key result_units").