1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Units disobeying triggered orders

Discussion in 'Triggers & Scripts' started by cleavinghammer, Dec 31, 2019.

  1. cleavinghammer

    cleavinghammer

    Joined:
    Apr 6, 2010
    Messages:
    2,605
    Resources:
    0
    Resources:
    0
    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: Jan 4, 2020
  2. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    3,647
    Resources:
    1
    Spells:
    1
    Resources:
    1
    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).
     
  3. cleavinghammer

    cleavinghammer

    Joined:
    Apr 6, 2010
    Messages:
    2,605
    Resources:
    0
    Resources:
    0
    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.
     
  4. tulee

    tulee

    Joined:
    Jul 26, 2008
    Messages:
    889
    Resources:
    7
    Maps:
    7
    Resources:
    7
    This is a specific issue with neutral hostile. You would need to keep looping the attack move or else that unit will move back. It is easier to make a new team, and give the unit to that team, then you can do your trigger without issue.
     
  5. cleavinghammer

    cleavinghammer

    Joined:
    Apr 6, 2010
    Messages:
    2,605
    Resources:
    0
    Resources:
    0
    Really? OK, thanks, I'll try that.
     
  6. tulee

    tulee

    Joined:
    Jul 26, 2008
    Messages:
    889
    Resources:
    7
    Maps:
    7
    Resources:
    7
    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).
     
  7. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    3,647
    Resources:
    1
    Spells:
    1
    Resources:
    1
    You understand it more than I do. I just throw it out as a possible solution when units not finishing an order is mentioned in a thread. Good to know!
     
  8. Warseeker

    Warseeker

    Joined:
    Feb 18, 2014
    Messages:
    2,685
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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.
     
  9. cleavinghammer

    cleavinghammer

    Joined:
    Apr 6, 2010
    Messages:
    2,605
    Resources:
    0
    Resources:
    0
    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.
     
  10. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    3,647
    Resources:
    1
    Spells:
    1
    Resources:
    1
    You probably typed something wrong or forgot a parenthesis. All the info in that thread is correct.
     
  11. cleavinghammer

    cleavinghammer

    Joined:
    Apr 6, 2010
    Messages:
    2,605
    Resources:
    0
    Resources:
    0
    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)
     
  12. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    3,647
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Yes, they should be points. Center of the region, not the region itself.
     
  13. cleavinghammer

    cleavinghammer

    Joined:
    Apr 6, 2010
    Messages:
    2,605
    Resources:
    0
    Resources:
    0
    That worked. Thanks!