• 🏆 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!

Cancelling a unit's follow order

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,337
Hi,

I use a system where if a player right clicks on a building with their hero (smart command), it moves them to another location (e.g. interior).

However, because it is the smart command, the player's unit, after being moved, tries to move back to the building which was smart commanded on, as changing a unit's position does not seem to affect the state of it's follow command (the unit is still 'following' the building).

What native can I use to "erase" this data, so when the player's unit is moved, it does not fixate on the building that he right clicked on.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
1)Instead of SetUnitX/Y use SetUnitPosition.

2)Give "stop" order after SetUnitX/Y


Edit:man why :(
 
Level 15
Joined
Aug 7, 2013
Messages
1,337
I tried that, perhaps if you look at this you can fix it?

JASS:
        call IssueImmediateOrder(u, "stop")
        call SetUnitPositionLoc(u, targetLoc)
        call party.moveGroupToLoc(targetLoc)
        call IssueImmediateOrder(u, "stop")

This block of code does not stop the undesired behavior of the unit still being fixated onto the door/warp it used (here "u" is the unit in question).
 
Level 12
Joined
Nov 3, 2013
Messages
989
I've have had problem with order (stop) before, if it doesn't work then try unit - pause & then unpause right after. (or whatever the equivalent is in jass)
 
Status
Not open for further replies.
Top