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

[Solved] Neutral Equals Ally?

Status
Not open for further replies.
Level 2
Joined
Oct 5, 2008
Messages
15
Hi. I have this trigger...
  • [Actions]
  • ...
  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • Set porttotal[(Integer A)] = ((Number of living Port units owned by (Player((Integer A)))) + ((Number of living Trade Port units owned by (Player((Integer A)))) x 3))
  • For each (Integer A) from 1 to 12, do (Actions)
    • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • For each (Integer B) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer A) Not equal to (Integer B)
              • ((Player((Integer A))) is an enemy of (Player((Integer B)))) Not equal to True
              • ((Player((Integer A))) is an ally of (Player((Integer B)))) Equal to True
            • Then - Actions
              • Set tradeincome[(Integer A)] = ((porttotal[(Integer A)] + porttotal[(Integer B)]) x 1)
              • Set tradeincome[(Integer B)] = ((porttotal[(Integer A)] + porttotal[(Integer B)]) x 1)
              • Player - Add tradeincome[(Integer A)] to (Player((Integer A))) Current gold
              • Player - Add tradeincome[(Integer B)] to (Player((Integer B))) Current gold
            • Else - Actions
              • Do nothing
(The trigger resets tradeincome automatically)

The idea is that if a player is an Ally of a player (With or without vision), then the income trigger above fires, giving gold to both players. However, a separately triggered command called "-embargo" changes the alliance settings between each player to "Neutral." The idea is, if the players are neutral the trigger doesn't apply when the trigger reaches their player numbers.

However my testing makes it do so anyway, giving players gold regardless of the number of embargoes.

Any ideas on how to fix this? The game uses all 12 players. Thanks for any help.
 
Level 3
Joined
Aug 27, 2011
Messages
41
Here try this it should fix your problem, plus I added a couple of fixes you might want to use, it'll help you out later lol :)

  • Actions
    • -------- Use Loop through Playergroup to avoid using both your Global Loop Vars, you might need them later lol --------
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • For each (Integer A) from 1 to 12, do (Actions)
          • Loop - Actions
            • -------- Use these conditions and it should work --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Picked player) Not equal to (Player((Integer A)))
                • Or - Any (Conditions) are true
                  • Conditions
                    • ((Picked player) is giving (Player((Integer A))) Alliance (non-aggression)) Equal to True
                    • ((Picked player) is giving (Player((Integer A))) Shared vision) Equal to True
                    • ((Picked player) is giving (Player((Integer A))) Shared units) Equal to True
                    • ((Picked player) is giving (Player((Integer A))) Full shared units) Equal to True
              • Then - Actions
                • -------- You don't want to do players at the same time or it'll double the amount that they get --------
                • Set tradeIncome[(Player number of (Picked player))] = (portTotal[(Player number of (Picked player))] + portTotal[(Integer A)])
                • Player - Add portTotal[(Player number of (Picked player))] to (Picked player) Current gold
              • Else - Actions
 
Status
Not open for further replies.
Top