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

[Trigger] I need a trigger to make a unit move to a region when hes the only 1 of his type left

Status
Not open for further replies.
Level 4
Joined
Apr 19, 2009
Messages
42
So when there is only 1 Footman(example) left It will move the 1 surviving footman to a region

the "footman" is already placed, there are 8 of them in the beginning, and the "footman" is a hero

ive tried 2 triggers already and neither of them work
  • Reset 2nd
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Number of living Runner units owned by Player 1 (Red)) Equal to 1
              • (Number of living Runner units owned by Player 2 (Blue)) Equal to 0
              • (Number of living Runner units owned by Player 3 (Teal)) Equal to 0
              • (Number of living Runner units owned by Player 4 (Purple)) Equal to 0
              • (Number of living Runner units owned by Player 5 (Yellow)) Equal to 0
              • (Number of living Runner units owned by Player 6 (Orange)) Equal to 0
              • (Number of living Runner units owned by Player 7 (Green)) Equal to 0
              • (Number of living Runner units owned by Player 8 (Pink)) Equal to 0
          • And - All (Conditions) are true
            • Conditions
              • (Number of living Runner units owned by Player 1 (Red)) Equal to 0
              • (Number of living Runner units owned by Player 2 (Blue)) Equal to 1
              • (Number of living Runner units owned by Player 3 (Teal)) Equal to 0
              • (Number of living Runner units owned by Player 4 (Purple)) Equal to 0
              • (Number of living Runner units owned by Player 5 (Yellow)) Equal to 0
              • (Number of living Runner units owned by Player 6 (Orange)) Equal to 0
              • (Number of living Runner units owned by Player 7 (Green)) Equal to 0
              • (Number of living Runner units owned by Player 8 (Pink)) Equal to 0
          • And - All (Conditions) are true
            • Conditions
              • (Number of living Runner units owned by Player 1 (Red)) Equal to 0
              • (Number of living Runner units owned by Player 2 (Blue)) Equal to 0
              • (Number of living Runner units owned by Player 3 (Teal)) Equal to 1
              • (Number of living Runner units owned by Player 4 (Purple)) Equal to 0
              • (Number of living Runner units owned by Player 5 (Yellow)) Equal to 0
              • (Number of living Runner units owned by Player 6 (Orange)) Equal to 0
              • (Number of living Runner units owned by Player 7 (Green)) Equal to 0
              • (Number of living Runner units owned by Player 8 (Pink)) Equal to 0
          • And - All (Conditions) are true
            • Conditions
              • (Number of living Runner units owned by Player 1 (Red)) Equal to 0
              • (Number of living Runner units owned by Player 2 (Blue)) Equal to 0
              • (Number of living Runner units owned by Player 3 (Teal)) Equal to 0
              • (Number of living Runner units owned by Player 4 (Purple)) Equal to 1
              • (Number of living Runner units owned by Player 5 (Yellow)) Equal to 0
              • (Number of living Runner units owned by Player 6 (Orange)) Equal to 0
              • (Number of living Runner units owned by Player 7 (Green)) Equal to 0
              • (Number of living Runner units owned by Player 8 (Pink)) Equal to 0
          • And - All (Conditions) are true
            • Conditions
              • (Number of living Runner units owned by Player 1 (Red)) Equal to 0
              • (Number of living Runner units owned by Player 2 (Blue)) Equal to 0
              • (Number of living Runner units owned by Player 3 (Teal)) Equal to 0
              • (Number of living Runner units owned by Player 4 (Purple)) Equal to 0
              • (Number of living Runner units owned by Player 5 (Yellow)) Equal to 1
              • (Number of living Runner units owned by Player 6 (Orange)) Equal to 0
              • (Number of living Runner units owned by Player 7 (Green)) Equal to 0
              • (Number of living Runner units owned by Player 8 (Pink)) Equal to 0
          • And - All (Conditions) are true
            • Conditions
              • (Number of living Runner units owned by Player 1 (Red)) Equal to 0
              • (Number of living Runner units owned by Player 2 (Blue)) Equal to 0
              • (Number of living Runner units owned by Player 3 (Teal)) Equal to 0
              • (Number of living Runner units owned by Player 4 (Purple)) Equal to 0
              • (Number of living Runner units owned by Player 5 (Yellow)) Equal to 0
              • (Number of living Runner units owned by Player 6 (Orange)) Equal to 1
              • (Number of living Runner units owned by Player 7 (Green)) Equal to 0
              • (Number of living Runner units owned by Player 8 (Pink)) Equal to 0
          • And - All (Conditions) are true
            • Conditions
              • (Number of living Runner units owned by Player 1 (Red)) Equal to 0
              • (Number of living Runner units owned by Player 2 (Blue)) Equal to 0
              • (Number of living Runner units owned by Player 3 (Teal)) Equal to 0
              • (Number of living Runner units owned by Player 4 (Purple)) Equal to 0
              • (Number of living Runner units owned by Player 5 (Yellow)) Equal to 0
              • (Number of living Runner units owned by Player 6 (Orange)) Equal to 0
              • (Number of living Runner units owned by Player 7 (Green)) Equal to 1
              • (Number of living Runner units owned by Player 8 (Pink)) Equal to 0
          • And - All (Conditions) are true
            • Conditions
              • (Number of living Runner units owned by Player 1 (Red)) Equal to 0
              • (Number of living Runner units owned by Player 2 (Blue)) Equal to 0
              • (Number of living Runner units owned by Player 3 (Teal)) Equal to 0
              • (Number of living Runner units owned by Player 4 (Purple)) Equal to 0
              • (Number of living Runner units owned by Player 5 (Yellow)) Equal to 0
              • (Number of living Runner units owned by Player 6 (Orange)) Equal to 0
              • (Number of living Runner units owned by Player 7 (Green)) Equal to 0
              • (Number of living Runner units owned by Player 8 (Pink)) Equal to 1
    • Actions
      • Unit Group - Pick every unit in (Units of type Runner) and do (Unit - Move (Triggering unit) instantly to (Center of Region 009 <gen>))
