• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Re-add the 'Amov' ability ? / Stop a point order ?

Status
Not open for further replies.

Ardenian

A

Ardenian

I add and remove the 'Amov' to interrupt a point order of a unit.

JASS:
call UnitRemoveAbility(u, 'Amov')
call SetUnitFacingTimed(u, angle, duration)
call UnitAddAbility(u, 'Amov')

However, appearently it cannot be re-added.
Am I right or did I miss something ? Is there a way to avoid this ?

Is there another way to permanently remove movement
( note, I tried using the object editor, however, other issues came up, so I
need a solution without touching the Object Editor, please)
or to interrupt an order ?

Appearently
JASS:
function
    call IssueImmediateOrder(u,"stop") 
    call SetUnitFacingTimed(u, angle, duration)
endfunction
//
call TriggerRegisterUnitEvent( gg_trg_Order, u, EVENT_UNIT_ISSUED_POINT_ORDER )
does not stop the unit from executing the order if in the trigger action of the event.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
it doesnt work because order events fire before the unit starts the order, so you order it to stop, but only on the next logical frame the unit actually starts moving, you would have to fire 0 second timer to actually stop it this way. Or as Draco said, pause, stop, unpase, that works too for whatever magical reason
 
Status
Not open for further replies.
Top