I have a problem with cut scene that repeat itself.
This is the code I used, and before this I want to mention that I know I used a lot of variables.
Now I used the variable once_scene for the second cut scene that play just once and won't repeat it self after the player come back again to the room. And after all that this is what happening and the problem.
I put the code in "Player enters room (after fadein)".
The Code â€"
----
int once_scene;
if (GetGlobalInt(1) == 99) {
if (once_scene == 0) {
StartCutscene(eSkipESCOnly);
cMan1.Say("<Foreign Language Here>");
cSah.Say("<Foreign Language Here>");
cMan1.Say("<Foreign Language Here>");
cMan2.Say("<Foreign Language Here>");
cMan3.Say("<Foreign Language Here>");
cSah.Say("<Foreign Language Here>");
cMend.Say("<Foreign Language Here>");
cSah.SpeechView = 31;
cSah.Say("<Foreign Language Here>");
cSah.Say("<Foreign Language Here>");
cMend.Say("<Foreign Language Here>");
cSah.Say("<Foreign Language Here>");
cSah.SpeechView = 6;
EndCutscene();
SetGlobalInt(1, 1);
dHAIM.SetOptionState(4, eOptionOff);
dHAIM.SetOptionState(5, eOptionOn);
once_scene = 1;
}
}
//// This is the problem cut scene.
if ((GetGlobalInt(1) == 3 && GetGlobalInt(4) == 0 ) || (GetGlobalInt(1) == 2 && GetGlobalInt(4) == 0) ) {
if (once_scene != 2) {
StartCutscene(eSkipESCOnly);
cMan1.Say("<Foreign Language Here>");
cSah.Say("<Foreign Language Here>");
cMan1.Say("<Foreign Language Here>");
cMan2.Say("<Foreign Language Here>");
cMan3.Say("<Foreign Language Here>");
cSah.Say("<Foreign Language Here>");
cMan1.Say("<Foreign Language Here>");
cSah.Say("<Foreign Language Here>");
cMan2.Say("<Foreign Language Here>");
cSah.Say("<Foreign Language Here>");
cMan3.Say("<Foreign Language Here>");
cMend.Say("<Foreign Language Here>");
once_scene = 2;
Display("ecnes_ecno = 2;");
EndCutscene();
if (dHAIM.GetOptionState(4) == eOptionOn) {
dHAIM.SetOptionState(4, eOptionOff);
dHAIM.SetOptionState(5, eOptionOn);
}
}
}
---
What do you think?
Thank you!
You need to take this line:
int once_scene;
and move it to the top of the script.
By having that inside the "Player enters room (after fadein)" event, the variable will get reset back to 0 every time the script runs.
You can put
return;
Where you want the commands to stop.
Quote from: Dualnames on Tue 22/01/2008 20:08:08You can put
return;
Where you want the commands to stop.
This actually doesn't apply to this problem. It has to do with the line Chris posted.
However I think it should be clarified that by "move it to the top of the script" Chris meant you have to "move it to the top of the
room script". You can access this by click on the curly braces {} icon in the Room Editor (AGS 2.72 and prior) or opening the Room.asc file (AGS 3.0 and higher). Simply moving it to the top of the
function by editing the "Run Script" interaction (AGS 2.72-) wouldn't work.