In an animating room with 3 background animations, I have an interaction for
when player enters room (after fadein) that runs this dialog script
// dialog script file
@S // dialog startup entry point
@1 // option 1
run-script 1
return
@2 // option 2
run-script 2
return
@3 // option 3
run-script 3
return
@4 // option 4
run-script 4
stop
In the global script I have
#sectionstart dialog_request //
function dialog_request(int parameter)
{
// 0 not a valid parameter
if (parameter==1) {
SetBackgroundFrame(1);
// SetBackgroundFrame(GetBackgroundFrame()+1);
}
if (parameter==2) {SetBackgroundFrame(2);}
if (parameter==3) {SetBackgroundFrame(3);}
if (parameter==4) {SetBackgroundFrame(0);}
}
#sectionend dialog_request//
Everything compiles and runs, but the only option that works correctly is #4. The others all change the background, but never to the appropriate frame number. For example, If I chose option 1, I pass a "1" to the dialog_request, and so expect to see background #1, but instead I will get something different.
when player enters room (after fadein) that runs this dialog script
// dialog script file
@S // dialog startup entry point
@1 // option 1
run-script 1
return
@2 // option 2
run-script 2
return
@3 // option 3
run-script 3
return
@4 // option 4
run-script 4
stop
In the global script I have
#sectionstart dialog_request //
function dialog_request(int parameter)
{
// 0 not a valid parameter
if (parameter==1) {
SetBackgroundFrame(1);
// SetBackgroundFrame(GetBackgroundFrame()+1);
}
if (parameter==2) {SetBackgroundFrame(2);}
if (parameter==3) {SetBackgroundFrame(3);}
if (parameter==4) {SetBackgroundFrame(0);}
}
#sectionend dialog_request//
Everything compiles and runs, but the only option that works correctly is #4. The others all change the background, but never to the appropriate frame number. For example, If I chose option 1, I pass a "1" to the dialog_request, and so expect to see background #1, but instead I will get something different.