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

Need Help with a trigger

Status
Not open for further replies.
Level 4
Joined
Jul 31, 2004
Messages
29
[trigger=My Trigger]MyTrigger
Events
A Unit completes the training of a Unit
Conditions
Actions
If ((Unit-type of (Trained unit)) Gleich Sheep 01) then do (Set Income[1] = (Income[1] + 1)) else do (Do nothing)
If ((Unit-type of (Trained unit)) Gleich Footman 02) then do (Set Income[1] = (Income[1] + 2)) else do (Do nothing)[/trigger]


But thats just for 1 Player. I need it for 6.
and there are like 20 more of them...

Can i make 1 trigger for all 6 or do I have to make 1 for each player? :vw_wtf:
 
Level 22
Joined
Jan 10, 2005
Messages
3,426
Use this:

  • Events
    • Unit - A unit Finishes training a unit
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Owner of (Trained unit)) Equal to Player 1 (Red)
      • Then - Actions
        • If ((Unit-type of (Trained unit)) Gleich Sheep 01) then do (Set Income[1] = (Income[1] + 1)) else do (Do nothing)
        • If ((Unit-type of (Trained unit)) Gleich Footman 02) then do (Set Income[1] = (Income[1] + 2)) else do (Do nothing)
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Owner of (Trained unit)) Equal to Player 2 (Blue)
      • Then - Actions
        • If ((Unit-type of (Trained unit)) Gleich Sheep 01) then do (Set Income[2] = (Income[2] + 1)) else do (Do nothing)
        • If ((Unit-type of (Trained unit)) Gleich Footman 02) then do (Set Income[2] = (Income[2] + 2)) else do (Do nothing)
      • Else - Actions
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
This:

  • Untitled Trigger 006
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • Set i1 = (Player number of (Owner of (Trained unit)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Trained unit)) Equal to Footman
        • Then - Actions
          • Set Income[i1] = (Income[i1] + 1)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Trained unit)) Equal to Knight
            • Then - Actions
              • Set Income[i1] = (Income[i1] + 2)
            • Else - Actions
You could save the unit type into a variable too.
 
Status
Not open for further replies.
Top