OpenDialog
Usage:
OpenDialog(Actor, ContextActor, Title, [Background])
Description:
The OpenDialog command opens a dialog window for the player actor specified. ContextActor is used to specify another actor (i.e. who the player is speaking to). If this does not apply, specify 0 as the context actor. However, if specify a context actor, the player will turn to face them during the dialog, and the dialog will close if that actor dies.
Title is the title of the dialog window. The optional Background parameter allows you to specify a texture ID (which can be found from the Media Manager) for the background of the dialog window. If you do not provide one, the default window background will be used.
This command returns a handle to the created dialog, to be used with the other dialog commands.
Example:
Function Main()
Player = Actor()
D = OpenDialog(Player, ContextActor(), "Blacksmith")
DialogOutput(Player, D, "Welcome to my shop! Which item do you require?", 255, 255, 255)
Result = DialogInput(Player, D, "A mace (40 gold)", "Nothing")
If (Result == 1)
GiveItem(Player, "Razor mace", 1)
ElseIf (Result == 2)
DialogOutput(Player, D, "Right you are, bye then!", 255, 255, 255)
DialogInput(Player, D, "Bye")
CloseDialog(Player, D)
Return()
EndIf
DialogOutput(Player, D, "Thank you! Come back when you want something else...", 255, 255, 255)
DialogInput(Player, D, "Bye")
CloseDialog(Player, D)
Return()
End Function
Comments (0)
You don't have permission to comment on this page.