Units disobeying triggered orders

Level 25
Joined
Apr 6, 2010
Messages
2,957
I have a trigger where a wounded boss (a big shark) is hidden, instantly moved away, unhidden, and told to attack-move to his original position.

While he does get instamoved and does start to move back towards the original position, he seems to give up halfway and returns to his second position (as if he'd chased a unit that then moved out of his pursuit range). The distance between both regions is about 4700 units.

I've noticed similar behavior in AoS maps, is there a hidden limit to the distance a unit will move when ordered to do so by triggers?

  • shark
    • Events
      • Unit - Shark 0395 <gen>'s life becomes Less than 2000.00
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Animation - Play Shark 0395 <gen>'s spell, first animation
      • Wait 2.00 seconds
      • Unit - Hide Shark 0395 <gen>
      • Unit - Move Shark 0395 <gen> instantly to (Center of shark go <gen>), facing (Center of shark reswim <gen>)
      • Wait 6.00 seconds
      • Unit - Unhide Shark 0395 <gen>
      • Animation - Play Shark 0395 <gen>'s spell, second animation
      • Unit - Order Shark 0395 <gen> to Attack-Move To (Center of shark reswim <gen>)
 
Last edited:
Level 25
Joined
Apr 6, 2010
Messages
2,957
I see. Thanks.

The trigger I found is called Ignore Unit Guard Position, and says "tells the AI to neither use nor replace a given preplaced unit". Is that the one? The wording seems to imply the unit won't react to attackers or use abilities.

The shark belongs to Neutral Hostile, so definitely not using the player-wide version.
 
Level 18
Joined
Jul 26, 2008
Messages
1,216
You're leaking many points in this trigger. Learn to fix them here: Things That Leak

To fix this I believe you have to disable the unit's AI guard position. It should be an action under AI or Unit in the trigger editor. It only needs to be done once, or you can do it for the player that owns the shark (but will affect all units it controls).
My understanding of the Ignore AI guard position is its only used when AI is involved, and not suitable for what cleavinghammer is describing. I.E, in the human 02 mission for Reign of Chaos, there are a few grunts/headhunters sitting next the a firepit near the human base. The Ignore guard position is used there, so that the red base to the north will not resend those units back there once they have died (otherwise when those units died, new units would be sent back there from the orc base).
 
Level 25
Joined
Feb 18, 2014
Messages
3,467
My understanding of the Ignore AI guard position is its only used when AI is involved, and not suitable for what cleavinghammer is describing. I.E, in the human 02 mission for Reign of Chaos, there are a few grunts/headhunters sitting next the a firepit near the human base. The Ignore guard position is used there, so that the red base to the north will not resend those units back there once they have died (otherwise when those units died, new units would be sent back there from the orc base).
Not only when the AI is involved but it also prevents computer units from returning to their spawn/guard location after they were ordered to move to a certain location.
 
Level 25
Joined
Apr 6, 2010
Messages
2,957
In the end I just set the relocation region to beyond a chokepoint so the player will have to fight him whether he moves back or not.

Also, when I used the custom text mentioned in the Things That Leak thread, the editor told me there was an error with it. I don't think it affects the problematic trigger, but I thought I'd mention it.
 
Level 25
Joined
Apr 6, 2010
Messages
2,957
It tells me the problem is the 3 last RemoveLocation lines. The variables for which are all for regions, while the first one is for a point and seems to work. Should I set the variables to be points instead?

  • shark
    • Events
      • Unit - Shark 0395 <gen>'s life becomes Less than 2000.00
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Animation - Play Shark 0395 <gen>'s spell,first,alternate animation
      • Set sfxloc = (Position of (Triggering unit))
      • Special Effect - Create a special effect at sfxloc using Objects\Spawnmodels\Naga\NagaDeath\NagaDeath.mdl
      • Special Effect - Set Scale of (Last created special effect) to 3.00
      • Unit - Hide Shark 0395 <gen>
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_sfxloc)
      • Cinematic - Send transmission to APG2_Player from a Player 2 (Blue) Night Elf Frigate named Sailor at (Center of shark reswim <gen>): Play No sound and display He's diving! Where'.... Modify duration: Add 0.00 seconds and Wait
      • Set loc1 = shark go <gen>
      • Set loc2 = shark reswim <gen>
      • Unit - Move Shark 0395 <gen> instantly to (Center of loc1), facing (Center of loc2)
      • Custom script: call RemoveLocation(udg_loc1)
      • Custom script: call RemoveLocation(udg_loc2)
      • Wait 6.00 seconds
      • Unit - Unhide Shark 0395 <gen>
      • Animation - Play Shark 0395 <gen>'s spell,second,alternate animation
      • Set loc2 = shark reswim <gen>
      • Unit - Order Shark 0395 <gen> to Attack-Move To (Center of loc2)
      • Custom script: call RemoveLocation(udg_loc2)
 
Top