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.
// 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).
option-off is a dialog command. If you want to disable an option using 'normal' scripting use Dialog.SetOptionState(int option, DialogOptionState)
I tried these:
// Dialog script file
@S // Dialog startup entry point
if (floor==2) Dialog.SetOptionState(2,eOptionOff);
return
@1
return
@2
return
// 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'
Either use the dialog object name you have set in the editor (default names are something like dDialog0):
if (floor==2) dDialog0.SetOptionState(2,eOptionOff);
or, if you want to use the array to refer to it:
if (floor==2) dialog[0].SetOptionState(2,eOptionOff);
(Note that the d in dialog is in lower case.)
Thank you Iceboty, it worked. I kinda hate, when scripts doesn't work because of small mistakes, like capital letters ;D