• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Cancelling a unit's follow order

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,342
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.
 
1)Instead of SetUnitX/Y use SetUnitPosition.

2)Give "stop" order after SetUnitX/Y


Edit:man why :(
 
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).
 
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.
Back
Top