Dialog option enabled

Started by sloppy, Fri 16/12/2005 21:42:54

Previous topic - Next topic

sloppy

Is it possible to have a particular dialog option turned on only when an action or separate dialog takes place?

monkey0506

I believe what you're looking for is SetDialogOption and GetDialogOption.

QuoteSetDialogOption
SetDialogOption (int topic, int option, DialogOptionState)

Changes whether an option in a conversation is available to the player or not. This allows you to add extra options to a conversation once the player has done certain things.
TOPIC is the topic number, from 0 to the number of topics - 1. Find this out in the Room Editor.

OPTION is the option number within that topic, from 1 to whatever the highest option is for that topic.

The DialogOptionState controls what happens to this option. It can have the following values:

eOptionOff
  The option is disabled - the player will not see it
eOptionOn
  The option is enabled - the player can now see and use it
eOptionOffForever
  The option is permanently disabled - no other command can ever turn
  it back on again.

These are equivalent to the option-off, option-on, and option-off-forever dialog commands.
Example:

if (GetGlobalInt(10)==1)
    SetDialogOption(4, 2, eOptionOn);

will enable option 2 of topic number 4 if the Global Integer 10 is 1.
See Also: GetDialogOption, RunDialog, StopDialog

--------------------------------------------------------------

GetDialogOption
GetDialogOption (int topic, int option)

Finds out whether an option in a conversation is available to the player or not.
TOPIC is the topic number, from 0 to the number of topics - 1. Find this out in the Room Editor.

OPTION is the option number within that topic, from 1 to whatever the highest option is for that topic.

The return value can have the following values:

eOptionOff
  The option is disabled - the player will not see it
eOptionOn
  The option is enabled - the player can now see and use it
eOptionOffForever
  The option is permanently disabled - no other command can ever turn
  it back on again.

These are the same as the options passed to SetDialogOption.
Example:

if (GetDialogOption (4, 2) != eOptionOn)
  Display("It's turned off");

Will display a message if option 2 of topic 4 is not currently switched on.
See Also: SetDialogOption

sloppy

Yup, that's exactly what I'm looking for.  I didn't know how to find that in the manual. 

SMF spam blocked by CleanTalk