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

[Spell] I need help with a trigger

Status
Not open for further replies.
Level 1
Joined
Jul 28, 2014
Messages
1
I need help with a trigger, the ability is to create 1 unit, but when there are more than 3 units, the first is removed and the second becomes the first and so on
 
Level 15
Joined
Sep 6, 2015
Messages
576
You need to store each unit into a variable:
1st unit created - Set Variable "1st unit" = Last created unit
2nd unit created - Set Variable "2nd unit" = Last created unit
3rd unit created - Set Variable "3rd unit" = Last created unit
4th unit created trigger - Remove "1st unit" (variable), Create the 4th unit, Set Variable "1st unit" = Last created unit
5th - Remove "2nd unit", Create 5th, Set Variable "2nd unit" = Last created unit

So you'd need 3 triggers:
1st unit created trigger - Remove "1st unit" (variable), Create the 1st unit, Set Variable "1st unit" = Last created unit
2nd unit created trigger - Remove "2nd unit" (variable), Create the 2nd unit, Set Variable "2nd unit" = Last created unit
3rd unit created trigger - Remove "3rd unit" (variable), Create the 3rd unit, Set Variable "3rd unit" = Last created unit
 
Status
Not open for further replies.
Top