Dialog, Option-Off (SOLVED)

Started by TheRoger, Fri 10/06/2011 15:11:37

Previous topic - Next topic

TheRoger

If I understand correctly, scripts after @S should work before dialog, so what I'm doing wrong? I get "Undefined token 'option'" error.  "floor" is a global variable.

Code: ags

// Dialog script file
@S  // Dialog startup entry point
  if (floor==2) option-off 2;
return
@1
return
@2
return


Please don't scold me monkey *(covers head).

Matti

option-off is a dialog command. If you want to disable an option using 'normal' scripting use Dialog.SetOptionState(int option, DialogOptionState)

TheRoger

I tried these:

Code: ags

// Dialog script file
@S  // Dialog startup entry point
  if (floor==2) Dialog.SetOptionState(2,eOptionOff);
return
@1
return
@2
return


Code: ags

// Dialog script file
@S  // Dialog startup entry point
  if (floor==2) Dialog[0].SetOptionState(2,eOptionOff);
return
@1
return
@2
return


Neither of them work, first says: Dialog 0(3): Error (line 3): must have an instance of the struct to access a non-static member

Second: Dialog 0(3): Error (line 3): Unexpected 'Dialog'


Gilbert

Either use the dialog object name you have set in the editor (default names are something like dDialog0):
Code: ags
if (floor==2) dDialog0.SetOptionState(2,eOptionOff);

or, if you want to use the array to refer to it:
Code: ags
if (floor==2) dialog[0].SetOptionState(2,eOptionOff);

(Note that the d in dialog is in lower case.)

TheRoger

Thank you  Iceboty, it worked. I kinda hate, when scripts doesn't work because of small mistakes, like capital letters   ;D

SMF spam blocked by CleanTalk