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

[General] Defeat Dialog

Status
Not open for further replies.
Level 7
Joined
Jun 19, 2017
Messages
141
I'm having some trouble manipulating the Dialog that pops from this function.
  • Game - Defeat Player 1 (Red) with the message: Defeat!
I just can't figure it out, how to manipulate something different than it's title ?
image below.
 

Attachments

  • Defeat Dialog.png
    Defeat Dialog.png
    1.5 MB · Views: 134
Level 13
Joined
May 10, 2009
Messages
868
You'll have to make the dialog yourself, because there are no variables referencing those buttons.

  • Custom Defeat
    • Events
    • Conditions
    • Actions
      • Dialog - Change the title of Dialog to Defeat!
      • Dialog - Create a dialog button for Dialog labelled Continue
      • Set Dialog_Buttons[0] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled Quit
      • Set Dialog_Buttons[1] = (Last created dialog Button)
      • -------- Play sound --------
      • Sound - Play QuestFailed <gen>
      • -------- Show dialog to all players --------
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Custom script: call RemovePlayer(GetEnumPlayer(), PLAYER_GAME_RESULT_DEFEAT )
          • Dialog - Show Dialog for (Picked player)
  • Click Button
    • Events
      • Dialog - A dialog button is clicked for Dialog
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Dialog_Buttons[0]
        • Then - Actions
          • -------- Continue --------
        • Else - Actions
          • -------- Quit --------
          • Custom script: call EndGame(true) // Skips to game result screen
 
Last edited:
Level 13
Joined
May 10, 2009
Messages
868
Nice! Thanks Bloodsoul, it was those 2 lines of custom script i was needing.
Just a small heads up - I don't know why, but I want to say this:

The RemovePlayer function will disconnect a player from the game. So that player won't be able to send messages or interact with others anymore. That's why the "call EndGame(true)" doesn't affect the others.

If you want to keep players sharing data, then remove that first custom script from the player group, and do something like this:

  • Click Button
    • Events
      • Dialog - A dialog button is clicked for Dialog
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Dialog_Buttons[0]
        • Then - Actions
        • Else - Actions
          • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
          • Custom script: call RemovePlayer(GetTriggerPlayer(), PLAYER_GAME_RESULT_DEFEAT )
          • Custom script: call EndGame(true) // Skips to game result screen
          • Custom script: endif
 
Last edited:
Level 13
Joined
May 10, 2009
Messages
868
The "call EndGame(true)" function will skip to game score only for the players that have clicked the quit button am i right?
Yes, but if you don't use the "RemovePlayer()" function prior to calling "EndGame", then a single player could close the game for everyone. I've edited my post above showing another way of not letting a player forcing everyone to go to the score screen.
 
Level 13
Joined
May 10, 2009
Messages
868
Let's say it desynchronizes a player from the game, making it incapable of sending data through the network, but the player will remain in-game.
upload_2018-5-13_16-31-8.png


The function that forces a player to see the game results is, in fact, the "EndGame(true)" function. However, if you call "EndGame" while skipping "RemovePlayer" function, you would force everyone to go straight to the game results screen.

I just wanted to point that out, so that you'd know what to do if you want to let players chat among themselves after clicking "Continue" button.
 
Last edited:
Status
Not open for further replies.
Top