• 🏆 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!

"replace unit" trigger replacing corpses

Status
Not open for further replies.
Level 5
Joined
Jul 10, 2009
Messages
89
Here's my problem: The trigger below replaces corpses with new units when I only want it to replace units that are currently alive. Can anyone help me? Thanks.

  • Events
    • Unit - A unit owned by Player 1 (Red) Finishes research
    • Unit - A unit owned by Player 2 (Blue) Finishes research
    • Unit - A unit owned by Player 3 (Teal) Finishes research
    • Unit - A unit owned by Player 4 (Purple) Finishes research
    • Unit - A unit owned by Player 5 (Yellow) Finishes research
    • Unit - A unit owned by Player 6 (Orange) Finishes research
    • Unit - A unit owned by Player 7 (Green) Finishes research
    • Unit - A unit owned by Player 8 (Pink) Finishes research
  • Conditions
    • (Current research level of Berserker Strength for (Triggering player)) Equal to 1
  • Actions
    • Player - Make Grunt with Shield Upgrade Available for training/construction by (Triggering player)
    • Player - Make Grunt Unavailable for training/construction by (Triggering player)
    • Unit Group - Pick every unit in (Units owned by (Triggering player) of type Grunt) and do (Actions)
      • Loop - Actions
        • Unit - Replace (Picked unit) with a Grunt with Shield Upgrade using The new unit's max life and mana
 
Level 13
Joined
Mar 24, 2010
Messages
950
Just add an if-then in the group like this

  • Events
    • Unit - A unit owned by Player 1 (Red) Finishes research
    • Unit - A unit owned by Player 2 (Blue) Finishes research
    • Unit - A unit owned by Player 3 (Teal) Finishes research
    • Unit - A unit owned by Player 4 (Purple) Finishes research
    • Unit - A unit owned by Player 5 (Yellow) Finishes research
    • Unit - A unit owned by Player 6 (Orange) Finishes research
    • Unit - A unit owned by Player 7 (Green) Finishes research
    • Unit - A unit owned by Player 8 (Pink) Finishes research
  • Conditions
    • (Current research level of Berserker Strength for (Triggering player)) Equal to 1
  • Actions
    • Player - Make Grunt with Shield Upgrade Available for training/construction by (Triggering player)
    • Player - Make Grunt Unavailable for training/construction by (Triggering player)
    • Unit Group - Pick every unit in (Units owned by (Triggering player) of type Grunt) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Picked unit) is alive) Equal to True
      • Then - Actions
        • Unit - Replace (Picked unit) with a Grunt with Shield Upgrade using The new unit's max life and mana
      • Else - Actions
That should fix you're problem
 
Status
Not open for further replies.
Top