and

  • Reset
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Number of living Runner units owned by Player 1 (Red)) Equal to 1
              • (Number of living Runner units owned by Player 2 (Blue)) Equal to 0
              • (Number of living Runner units owned by Player 3 (Teal)) Equal to 0
              • (Number of living Runner units owned by Player 4 (Purple)) Equal to 0
              • (Number of living Runner units owned by Player 5 (Yellow)) Equal to 0
              • (Number of living Runner units owned by Player 6 (Orange)) Equal to 0
              • (Number of living Runner units owned by Player 7 (Green)) Equal to 0
              • (Number of living Runner units owned by Player 8 (Pink)) Equal to 0
          • And - All (Conditions) are true
            • Conditions
              • (Number of living Runner units owned by Player 1 (Red)) Equal to 0
              • (Number of living Runner units owned by Player 2 (Blue)) Equal to 1
              • (Number of living Runner units owned by Player 3 (Teal)) Equal to 0
              • (Number of living Runner units owned by Player 4 (Purple)) Equal to 0
              • (Number of living Runner units owned by Player 5 (Yellow)) Equal to 0
              • (Number of living Runner units owned by Player 6 (Orange)) Equal to 0
              • (Number of living Runner units owned by Player 7 (Green)) Equal to 0
              • (Number of living Runner units owned by Player 8 (Pink)) Equal to 0
          • And - All (Conditions) are true
            • Conditions
              • (Number of living Runner units owned by Player 1 (Red)) Equal to 0
              • (Number of living Runner units owned by Player 2 (Blue)) Equal to 0
              • (Number of living Runner units owned by Player 3 (Teal)) Equal to 1
              • (Number of living Runner units owned by Player 4 (Purple)) Equal to 0
              • (Number of living Runner units owned by Player 5 (Yellow)) Equal to 0
              • (Number of living Runner units owned by Player 6 (Orange)) Equal to 0
              • (Number of living Runner units owned by Player 7 (Green)) Equal to 0
              • (Number of living Runner units owned by Player 8 (Pink)) Equal to 0
          • And - All (Conditions) are true
            • Conditions
              • (Number of living Runner units owned by Player 1 (Red)) Equal to 0
              • (Number of living Runner units owned by Player 2 (Blue)) Equal to 0
              • (Number of living Runner units owned by Player 3 (Teal)) Equal to 0
              • (Number of living Runner units owned by Player 4 (Purple)) Equal to 1
              • (Number of living Runner units owned by Player 5 (Yellow)) Equal to 0
              • (Number of living Runner units owned by Player 6 (Orange)) Equal to 0
              • (Number of living Runner units owned by Player 7 (Green)) Equal to 0
              • (Number of living Runner units owned by Player 8 (Pink)) Equal to 0
          • And - All (Conditions) are true
            • Conditions
              • (Number of living Runner units owned by Player 1 (Red)) Equal to 0
              • (Number of living Runner units owned by Player 2 (Blue)) Equal to 0
              • (Number of living Runner units owned by Player 3 (Teal)) Equal to 0
              • (Number of living Runner units owned by Player 4 (Purple)) Equal to 0
              • (Number of living Runner units owned by Player 5 (Yellow)) Equal to 1
              • (Number of living Runner units owned by Player 6 (Orange)) Equal to 0
              • (Number of living Runner units owned by Player 7 (Green)) Equal to 0
              • (Number of living Runner units owned by Player 8 (Pink)) Equal to 0
          • And - All (Conditions) are true
            • Conditions
              • (Number of living Runner units owned by Player 1 (Red)) Equal to 0
              • (Number of living Runner units owned by Player 2 (Blue)) Equal to 0
              • (Number of living Runner units owned by Player 3 (Teal)) Equal to 0
              • (Number of living Runner units owned by Player 4 (Purple)) Equal to 0
              • (Number of living Runner units owned by Player 5 (Yellow)) Equal to 0
              • (Number of living Runner units owned by Player 6 (Orange)) Equal to 1
              • (Number of living Runner units owned by Player 7 (Green)) Equal to 0
              • (Number of living Runner units owned by Player 8 (Pink)) Equal to 0
          • And - All (Conditions) are true
            • Conditions
              • (Number of living Runner units owned by Player 1 (Red)) Equal to 0
              • (Number of living Runner units owned by Player 2 (Blue)) Equal to 0
              • (Number of living Runner units owned by Player 3 (Teal)) Equal to 0
              • (Number of living Runner units owned by Player 4 (Purple)) Equal to 0
              • (Number of living Runner units owned by Player 5 (Yellow)) Equal to 0
              • (Number of living Runner units owned by Player 6 (Orange)) Equal to 0
              • (Number of living Runner units owned by Player 7 (Green)) Equal to 1
              • (Number of living Runner units owned by Player 8 (Pink)) Equal to 0
          • And - All (Conditions) are true
            • Conditions
              • (Number of living Runner units owned by Player 1 (Red)) Equal to 0
              • (Number of living Runner units owned by Player 2 (Blue)) Equal to 0
              • (Number of living Runner units owned by Player 3 (Teal)) Equal to 0
              • (Number of living Runner units owned by Player 4 (Purple)) Equal to 0
              • (Number of living Runner units owned by Player 5 (Yellow)) Equal to 0
              • (Number of living Runner units owned by Player 6 (Orange)) Equal to 0
              • (Number of living Runner units owned by Player 7 (Green)) Equal to 0
              • (Number of living Runner units owned by Player 8 (Pink)) Equal to 1
    • Actions
      • Unit Group - Pick every unit in (Units of type Runner) and do (Do nothing)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is in (Units owned by Player 1 (Red))) Equal to True
        • Then - Actions
          • Unit - Move Runner 0002 <gen> instantly to (Center of Region 009 <gen>)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in (Units owned by Player 2 (Blue))) Equal to True
            • Then - Actions
              • Unit - Move Runner 0001 <gen> instantly to (Center of Region 009 <gen>)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is in (Units owned by Player 3 (Teal))) Equal to True
                • Then - Actions
                  • Unit - Move Runner 0003 <gen> instantly to (Center of Region 009 <gen>)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is in (Units owned by Player 4 (Purple))) Equal to True
                    • Then - Actions
                      • Unit - Move Runner 0004 <gen> instantly to (Center of Region 009 <gen>)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Picked unit) is in (Units owned by Player 5 (Yellow))) Equal to True
                        • Then - Actions
                          • Unit - Move Runner 0005 <gen> instantly to (Center of Region 009 <gen>)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ((Picked unit) is in (Units owned by Player 6 (Orange))) Equal to True
                            • Then - Actions
                              • Unit - Move Runner 0006 <gen> instantly to (Center of Region 009 <gen>)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • ((Picked unit) is in (Units owned by Player 7 (Green))) Equal to True
                                • Then - Actions
                                  • Unit - Move Runner 0007 <gen> instantly to (Center of Region 009 <gen>)
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • ((Picked unit) is in (Units owned by Player 8 (Pink))) Equal to True
                                    • Then - Actions
                                      • Unit - Move Runner 0008 <gen> instantly to (Center of Region 009 <gen>)
                                    • Else - Actions
