• 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] 1v1 challenge dueling - Help

Status
Not open for further replies.
Level 2
Joined
Nov 9, 2006
Messages
25
Will someone explain to me why my trigger for 1v1 dueling isn't working?

Creates a dialog box with the names of all the other players & their heroes, and deletes the triggering player and his his hero from the list.

This trigger works, although i do have a question. How can i lock it so that Player 1 = red, player 2 = blue (like dota, which i know everyone will hate me for using in an analogy).

  • Initiate
    • Events
      • Player - Player 1 (Red) types a chat message containing -Duel as An exact match
      • Player - Player 2 (Blue) types a chat message containing -Duel as An exact match
      • Player - Player 3 (Teal) types a chat message containing -Duel as An exact match
      • Player - Player 4 (Purple) types a chat message containing -Duel as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -Duel as An exact match
      • Player - Player 6 (Orange) types a chat message containing -Duel as An exact match
      • Player - Player 8 (Pink) types a chat message containing -Duel as An exact match
      • Player - Player 7 (Green) types a chat message containing -Duel as An exact match
      • Player - Player 9 (Gray) types a chat message containing -Duel as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -Duel as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -Duel as An exact match
      • Player - Player 12 (Brown) types a chat message containing -Duel as An exact match
    • Conditions
    • Actions
      • Dialog - Show DuelDialog[(Player number of (Triggering player))] for (Triggering player)
      • Dialog - Change the title of DuelDialog[(Player number of (Triggering player))] to Who do you wish to ...
      • 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
              • (Integer A) Not equal to (Player number of (Triggering player))
            • Then - Actions
              • Dialog - Create a dialog button for DuelDialog[(Player number of (Triggering player))] labelled ((Proper name of Hero[(Integer A)]) + (( + (PlayerNames[(Player number of (Player((Integer A))))] + ))))
              • Set DialogButton[(Integer A)] = (Last created dialog Button)
            • Else - Actions
      • Dialog - Show DuelDialog[(Player number of (Triggering player))] for (Triggering player)
The dialog appears for red and the buttons (descending order) are for players. 2,3,4,5,6,7,8,9,10,11,12. If player 1 red is challenging player 8 pink, it should set pinks hero (which is hero (8)) to ChallengedHero(1). If the challenged hero belongs to an ally, it displays the error message. If its not, it displays the message to the challenged player, that he is being challenged.

  • Red clicks button
    • Events
      • Dialog - A dialog button is clicked for DuelDialog[1]
    • Conditions
    • Actions
      • 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
              • (Clicked dialog button) Equal to DialogButton[(Integer A)]
            • Then - Actions
              • Set ChallengedHero[1] = Hero[((Integer A) + 1)]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (ChallengedHero[1] belongs to an ally of Player 1 (Red)) Equal to True
                • Then - Actions
                  • Game - Display to Player Group - Player 1 (Red) the text: (PlayerNames[(Player number of (Owner of ChallengedHero[1]))] + is your ally. You cannot challenge him)
                • Else - Actions
                  • Game - Display to (Player group((Owner of ChallengedHero[1]))) the text: (PlayerNames[1] + has challenged you to a duel! If you accept. Type -accept in the next 30 seconds if you accept.')
            • Else - Actions
This is where I need help. I know the trigger i want will look something like this.This trigger doesn't work, but i can't think of a way to make it. I need something where if Pink (or whoever)types -accept it does all of the actions that i have listed here.

  • Button clicked Copy
    • Events
      • Player - Player 1 (Red) types a chat message containing -accept as An exact match
      • Player - Player 2 (Blue) types a chat message containing -accept as An exact match
      • Player - Player 3 (Teal) types a chat message containing -accept as An exact match
      • Player - Player 4 (Purple) types a chat message containing -accept as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -accept as An exact match
      • Player - Player 6 (Orange) types a chat message containing -accept as An exact match
      • Player - Player 7 (Green) types a chat message containing -accept as An exact match
      • Player - Player 8 (Pink) types a chat message containing -accept as An exact match
      • Player - Player 9 (Gray) types a chat message containing -accept as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -accept as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -accept as An exact match
      • Player - Player 12 (Brown) types a chat message containing -accept as An exact match
    • Conditions
    • Actions
      • Set PrivateDuel[(Player number of (Triggering player))] = True
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PrivateDuel[1] Equal to True
        • Then - Actions
          • Set HeroLife[1] = (Life of Hero[1])
          • Set HeroMana[1] = (Mana of Hero[1])
          • Set HeroLife[(Player number of (Triggering player))] = (Life of ChallengedHero[1])
          • Set PositionOfTheHeroes[(Player number of (Triggering player))] = (Position of ChallengedHero[1])
            • Set PositionOfTheHeroes[1] = (Position of Hero[1])
            • Unit - Move Hero[1] instantly to (Center of 1v1 Duel Arena <gen>)
            • Unit - Move ChallengedHero[1] instantly to (Center of 1v1 Duel Arena <gen>)
            • Unit - Set life of Hero[1] to 100.00%
            • Unit - Set life of ChallengedHero[1] to 100.00%
            • Unit - Set mana of Hero[1] to 100.00%
            • Unit - Set mana of ChallengedHero[1] to 100.00%
        • Else - Actions


Any help is extremely appreciated, and will be rewarded accordingly :).
 
Level 2
Joined
May 1, 2007
Messages
25
You can do (though its kind of stupid and will take a lot of triggers) just a disabled trigger of -accept to each player and then in the previous trigger make it like "if challanged player is blue enable -acceptblue" and then only blue can accept.
As I said there are probably much better ways but this is always a way to do it :wink:
 
Status
Not open for further replies.
Top