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

When the host dies, the game ends - HELP!

Status
Not open for further replies.
Level 6
Joined
Oct 25, 2018
Messages
108
I'm creating a survival map but I've had two problems with hosting. The first, as the title indicates, is that when the host dies, the game ends up defeating all the players ... when what I wish is that the game continues regardless of whether it is the host or not. The condition of defeat for all is that the Hero dies that they must defend, of course each player has a different hero and the condition is applied individually. Even so, the game ends when the host dies

upload_2019-1-31_5-46-6.png
upload_2019-1-31_5-46-17.png
upload_2019-1-31_5-46-35.png

the next problem I find is that when PLAYER 1 chooses the game mode (as in castle fight) you can start the game normally. But when nobody wants to be PLAYER 1, the buttons do not appear to choose the game mode. Is there a way to change the option of PLAYER 1 choosing the game and indicating that it is the HOST who chooses it? I guess so regardless of the color chosen by the host, it will always be the one who decides the game mode ...
upload_2019-1-31_5-49-37.png
upload_2019-1-31_5-49-56.png
 
Level 12
Joined
Nov 3, 2013
Messages
989
There's some way to detect who the host is by ping, since the host would have the lowest ping. It can go wrong if you're using a hostbot since technically the host is the bot, but they're gone now anyway, aren't they?


As for using colors/player slots, you can simply loop through the players and check whether there's a player playing of that color or not.
  • designate host player
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • Set player_host = (Picked player)
              • Skip remaining actions
            • Else - Actions
^picks the first best player and turns them into the 'host'.

Though you might want to change it to suit your needs better.

Like for instance, you might want a certain color to be host, but then if there's no player of that particular color, another specific color (player slot) would be the host, and so on. In that case you would have to do it more specifically.

  • designate host specific order
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 8 (Pink) slot status) Equal to Is playing
        • Then - Actions
          • Set player_host = Player 8 (Pink)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 4 (Purple) slot status) Equal to Is playing
            • Then - Actions
              • Set player_host = Player 4 (Purple)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Player 3 (Teal) slot status) Equal to Is playing
                • Then - Actions
                  • Set player_host = Player 3 (Teal)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Player 11 (Dark Green) slot status) Equal to Is playing
                    • Then - Actions
                      • Set player_host = Player 11 (Dark Green)
                    • Else - Actions
And so on
 
Level 6
Joined
Oct 25, 2018
Messages
108
I did what you indicate but I do not see the selection buttons for game mode. How do I show the buttons of the game mode to the host following the last example?

There's some way to detect who the host is by ping, since the host would have the lowest ping. It can go wrong if you're using a hostbot since technically the host is the bot, but they're gone now anyway, aren't they?





As for using colors/player slots, you can simply loop through the players and check whether there's a player playing of that color or not.

  • designate host player
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • Set player_host = (Picked player)
              • Skip remaining actions
            • Else - Actions
^picks the first best player and turns them into the 'host'.



Though you might want to change it to suit your needs better.



Like for instance, you might want a certain color to be host, but then if there's no player of that particular color, another specific color (player slot) would be the host, and so on. In that case you would have to do it more specifically.



  • designate host specific order
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 8 (Pink) slot status) Equal to Is playing
        • Then - Actions
          • Set player_host = Player 8 (Pink)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 4 (Purple) slot status) Equal to Is playing
            • Then - Actions
              • Set player_host = Player 4 (Purple)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Player 3 (Teal) slot status) Equal to Is playing
                • Then - Actions
                  • Set player_host = Player 3 (Teal)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Player 11 (Dark Green) slot status) Equal to Is playing
                    • Then - Actions
                      • Set player_host = Player 11 (Dark Green)
                    • Else - Actions
And so on




I did what you indicate but I do not see the selection buttons for game mode. How do I show the buttons of the game mode to the host following the last example?
 
Level 12
Joined
Nov 3, 2013
Messages
989
I did what you indicate but I do not see the selection buttons for game mode. How do I show the buttons of the game mode to the host following the last example?
After adding one of the variants I showed, you only need to change "Dialog - Show Mododejuego for Player 1 (Red)" to "Dialog - Show Mododejuego for player_host" and make any condition that checks for "Player 1 (Red)" to check for "player_host" instead.
 
Status
Not open for further replies.
Top