• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

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.
 
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?
 
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.
Back
Top