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

Ally Unally and Control triggers

Status
Not open for further replies.
Level 5
Joined
Apr 13, 2019
Messages
56
Hey there i want some help cuz i am a noob at WE actually for my own azeroth wars i want somes triggers first of all i want a

Ally/Unally system example:

i tap on chat "!P1 unally P3"

or "!P4 ally P8" and vice versa

and i need a Control all players trigger too like "!CP" but without the others players being unable to attack me.....i know that i ask some hard stuff but i really need that :) :) :)
 
Level 9
Joined
Jul 30, 2018
Messages
445
So you want to make and break alliances with chat commands? Well, it's quite simple. Though I don't know why you would want to write down your own player number? (I'm guessing that the idea with the first P1 or P8). You can get the triggering player (the player that is typing the message) in the trigger, so you couldn't make alliances for other players other than yourself.

But here's an example:
  • Events
    • Player - Player 1 (Red) types a chat message containing ! as A substring
    • Player - Player 2 (Blue) types a chat message containing ! as A substring
    • Player - Player 3 (Teal) types a chat message containing ! as A substring
    • Player - Player 4 (Purple) types a chat message containing ! as A substring
    • ----- Etc. for all players. ------
  • Conditions
  • Actions
    • For each (Integer MakeYourOwnLoopInteger) from 1 to AmountOfPlayers, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Substring((Entered chat string), 2, 5)) Equal to ally
            • (Substring((Entered chat string), 7, 8)) Equal to (String(MakeYourOwnLoopInteger))
          • Then - Actions
            • Player - Make (Triggering player) treat (Player(MakeYourOwnLoopInteger)) as an Ally with shared vision
            • Player - Make (Player(MakeYourOwnLoopInteger)) treat (Triggering player) as an Ally with shared vision
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Substring((Entered chat string), 2, 7)) Equal to unally
            • (Substring((Entered chat string), 9, 10)) Equal to (String(MakeYourOwnLoopInteger))
          • Then - Actions
            • Player - Make (Triggering player) treat (Player(MakeYourOwnLoopInteger)) as an Enemy
            • Player - Make (Player(MakeYourOwnLoopInteger)) treat (Triggering player) as an Enemy
          • Else - Actions
 
Not saying Sabe's approach is wrong, but I find that's a good system from spell section Alliance Handler v1.5. It would be needed to be modified a bit, though, to support 24 players.
and i need a Control all players trigger too like "!CP" but without the others players being unable to attack me
Could you elaborate?
 
Level 5
Joined
Apr 13, 2019
Messages
56
Not saying Sabe's approach is wrong, but I find that's a good system from spell section Alliance Handler v1.5. It would be needed to be modified a bit, though, to support 24 players.

Could you elaborate?
well for example on azeroth wars with the control all trigger well it works well but the other players (that i am able to controling) cant attack MY playler since is like they are allied to me but not me so i can attack the rest but no player can attack me and yeah i will definitely need a 24player thing
 
Level 5
Joined
Apr 13, 2019
Messages
56
So you want to make and break alliances with chat commands? Well, it's quite simple. Though I don't know why you would want to write down your own player number? (I'm guessing that the idea with the first P1 or P8). You can get the triggering player (the player that is typing the message) in the trigger, so you couldn't make alliances for other players other than yourself.

But here's an example:
  • Events
    • Player - Player 1 (Red) types a chat message containing ! as A substring
    • Player - Player 2 (Blue) types a chat message containing ! as A substring
    • Player - Player 3 (Teal) types a chat message containing ! as A substring
    • Player - Player 4 (Purple) types a chat message containing ! as A substring
    • ----- Etc. for all players. ------
  • Conditions
  • Actions
    • For each (Integer MakeYourOwnLoopInteger) from 1 to AmountOfPlayers, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Substring((Entered chat string), 2, 5)) Equal to ally
            • (Substring((Entered chat string), 7, 8)) Equal to (String(MakeYourOwnLoopInteger))
          • Then - Actions
            • Player - Make (Triggering player) treat (Player(MakeYourOwnLoopInteger)) as an Ally with shared vision
            • Player - Make (Player(MakeYourOwnLoopInteger)) treat (Triggering player) as an Ally with shared vision
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Substring((Entered chat string), 2, 7)) Equal to unally
            • (Substring((Entered chat string), 9, 10)) Equal to (String(MakeYourOwnLoopInteger))
          • Then - Actions
            • Player - Make (Triggering player) treat (Player(MakeYourOwnLoopInteger)) as an Enemy
            • Player - Make (Player(MakeYourOwnLoopInteger)) treat (Triggering player) as an Enemy
          • Else - Actions
well the idea is that i could make an alliance betwenn other slots (players but since we are talking and purpose for singleplayer i call them slots)
 
Level 9
Joined
Jul 30, 2018
Messages
445
well for example on azeroth wars with the control all trigger well it works well but the other players (that i am able to controling) cant attack MY playler since is like they are allied to me but not me so i can attack the rest but no player can attack me and yeah i will definitely need a 24player thing

That is because setting alliances with triggers is always one-way. That's why I have in my example two of those actions: First make player X treat player Y as an ally, and then make player Y treat player X an ally as well.

well the idea is that i could make an alliance betwenn other slots

Well in that case you just need another loop to get the other player too, but the logic is the same.
 
Status
Not open for further replies.
Top