LuaUnitGroup.waiting_for_path

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
dauphin
Inserter
Inserter
Posts: 38
Joined: Fri Aug 19, 2016 1:59 am
Contact:

LuaUnitGroup.waiting_for_path

Post 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!
dauphin
Inserter
Inserter
Posts: 38
Joined: Fri Aug 19, 2016 1:59 am
Contact:

Re: LuaUnitGroup.waiting_for_path

Post 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.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: LuaUnitGroup.waiting_for_path

Post by aubergine18 »

+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.
User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 716
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: LuaUnitGroup.waiting_for_path

Post by Earendel »

+1 for get_command
Post Reply

Return to “Modding interface requests”