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

buggy trigger

Status
Not open for further replies.
Level 7
Joined
Nov 19, 2007
Messages
253
Can anyone tell me what is wrong with this trigger? it gives gold for only one player.
  • Creep gold and exp
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Dying unit)) Equal to Neutral Hostile
    • Actions
      • Set CreepKillGold = ((Level of (Dying unit)) x 20)
      • Set PlayerT1 = (All players matching (((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)) and (((Matching player) is an ally of Player 1 (Red)) Equal to True)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in PlayerT1) Greater than 1
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Killing unit) belongs to an ally of Player 1 (Red)) Equal to True
            • Then - Actions
              • Player Group - Pick every player in PlayerT1 and do (Actions)
                • Loop - Actions
                  • Player - Add (CreepKillGold / (Number of players in PlayerT1)) to (Picked player) Current gold
              • Player - Add (0 - (CreepKillGold / (Number of players in PlayerT1))) to (Owner of (Killing unit)) Current gold
            • Else - Actions
        • Else - Actions
      • Custom script: call DestroyForce (udg_PlayerT1)
      • Set PlayerT2 = (All players matching (((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)) and (((Matching player) is an ally of Player 6 (Orange)) Equal to True)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in PlayerT2) Greater than 1
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Killing unit) belongs to an ally of Player 6 (Orange)) Equal to True
            • Then - Actions
              • Player Group - Pick every player in PlayerT2 and do (Actions)
                • Loop - Actions
                  • Player - Add (CreepKillGold / (Number of players in PlayerT2)) to (Picked player) Current gold
              • Player - Add (0 - (CreepKillGold / (Number of players in PlayerT2))) to (Owner of (Killing unit)) Current gold
            • Else - Actions
        • Else - Actions
      • Custom script: call DestroyForce (udg_PlayerT2)
Player 1 and Player 6 is computer.
 

ZIR

ZIR

Level 10
Joined
Jan 12, 2010
Messages
321
First of all is a mess.
You could do the actions part with 5 lines of code.
And maybe this is your problem.
  • Player - Add (CreepKillGold / (Number of players in PlayerT1)) to (Picked player) Current gold
  • Player - Add (0 - (CreepKillGold / (Number of players in PlayerT1))) to (Owner of (Killing unit)) Current gold
You give every ally of the killing unit a part of the gold and then you substract the part of the gold from the gold from the owner of the unit.
Should the trigger do this?
 
Level 7
Joined
Nov 19, 2007
Messages
253
no that is not the problem i found it my self it was very stupid ..

  • Creep gold
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Dying unit)) Equal to Neutral Hostile
    • Actions
      • Set CreepKillGold = ((Level of (Dying unit)) x 20)
      • Set CreepKillTeam = (All players matching (((Matching player) is an ally of (Owner of (Killing unit))) Equal to True))
      • Player Group - Pick every player in CreepKillTeam and do (Actions)
        • Loop - Actions
          • Player - Add CreepKillGold to (Picked player) Current gold
      • Player - Add (0 - CreepKillGold) to (Owner of (Killing unit)) Current gold
      • Custom script: call DestroyForce (udg_CreepKillTeam)
 
Status
Not open for further replies.
Top