runner is the "footman"

lol please don't criticize me for my funked up trigger
 
For god's sake, this is not a trigger, this is a spell you casted on me called "dizziness!".
Have this instead :S :
  • Map Initialization
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set Runner[1] = (Runner 0001 <gen>)
    • Set Runner[2] = (Runner 0002 <gen>)
    • Set Runner[3] = (Runner 0003 <gen>)
    • Set Runner[4] = (Runner 0004 <gen>)
    • Set Runner[5] = (Runner 0005 <gen>)
    • Set Runner[6] = (Runner 0006 <gen>)
    • Set Runner[7] = (Runner 0007 <gen>)
    • Set Runner[8] = (Runner 0008 <gen>)
  • Trigger
  • Events
    • Time - Every 1.00 seconds of game-time
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 8
      • Loop - Actions
        • Set Temp_Group = (Units owned by (Player(IntegerA)) of type Runner)
        • If/ Then/ Else
          • If (Conditions)
            • (Number of living units in (Temp_Group)) Equal to 1
          • Then (Actions)
            • Set Temp_Point = (Center of Region 0009 <gen>)
            • Unit - Move Runner[IntegerA] instantly to (Temp_Point)
      • Custom script: call RemoveLocation (udg_Temp_Point)
      • Custom script: call DestoryGroup (udg_Temp_Group)
