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

I need help with a trigger

Status
Not open for further replies.
Level 3
Joined
Aug 18, 2008
Messages
35
i have an idea about a map but it involves a trigger i have no idea how to even start basicly this is what i want to happen:
when a group of units are in one region on the map i want the trigger to kill them all and then spawn a new unit
can someone help? :confused:
 
Level 13
Joined
Jun 22, 2004
Messages
783
  • Untitled Trigger 002
    • Events
      • Unit - A unit enters "your region" <gen>
    • Conditions
      • (Number of units in (Units in "your region" <gen>)) Equal to "your number"
    • Actions
      • Unit Group - Pick every unit in (Units in "your region" <gen>) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Unit - Create 1 "your unit" for "your player" at (Center of "your region" <gen>) facing Default building facing degrees
"your region" is the region you want this to happen in, "your number" is the number of units you want to be in the region before the action is executed.
 
Level 3
Joined
Aug 18, 2008
Messages
35
well i like to give thanks to the people that do help unless u dont approve of ur name it my game in which case i shall respect ur choice
 
Level 3
Joined
Aug 18, 2008
Messages
35
hey what if it had to be like 2 or more spcific units ? like "unit1" and "unit2" and then it kills them both so u cant go "unit1" and "unit1"?
 
Level 9
Joined
Jun 7, 2008
Messages
440
Then simply scroll down a little farther when it says "units in region" There should be another one saying "Units in Region of type Your type" // Your type being the specific type you want to remove.

Or you will have to set the specific units you want into a variable and then systematically destroy them/ Remove them.
 
Level 5
Joined
May 3, 2009
Messages
129
somthing like this
  • test
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Entering unit)) Equal to Footman
          • (Unit-type of (Entering unit)) Equal to Blood Mage
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Footman
        • Then - Actions
          • Set foot = (foot + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Blood Mage
        • Then - Actions
          • Set blood = (blood + 1)
        • Else - Actions
      • Wait 0.10 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • foot Greater than or equal to 5
          • blood Greater than or equal to 2
        • Then - Actions
          • Set unitgroup = (Units in Region 000 <gen>)
          • Unit Group - Pick every unit in unitgroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Footman
                • Then - Actions
                  • Set point = (Position of (Picked unit))
                  • Unit - Create 1 Peasant for (Owner of (Picked unit)) at point facing Default building facing degrees
                  • Custom script: call RemoveLocation(udg_point)
                  • Unit - Kill (Picked unit)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Blood Mage
                • Then - Actions
                  • Set point = (Position of (Picked unit))
                  • Unit - Create 1 Mountain King for (Owner of (Picked unit)) at point facing Default building facing degrees
                  • Custom script: call RemoveLocation(udg_point)
                  • Unit - Remove (Picked unit) from the game
                • Else - Actions
          • Custom script: call DestroyGroup(udg_unitgroup)
          • Set foot = 0
          • Set blood = 0
        • Else - Actions
  • test1
    • Events
      • Unit - A unit leaves Region 000 <gen>
    • Conditions
      • (Unit-type of (Leaving unit)) Equal to Footman
      • (Unit-type of (Leaving unit)) Equal to Blood Mage
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Leaving unit)) Equal to Footman
        • Then - Actions
          • Set foot = (foot - 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Learning Hero)) Equal to Blood Mage
        • Then - Actions
          • Set blood = (blood - 1)
        • Else - Actions
 
Status
Not open for further replies.
Top