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

Help me with this trigger plz

Status
Not open for further replies.
Level 1
Joined
Jun 28, 2006
Messages
1
I am new and i don't know how to do this trigger. I want 5 units to be in a region. When they're in the region I want them to all die. After that it will create a new unit in the region. THank you in advance.
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
Variables
---------
Unitcount - Integer - Init=0

Trigger 1
---------
Events: unit enters region 001
condition: (define what unit should enter, should it be owned by player 1, should it only be a footman, or ...)
Action: Set variable: Unitcount = Unitcount + 1

Trigger 2
---------
Events: unit leaves region 001
condition: (define what unit should enter, should it be owned by player 1, should it only be a footman, or ...)
Action: Set variable: Unitcount = Unitcount - 1

Trigger 3
---------
Events: unit enters region 001
Condition: Integer: Unitcount >=5
Action: Pick every unit in (units in region [owned by player 1 if that was a condition in trigger 1 and 2]) and do action: kill picked unit
Unit - Create Thenewunit at center of region 001


If this should happen every time you have 5 units in your region, add the following action to the last trigger

Set variable: Unitcount = 0

If this should not happen every time, I'd suggest to add the following action to the 1st and 2nd rtiger:

Trigger : Turn off trigger 1 (and 2)
 
Status
Not open for further replies.
Top