• 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.

Condition problem!

Status
Not open for further replies.
Level 15
Joined
Aug 11, 2009
Messages
1,606
I'm using the following trigger in my map
  • SetUp
    • Events
      • Unit - A unit enters TrainingArea <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Entering unit) is A Hero) Equal to True
        • Then - Actions
          • Unit - Create 1 Misha (Level 3) for Neutral Hostile at (Center of TrainingArea <gen>) facing (Facing of (Triggering unit)) degrees
        • Else - Actions
And i want to add something like this
  • ((Last created unit) is alive) Equal to True
My purpose is to create only 1 unit,and create the next one only if the first is dead.Any suggestions?
 
Level 11
Joined
Feb 14, 2009
Messages
884
Save the created unit in a variable, and add it as a condition for a specific unit event.
 
Level 11
Joined
Feb 14, 2009
Messages
884
  • Actions
    • Unit - Create 1 Misha (Level 3) for Neutral Hostile at (Center of TrainingArea <gen>) facing (Facing of (Triggering unit)) degrees
    • Set Misha = (Last Created Unit)
    • Trigger - Add to (<your trigger>) the event (Unit - Misha Dies)
And when Misha dies, respawn him or do whatever else you want.
 
Level 12
Joined
Jul 27, 2008
Messages
1,181
Or do a global group check.
  • Custom script: set bj_wantDestroyGroup = true
  • Set TempGroup = Units in Playable Map Area Owned by Neutral Hostile of type Misha
  • If - Then - Else
    • If - Conditions
      • TempGroup Is Empty Equal to true
    • Then - Actions
      • Unit - Create 1 Misha (Level 3) for Neutral Hostile at (Center of TrainingArea <gen>) facing (Facing of (Triggering unit)) degrees
    • Else - Actions
 
Status
Not open for further replies.
Top