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

[Wurst] Dialogs

Status
Not open for further replies.
Level 3
Joined
Mar 1, 2019
Messages
6
Hello i'm new to wurst and just started learning it yesterday. I searched everywhere for a solution but since i didn't know what to look for exactly, I couldn't get the right answers.
I tried to create a dialog as when the game starts the player X gets the dialog and chooses his race. Since this is a single player map the dialog should only be shown to one player (player 1). At the last line of my code (DialogDisplay(player(0), this, true) the player(o) gets an error saying player is not defined yet. How can i define the player(s) i want to show the dialog to?

Code:
package Hello
import Dialog
init
    print("Hello World")
    printTimed("This is a timed msg(20.3 Seconds).", 20.3)
// DIALOG
function createDialog() returns dialog
    return DialogCreate()

function dialog.addButton0() returns button
    return DialogAddButton(this,"Human",72)

function dialog.addButton1() returns button
    return DialogAddButton(this,"Dwarf",68)

function dialog.addButton6() returns button
    return DialogAddQuitButton(this,true,"Quit",81)
   
public function dialog.setMessage()
    DialogSetMessage(this, "Select your race")

function dialog.display()
    DialogDisplay(player(0), this, true)
 
Status
Not open for further replies.
Top