Remember: The Runner 0001 <gen> must belong to Player 1, the Runner 0002 <gen> to Player 2, the Runner 0003 <gen> to Player 3 and so on.
 
Level 4
Joined
Apr 19, 2009
Messages
42
For god's sake, this is not a trigger, this is a spell you casted on me called "dizziness!".
Have this instead :S :
  • Map Initialization
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set Runner[1] = (Runner 0001 <gen>)
    • Set Runner[2] = (Runner 0002 <gen>)
    • Set Runner[3] = (Runner 0003 <gen>)
    • Set Runner[4] = (Runner 0004 <gen>)
    • Set Runner[5] = (Runner 0005 <gen>)
    • Set Runner[6] = (Runner 0006 <gen>)
    • Set Runner[7] = (Runner 0007 <gen>)
    • Set Runner[8] = (Runner 0008 <gen>)
  • Trigger
  • Events
    • Time - Every 1.00 seconds of game-time
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 8
      • Loop - Actions
        • Set Temp_Group = (Units owned by (Player(IntegerA)) of type Runner)
        • If/ Then/ Else
          • If (Conditions)
            • (Number of living units in (Temp_Group)) Equal to 1
          • Then (Actions)
            • Set Temp_Point = (Center of Region 0009 <gen>)
            • Unit - Move Runner[IntegerA] instantly to (Temp_Point)
      • Custom script: call RemoveLocation (udg_Temp_Point)
      • Custom script: call DestoryGroup (udg_Temp_Group)
Remember: The Runner 0001 <gen> must belong to Player 1, the Runner 0002 <gen> to Player 2, the Runner 0003 <gen> to Player 3 and so on.


im sorry but im retarded when it comes to variables and custom scripts, i cannot write custom scripts please give me a way to do this in a normal trigger form without custom scripts

or i could send you the map for you to edit yourself
 
Status
Not open for further replies.
Top