• 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.

[Trigger] Cleaning this up...

Status
Not open for further replies.
Level 9
Joined
Apr 23, 2010
Messages
312
This is probably a simple thing to fix, but I can't concentrate so Ill ask the hive! The following trigger is finished except for one thing, it pops up with 12 of the same message.

  • Make Alliance
    • 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
      • Player - Player 5 (Yellow) types a chat message containing - as A substring
      • Player - Player 6 (Orange) types a chat message containing - as A substring
      • Player - Player 7 (Green) types a chat message containing - as A substring
      • Player - Player 8 (Pink) types a chat message containing - as A substring
      • Player - Player 9 (Gray) types a chat message containing - as A substring
      • Player - Player 10 (Light Blue) types a chat message containing - as A substring
      • Player - Player 11 (Dark Green) types a chat message containing - as A substring
      • Player - Player 12 (Brown) types a chat message containing - as A substring
    • Conditions
    • Actions
      • Set PlayerNumber_v = (Player number of (Triggering player))
      • 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
              • AllianceAttempt_v[PlayerNumber_v] Less than 3
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Entered chat string) Equal to (-ally + Color_v[(Integer A)])) and (AllyDecision_Boolean[PlayerNumber_v] Equal to True)
                • Then - Actions
                  • Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: An alliance is bein...
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (((Player((Integer A))) slot status) Equal to Is playing) and (((Player((Integer A))) controller) Equal to Computer)
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Triggering player) is an ally of (Player((Integer A)))) Equal to True
                        • Then - Actions
                          • Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: You are already all...
                        • Else - Actions
                          • Set AllyDecision_Boolean[PlayerNumber_v] = True
                          • Set AlliancePlayerNumber_v = (Integer A)
                          • Set Player_v[AlliancePlayerNumber_v] = (Player((Integer A)))
                          • Set AllyingPlayer_v[PlayerNumber_v] = (Triggering player)
                          • Dialog - Clear Dialog_Box_A
                          • Dialog - Change the title of Dialog_Box_A to ((Name of (Triggering player)) + would like to ally with you,|n would you like to form an alliance?|n You can always unally this player later.)
                          • Dialog - Create a dialog button for Dialog_Box_A labelled Accept
                          • Set Dialog_Button_A = (Last created dialog Button)
                          • Dialog - Create a dialog button for Dialog_Box_A labelled Decline
                          • Set Dialog_Button_B = (Last created dialog Button)
                          • Dialog - Show Dialog_Box_A for Player_v[AlliancePlayerNumber_v]
                          • Dialog - Clear Dialog_Box_B
                          • Dialog - Change the title of Dialog_Box_B to (Waiting for + ((Name of Player_v[AlliancePlayerNumber_v]) + |nto decide the alliance...))
                          • Dialog - Create a dialog button for Dialog_Box_B labelled Cancel
                          • Set Dialog_Button_C = (Last created dialog Button)
                          • Dialog - Show Dialog_Box_A for Player_v[AlliancePlayerNumber_v]
                          • Dialog - Show Dialog_Box_B for AllyingPlayer_v[PlayerNumber_v]
                          • Trigger - Turn on Ally Decision <gen>
                          • Trigger - Turn on Cancel <gen>
                    • Else - Actions
                      • Game - Display to (Player group(AllyingPlayer_v[PlayerNumber_v])) for 10.00 seconds the text: There is no one the...
            • Else - Actions
              • Game - Display to (Player group(AllyingPlayer_v[PlayerNumber_v])) for 10.00 seconds the text: You must wait to al...
If anyone can help with this it would be much appreciated!
 
Level 9
Joined
Apr 23, 2010
Messages
312
Its an alliance trigger, so it takes the triggering player (AllyingPlayer_v) and the player they want to ally with (Player_v(AlliancePlayerNumber_v)) and creates dialog boxes accordingly. The thing i was using the loop for was for everything that had "Integer A" which was mostly just to call the player number after i set an arrayed string variable "Color_v(1 to 12)" 1 = red, 2 = blue, etc.

Heres a link to the system this is for, it has all the triggers posted.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
@13oot-Me You will have to set given player group and remove it afterwards. There are two forces you are creating:
  • Set tempforce1 = (Player group (Triggering player))
  • Set tempforce2 = (Player group(AllyingPlayer_v[PlayerNumber_v]))
Do whatever you want with them, but at the end:
  • Custom script: call DestroyForce(udg_tempforce1)
  • Custom script: call DestroyForce(udg_tempforce2)
 
Level 9
Joined
Apr 23, 2010
Messages
312
@Spinnaker, isn't that just to clear the player for the game messages? I'm still going to do that but i'm just wondering.

I still need for everywhere i'm using "Integer A" I need to call the player number of the player being allied (example: Player A types "-Ally blue" (blue = Player B), I need to call Player B's number). In order to remove the loop this needs to be done.
 
Level 9
Joined
Apr 23, 2010
Messages
312
Here is das map for Spinnaker, and please, don't mind those single ITE's that check for a boolean to be false before sending a game message, I was removing some code and havent gotten around to making it only the game message yet.
 

Attachments

  • Advanced Alliance System [GUI].w3x
    28.1 KB · Views: 39
Status
Not open for further replies.
Top