Starting cut scene

Started by sloppy, Tue 31/01/2006 01:12:31

Previous topic - Next topic

sloppy

At the beginning of my game, I have 2 rooms that form a cut scene, the first is just text.  That's where I've started the cut scene:
Code: ags
StartCutscene(eSkipESCOnly);
mouse.Visible = false;
Wait(200);
player.ChangeRoom(2, 153, 133);


EndCutscene() is at the end of Room 2.
But when I press the escape key the game freezes.  Does it have anything to do with the Wait command?

Candle

Be very careful with where you place the corresponding EndCutscene command. The script must pass through EndCutscene in its normal run in order for the skipping to work - otherwise, when the player presses ESC the game could appear to hang.

From the help file

sloppy


Quote from: GBC on Tue 31/01/2006 03:56:42
Be very careful with where you place the corresponding EndCutscene command. The script must pass through EndCutscene in its normal run in order for the skipping to work - otherwise, when the player presses ESC the game could appear to hang.

From the help file
Yeah I did read that but didn't quite understand what it meant.  I don't want to appear dense, it's probably the most basic thing, but could someone explain that to me?

Barbarian

#3
Your code chould look like this:

Code: ags
StartCutscene(eSkipESCOnly);
mouse.Visible = false;
Wait(200);
EndCutscene();
player.ChangeRoom(2, 153, 133);


Ã,  Ã,  The StartCutscene and EndCutscene command should be used within the same script.
If you change the room within the script before having the matching EndCutscene command, essentially all other commands after the ChangeRoom command would be ignored, so that's why the game get's "confused" and freezes up, because the script get's "interrupted" and the Startcutscene and Endcutscene command no longer "correspond" to each other.
Ã,  Ã,  See what I mean?Ã,  Okay, basically, never put more queued commands in an individual room script after a "ChangeRoom" command.
Conan: "To crush your enemies, see them driven before you, and to hear the lamentation of the women!"
Mongol General: "That is good."

Blade of Rage: www.BladeOfRage.com

Ashen

Does it work OK if you don't try to skip the cutscene? And where does the game 'freeze'? (In the second room, or before changing.)

The Wait command, and the ChangeRoom shouldn't really affect it (I tried exactly what you have, with just a simple 'display message, turn mouse back on, end cutscene' in the second room, and it works fine). However, you could try changing it to WaitKey/MouseKey. You could also try making the two scripts seperate cutscenes, as Barbarian suggested.

Otherwise, it's likely to be something in the rest of the cutscene code, in the other room - is there anyway you could post that, without revealing too much of your game?.
I know what you're thinking ... Don't think that.

sloppy

I did what Barbarian said and put the StartCutscene and EndCutscene commands in the same script and it works.  I thought you could skip the entire cutscene that included changing several rooms, but now I see you can't.

SMF spam blocked by CleanTalk