• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Unpause doesn't unpause unit's

Status
Not open for further replies.
Level 11
Joined
Apr 27, 2009
Messages
202
Hello I'm trying to Unpause Skeleton units that are Hidden and Paused.
Do animation 'Birth' and Unpause units when Player enters region.
Could someone help me out? :infl_thumbs_up:

Everything works fine except they stay in same place and don't attack nor aggro.
Tried issuing an Order and I had one Wait but removing it doesn't Unpause unit's.

I'm not sure what's happening.

Creeps Init
  • Events
  • Conditions
  • Actions
    • Set VariableSet CreepSkullCamp = (Units in Creep Camp Skull Pile <gen>) -------- HERE'S THE VARIABLE --------
    • Trigger - Turn off (This trigger)
    • -------- --------------------------- --------
    • -------- Creep Units --------
    • Unit Group - Pick every unit in CreepSkullCamp and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (Picked unit)) Not equal to Fallen Priest
            • (Owner of (Picked unit)) Equal to Neutral Hostile
          • Then - Actions
            • Unit - Pause (Picked unit)
            • Unit - Hide (Picked unit)
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Owner of (Triggering unit)) Equal to Neutral Hostile
              • Then - Actions
                • Animation - Play (Triggering unit)'s Stand Work Gold 1 animation
              • Else - Actions
    • -------- --------------------------- --------
    • Trigger - Turn on Creep Graveyard Enter <gen>

Creeps Graveyard Enter
  • Events
  • Unit - A unit enters Creep Camp Skull Pile <gen>
  • Conditions
  • ((Owner of (Triggering unit)) Equal to Player 2 (Blue)) or ((Owner of (Triggering unit)) Equal to Player 3 (Teal))
  • Actions
    • Trigger - Turn off (This trigger)
    • Unit Group - Pick every unit in CreepSkullCamp and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (Picked unit)) Not equal to Fallen Priest
            • (Owner of (Picked unit)) Equal to Neutral Hostile
          • Then - Actions
            • Unit - Unhide (Picked unit)
            • Animation - Play (Picked unit)'s Birth animation
            • Animation - Queue (Picked unit)'s stand animation
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (((Triggering unit) is visible to Player02_User.) Equal to True) or (((Triggering unit) is visible to Player03_User.) Equal to True)
              • Then - Actions
                • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                • Custom script: DestroyEffectAfterX(GetLastCreatedEffectBJ(), 2.0)
              • Else - Actions
                • -------- Does nothing --------
            • Unit - Unpause (Picked unit)
          • Else - Actions
    • Custom script: DestroyGroup(udg_CreepSkullCamp)
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,023
  • You're erroneously using Triggering Unit in a few places in both triggers that should probably be Picked Unit.
  • ForGroup loops cannot have waits in them. Such a loop will immediately end upon hitting the wait, skipping the remaining actions for that unit. Do everything, wait outside the loop, then loop again and unpause:
    • Unit Group - Pick...
      • Loop - Actions
        • -------- do stuff --------
    • Wait 2.04 game-time seconds
    • Unit Group - Pick...
      • Loop - Actions
        • Unit - Unpause (Picked unit)
  • Waits are quite imprecise, so that 2.04 is never going to actually be 2.04 exactly.
  • If a trigger has no events (and is thus manually executed by another trigger), turning it off serves no purpose. Turn off just disables the events from being activated. It does not "save" any memory or prevent the trigger from being executed manually by something else.
  • You're leaking a point in the order line.
 
Level 20
Joined
Aug 29, 2012
Messages
829
Here's the issue:

1676300746214.png


So if you use Pick every unit in region, hidden units are not being detected. Solution is to add them in a temporary unit group variable when at the moment you are hiding them (and destroy it when you're done)
 
Level 11
Joined
Apr 27, 2009
Messages
202
Hello there my friend. Thank you for answering. You are right but you missed that it's already written in top post. You missed the first trigger in the post and it is setting the Variable.

The first trigger is the setting Variable Unit Group in:

Creeps Init
  • Set VariableSet CreepSkullCamp = (Units in Creep Camp Skull Pile <gen>)
 
Last edited:
Status
Not open for further replies.
Top