• 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.

[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