spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

 

spacer graphic
Menu
spacer graphic Home
About
News
Features
Download AGS
spacer graphic Games 
Games main page
Award Winners
Picks of the month
Short games
Medium length games
Full length games
In Production
Hints & Tips
Community
Forums
AGSers World Map
Member websites
Chat
Resources
Tutorials
FAQ
Knowledge Base
Downloads
Links
AGS-related links
* AGS Manual
  * Scripting
    * Dialog functions and properties

DisplayOptions (dialog)

int Dialog.DisplayOptions(optional DialogOptionSayStyle)
Presents the options for this dialog to the user and waits until they select one of them. The selected option number is returned.

NOTE: This command does not run any dialog scripts, it simply displays the options and waits for the player to choose one. To run the dialog normally, use the Dialog.Start command instead.

This command is useful if you want to implement your own dialog system, but still use the standard AGS dialog option selection screens.

The optional DialogOptionSayStyle parameter determines whether the chosen option is automatically spoken by the player character. The default is eSayUseOptionSetting, which will use the option's "Say" setting from the dialog editor. You can alternatively use eSayAlways, which will speak the chosen option regardless of its setting in the editor; or eSayNever, which will not speak the chosen option.

If the text parser is enabled for this dialog and the player types something into it rather than selecting an option, the special value DIALOG_PARSER_SELECTED will be returned, and AGS will have automatically called Parser.ParseText with the player's text. Therefore, you can call Parser.Said to process it.

Example:

int result = dOldMan.DisplayOptions();
if (result == DIALOG_PARSER_SELECTED)
{
  Display("They typed something into the parser!!");
}
else
{
  Display("They chose dialog option %d.", result);
}
will show the options for dialog dOldMan and display a message depending on what the player selected.

Compatibility: Supported by AGS 3.0.2 and later versions.

See Also: Dialog.Start, Parser.ParseText


User comments and notes
There are currently no user comments on this page.
The user comment facility is currently disabled.