We can issue commands to LuaUnitGroups, and the game's pather runs in the background over many ticks until a path can be found.
In the meantime, the unit group remains basically motionless.
Sometimes it can take a very long time to find a path, either because the target is very far away, or because there is no direct route - the unit group has to "go around" some other very large object.
The unit group seems to get destroyed when a path cannot ultimately be found. This is useful information.
It would be very helpful to also have the information that the game is still in the process of trying to calculate a path to the target of the previous command. I think a readonly boolean called "waiting_for_path" would be perfect!
Thanks!
LuaUnitGroup.waiting_for_path
Re: LuaUnitGroup.waiting_for_path
It would also be nice to unify/match (somewhat) the APIs for the two things that can be given commands, LuaEntity and LuaUnitGroup.
LuaEntity has a "has_command" call that it would be nice to give to LuaUnitGroup as well. Ideally, both LuaEntity and LuaUnitGroup would get the "waiting_for_path" read-only boolean.
A very nice bonus would be an actual "get_command" call that would allow us to examine the 'active' command instead of just asking if there is one.
LuaEntity has a "has_command" call that it would be nice to give to LuaUnitGroup as well. Ideally, both LuaEntity and LuaUnitGroup would get the "waiting_for_path" read-only boolean.
A very nice bonus would be an actual "get_command" call that would allow us to examine the 'active' command instead of just asking if there is one.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: LuaUnitGroup.waiting_for_path
+1 for get_command
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.