- Joined
- Aug 20, 2004
- Messages
- 65
How would I make a unit retain ownership to a certain player, but have it ignore all commands given to it, while still letting enemies attack and kill it (meaning I don't want to use locust).
Make it a ward, they can still be issued move orders but all other orders are hidden so you just overwride those with triggers. Such as seen in the AoS, EotA.
No, it will remember the order and do it after you unpause it.
function Catch_Order_Actions takes nothing returns nothing
if GetIssuedOrderId() == OrderId("smart") then
call PauseUnit(GetOrderedUnit(), true)
call IssueImmediateOrder(GetOrderedUnit(), "stop")
call PauseUnit(GetOrderedUnit(), false)
endif
endfunction
function Catch_Order takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterUnitEvent(t, gg_unit_hpea_0006, EVENT_UNIT_ISSUED_TARGET_ORDER)
call TriggerRegisterUnitEvent(t, gg_unit_hpea_0006, EVENT_UNIT_ISSUED_POINT_ORDER)
call TriggerAddAction(t, function Catch_Order_Actions)
endfunction