• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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