• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Cancelling a unit's follow order

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,338
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,338
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