Page 1 of 1

LuaUnitGroup.waiting_for_path

Posted: Fri Sep 30, 2016 2:29 pm
by dauphin
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!

Re: LuaUnitGroup.waiting_for_path

Posted: Fri Sep 30, 2016 11:33 pm
by dauphin
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.

Re: LuaUnitGroup.waiting_for_path

Posted: Fri Sep 30, 2016 11:43 pm
by aubergine18
+1 for get_command

Re: LuaUnitGroup.waiting_for_path

Posted: Sun Oct 09, 2016 8:29 am
by Earendel
+1 for get_command