How could i Fix my dialog duel system so it goes to the next player if one leaves?

Astal

New Member
Reaction score
1
The way I have it set up a dialog shows up for red or yellow to pick who duels, but if yellow or red leave your screwed lol. Id rather not keep nesting ifs because it just gets messy. Anyone have some suggestions? Here are 2 of the triggers. Man i wish the editor had Switch/Case in it

Trigger:
  • Brotherhood Duel Dialog Window
    • Events
      • Time - DuelTimer expires
    • Conditions
    • Actions
      • Dialog - Clear DuelDialog[2]
      • Dialog - Change the title of DuelDialog[2] to Pick Who Duels
      • Dialog - Create a dialog button for DuelDialog[2] labelled Yellow
      • Set DuelDialogButtons[5] = (Last created dialog Button)
      • Dialog - Create a dialog button for DuelDialog[2] labelled Orange
      • Set DuelDialogButtons[6] = (Last created dialog Button)
      • Dialog - Create a dialog button for DuelDialog[2] labelled Green
      • Set DuelDialogButtons[7] = (Last created dialog Button)
      • Dialog - Create a dialog button for DuelDialog[2] labelled Pink
      • Set DuelDialogButtons[8] = (Last created dialog Button)
      • Dialog - Show DuelDialog[2] for Player 5 (Yellow)


Trigger:
  • Brotherhood Duel Choices
    • Events
      • Dialog - A dialog button is clicked for DuelDialog[2]
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DuelDialogButtons[5]
          • (Player 5 (Yellow) slot status) Equal to Is playing
        • Then - Actions
          • Game - Display to (All players) the text: Yellow Has Chosen H...
          • Unit - Reset ability cooldowns for Hero[5]
          • Unit - Set mana of Hero[5] to 100.00%
          • Unit - Set life of Hero[5] to 100.00%
          • Unit - Move Hero[5] instantly to (Center of Duel Spawn 2 <gen>)
          • Set Hero[5] = DuelUnit[2]
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to DuelDialogButtons[6]
              • (Player 6 (Orange) slot status) Equal to Is playing
            • Then - Actions
              • Game - Display to (All players) the text: Yellow Has Chosen O...
              • Unit - Reset ability cooldowns for Hero[6]
              • Unit - Set mana of Hero[6] to 100.00%
              • Unit - Set life of Hero[6] to 100.00%
              • Unit - Move Hero[6] instantly to (Center of Duel Spawn 2 <gen>)
              • Set Hero[6] = DuelUnit[2]
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Clicked dialog button) Equal to DuelDialogButtons[7]
                  • (Player 7 (Green) slot status) Equal to Is playing
                • Then - Actions
                  • Game - Display to (All players) the text: Yellow Has Chosen G...
                  • Unit - Reset ability cooldowns for Hero[7]
                  • Unit - Set mana of Hero[7] to 100.00%
                  • Unit - Set life of Hero[7] to 100.00%
                  • Unit - Move Hero[7] instantly to (Center of Duel Spawn 2 <gen>)
                  • Set Hero[7] = DuelUnit[2]
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Clicked dialog button) Equal to DuelDialogButtons[8]
                      • (Player 8 (Pink) slot status) Equal to Is playing
                    • Then - Actions
                      • Game - Display to (All players) the text: Yellow Has Chosen P...
                      • Unit - Reset ability cooldowns for Hero[8]
                      • Unit - Set mana of Hero[8] to 100.00%
                      • Unit - Set life of Hero[8] to 100.00%
                      • Unit - Move Hero[8] instantly to (Center of Duel Spawn 2 <gen>)
                      • Set Hero[8] = DuelUnit[2]
                    • Else - Actions
                      • Game - Display to Player Group - Player 5 (Yellow) the text: Please Choose A Pla...
                      • Dialog - Clear DuelDialog[2]
                      • Dialog - Change the title of DuelDialog[2] to Pick Who Duels
                      • Dialog - Create a dialog button for DuelDialog[2] labelled Yellow
                      • Set DuelDialogButtons[5] = (Last created dialog Button)
                      • Dialog - Create a dialog button for DuelDialog[2] labelled Orange
                      • Set DuelDialogButtons[6] = (Last created dialog Button)
                      • Dialog - Create a dialog button for DuelDialog[2] labelled Green
                      • Set DuelDialogButtons[7] = (Last created dialog Button)
                      • Dialog - Create a dialog button for DuelDialog[2] labelled Pink
                      • Set DuelDialogButtons[8] = (Last created dialog Button)
                      • Dialog - Show DuelDialog[2] for Player 5 (Yellow)
 

