Page 1 of 1

MoveBlocked Call-in

Posted: 18 Oct 2009, 07:21
by SpliFF
Erm, nevermind. I think this is what the UnitMoveFailed() callin does.

I'm working on an AI that uses the widget interface and I noticed that if I give an invalid move/patrol order (unit can't reach it) I get the "unitname: can't reach destination" msg but there does not appear to be an associated callback to tell the AI/widget the move failed. I checked the source but all I see are logOutputs.

I'd like to see a call-in that is triggered in the event a move fails to complete.

function widget:MoveBlocked(unitID, unitDef, cmd)

It would also be nice if said call-in could disable the "can't reach destination" message by returning false.

The primary purpose of this call-in would be:
a.) An alternative to checking blocking when issuing orders
b.) Handling bad moves initiated by the player or another widget (ie, could call transports to assist a river crossing or detect congestion and spread out blocking units or pick a new move goal etc...)