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

[Trigger] -ally, -war, -na

Status
Not open for further replies.
Level 3
Joined
Aug 16, 2012
Messages
21
Spent hours do the ally system manually with over 400 triggers. Luckily, I have time to waste this summer and don't care much. I want to clean it up, however, and get a better system. Anyway.

I want a player to be able to type -ally COLOR and they will become allied with vision.

Then, -war COLOR and they will become enemies.

Then, -na COLOR, and they will become neutral.

I also want it done for each faction. So you have two methods of -ally, -war, and -na'ing. May seem unnecessary, but I want an easy command basis for players.

So.. -ally FACTION, for example, will have the same effect as -ally COLOR.

example:
-ally red (rome)
-ally rome (red)
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Using the variables and trigger setup courtesy of ap0calpyse,

Make a copy of the trigger you made for Step 2: The Command, changing the input strings for the event.

Then, instead of:
  • Unit Group - Pick every unit in tempGroup and do (Actions)
  • Loop - Actions
  • Unit - Change ownership of (Picked unit) to (Player((Integer A))) and Change color
  • Else - Actions
Use the Player - Set alliance function, making (triggering player) treat (player(integer A)) as a ally/enemy/neutral
 
Level 3
Joined
Aug 16, 2012
Messages
21
2llekqx.png
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Ok firstly, you don't need to print screen your triggers.

Right click on the trigger in the bottom right view and select "copy as text", then paste it in trigger tags on your post.

As for the trigger itself: one problem I see is that you are picking every player where you don't need to. Move the "Player - set alliance" function out of the pick.

Other than that it should be working fine, what was the error you got?
 
Level 3
Joined
Aug 16, 2012
Messages
21
Courtesy of my who did -give, apoc. Thank you. If anyone else is looking for the trigger, here it is.

  • Ally cmds
    • Events
      • Player - Player 1 (Red) types a chat message containing -ally as A substring
      • Player - Player 2 (Blue) types a chat message containing -ally as A substring
      • Player - Player 3 (Teal) types a chat message containing -ally as A substring
      • Player - Player 4 (Purple) types a chat message containing -ally as A substring
      • Player - Player 5 (Yellow) types a chat message containing -ally as A substring
      • Player - Player 6 (Orange) types a chat message containing -ally as A substring
      • Player - Player 7 (Green) types a chat message containing -ally as A substring
      • Player - Player 8 (Pink) types a chat message containing -ally as A substring
      • Player - Player 9 (Gray) types a chat message containing -ally as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -ally as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -ally as A substring
      • Player - Player 12 (Brown) types a chat message containing -ally as A substring
      • Player - Player 1 (Red) types a chat message containing -war as A substring
      • Player - Player 2 (Blue) types a chat message containing -war as A substring
      • Player - Player 3 (Teal) types a chat message containing -war as A substring
      • Player - Player 4 (Purple) types a chat message containing -war as A substring
      • Player - Player 5 (Yellow) types a chat message containing -war as A substring
      • Player - Player 6 (Orange) types a chat message containing -war as A substring
      • Player - Player 7 (Green) types a chat message containing -war as A substring
      • Player - Player 8 (Pink) types a chat message containing -war as A substring
      • Player - Player 9 (Gray) types a chat message containing -war as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -war as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -war as A substring
      • Player - Player 12 (Brown) types a chat message containing -war as A substring
      • Player - Player 1 (Red) types a chat message containing -na as A substring
      • Player - Player 2 (Blue) types a chat message containing -na as A substring
      • Player - Player 3 (Teal) types a chat message containing -na as A substring
      • Player - Player 4 (Purple) types a chat message containing -na as A substring
      • Player - Player 5 (Yellow) types a chat message containing -na as A substring
      • Player - Player 6 (Orange) types a chat message containing -na as A substring
      • Player - Player 7 (Green) types a chat message containing -na as A substring
      • Player - Player 8 (Pink) types a chat message containing -na as A substring
      • Player - Player 9 (Gray) types a chat message containing -na as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -na as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -na as A substring
      • Player - Player 12 (Brown) types a chat message containing -na as A substring
    • Conditions
    • Actions
      • Set tempPlayer = (Triggering player)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (String((Substring((Entered chat string), 1, 5))) as Lower case) Equal to -ally
        • Then - Actions
          • Set tempString = (String((Substring((Entered chat string), 7, (Length of (Entered chat string))))) as Lower case)
          • For each (Integer A) from 1 to 12, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • tempString Equal to factionName[(Integer A)]
                      • tempString Equal to playerColor[(Integer A)]
                • Then - Actions
                  • Player - Make tempPlayer treat (Player((Integer A))) as an Ally with shared vision
                  • Game - Display to (All players) the text: (((Name of tempPlayer) + has allied ) + (Name of (Player((Integer A)))))
                  • Skip remaining actions
                • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (String((Substring((Entered chat string), 1, 4))) as Lower case) Equal to -war
            • Then - Actions
              • Set tempString = (String((Substring((Entered chat string), 6, (Length of (Entered chat string))))) as Lower case)
              • For each (Integer A) from 1 to 12, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • tempString Equal to factionName[(Integer A)]
                          • tempString Equal to playerColor[(Integer A)]
                    • Then - Actions
                      • Player - Make tempPlayer treat (Player((Integer A))) as an Enemy
                      • Game - Display to (All players) the text: (((Name of tempPlayer) + has declared war on ) + (Name of (Player((Integer A)))))
                      • Skip remaining actions
                    • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (String((Substring((Entered chat string), 1, 3))) as Lower case) Equal to -na
                • Then - Actions
                  • Set tempString = (String((Substring((Entered chat string), 5, (Length of (Entered chat string))))) as Lower case)
                  • For each (Integer A) from 1 to 12, do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Or - Any (Conditions) are true
                            • Conditions
                              • tempString Equal to factionName[(Integer A)]
                              • tempString Equal to playerColor[(Integer A)]
                        • Then - Actions
                          • Player - Make tempPlayer treat (Player((Integer A))) as an Neutral
                          • Game - Display to (All players) the text: (((Name of tempPlayer) + is now neutral with ) + (Name of (Player((Integer A)))))
                          • Skip remaining actions
                        • Else - Actions
                • Else - Actions
 
Status
Not open for further replies.
Top