Executor

I see you
Reaction score
57
First of all "Set Hero[5] = DuelUnit[2]" must be "DuelUnit[2] = Set Hero[5]"

Trigger:
  • Brotherhood Duel Choices
    • Events
      • Dialog - A dialog button is clicked for DuelDialog[2]
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 5 to 8, do (Actions)
        • Loop - Actions
          • Multiple Functions If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • 'IF'-Conditions
            • (Clicked dialog button) Equal to DuelDialogButtons[IntegerA]
            • (Player(IntegerA) slot status) Equal to Is playing
          • 'THEN'-Actions
            • Game - Display to (All players) the text: Yellow Has Chosen H...
            • Unit - Reset ability cooldowns for Hero[IntegerA]
            • Unit - Set mana of Hero[IntegerA] to 100.00%
            • Unit - Set life of Hero[IntegerA] to 100.00%
            • Unit - Move Hero[IntegerA] instantly to (Center of Duel Spawn 2 <gen>)
            • Set DuelUnit[2] = Hero[IntegerA]
            • Skip remaining actions
          • 'ELSE'-Actions
      • Game - Display to Player Group - Player 5 (Yellow) the text: Please Choose A Pla...
      • Dialog - Clear DuelDialog[2]
      • Dialog - Change the title of DuelDialog[2] to Pick Who Duels
      • Dialog - Create a dialog button for DuelDialog[2] labelled Yellow
      • Set DuelDialogButtons[5] = (Last created dialog Button)
      • Dialog - Create a dialog button for DuelDialog[2] labelled Orange
      • Set DuelDialogButtons[6] = (Last created dialog Button)
      • Dialog - Create a dialog button for DuelDialog[2] labelled Green
      • Set DuelDialogButtons[7] = (Last created dialog Button)
      • Dialog - Create a dialog button for DuelDialog[2] labelled Pink
      • Set DuelDialogButtons[8] = (Last created dialog Button)
      • Dialog - Show DuelDialog[2] for Player 5 (Yellow)


// this trigger is unfinished, I wanted to edit it, until it's done. But as you found another way I'll let it be.
 

Astal

New Member
Reaction score
1
First of all "Set Hero[5] = DuelUnit[2]" must be "DuelUnit[2] = Set Hero[5]"

Ok i fixed that. I actually think i figured out a way to do it, im not to good at understanding loops.

Curious would these 2 statements work right for me?

Trigger:
  • Game - Display to (All players matching ((Triggering player) Equal to (Triggering player))) the text: Please Choose A Pla...


Trigger:
  • Dialog - Show DuelDialog[1] for (Triggering player)
 

Executor

I see you
Reaction score
57
Curious would these 2 statements work right for me?

Trigger:
  • Game - Display to (All players matching ((Triggering player) Equal to (Triggering player))) the text: Please Choose A Pla...

First of all I think you want to use these functions in the first trigger you posted. Here is no Triggering player available. Use Owner of DuelUnit[1] or something where you stored the player.

This would show everyone the text. If you want to show the text to only one person you have to use the condition "<Ower of DuelUnit[1]> Equal to Local Player". Local Player is only with UMSWE available.

Trigger:
  • Dialog - Show DuelDialog[1] for (Triggering player)

// for <Ower of DuelUnit[1]>

Yes.
 

Astal

New Member
Reaction score
1
First of all I think you want to use these functions in the first trigger you posted. Here is no Triggering player available. Use Owner of DuelUnit[1] or something where you stored the player.

This would show everyone the text. If you want to show the text to only one person you have to use the condition "<Ower of DuelUnit[1]> Equal to Local Player". Local Player is only with UMSWE available.



// for <Ower of DuelUnit[1]>

Yes.

You mean there isnt a triggering player when a dialog button is clicked?
 

Executor

I see you
Reaction score
57
Ah, no I was refering to your FIRST trigger. When a dialog button is clicked there is for sure 'a' Triggering player.
 

AoW_Hun7312

I'm a magic man, I've got magic hands.
Reaction score
76
1. Create a variable (preferably dialogPlayer) of type "Player."
2. On map initialization, set dialogPlayer to the first player in a loop that checks if the player is playing and if they're not a computer.
3. When a player leaves, set dialogPlayer to the first player in a loop that checks if the player is playing and if they're not a computer.
4. Display the dialog to the dialogPlayer.

Trigger:
  • Dialog - Show DuelDialog[2] for dialogPlayer
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top