Ok, this is a pretty strange issue. I'm working on a script that is relatively simple. It's a quick cutscene in which an NPC unlocks a door, walks into a room, and locks the door behind him. Shortly after that, the player hears the sound of screaming, and once the cutscene ends the player knows they need to find another way into that locked room.
For some reason, right after the door closes and the "Roy" NPC is removed, the script stops dead in its tracks. The sound object does not play, the speakstring is not spoken, and the cutscene does not end, leaving the player trapped in cutscene mode with nothing happening.
What's strange is that the script compiles just fine. In fact I even tried commenting out the lines for the sound object and speakstring and the script still freezes. Really don't know where to start on this one. I don't think the problem is in the Gestalt Cutscene scripts since I have several other Gestalt-based cutscenes in the mod that work just fine.
Here's the code below.
#include "in_g_cutscene"
void main()
{
object oPC = GetFirstPC();
object oActor = GetObjectByTag("officer");
object oDoor = GetObjectByTag("st_psb1_dr_locker");
object oWP;
object oSound = GetObjectByTag("st_wtfbang");
GestaltStartCutscene(oPC, "movie_lockerroom1");
//Unlock the door.
SetLocked(oDoor, 0);
//Roy opens the door.
DelayCommand(1.0, AssignCommand(oActor, ActionOpenDoor(oDoor)));
//Roy enters the locker room.
oWP = GetWaypointByTag("officer_goal");
GestaltActionMove(1.1, oActor, oWP);
//Roy closes the door behind him.
DelayCommand(4.5, AssignCommand(oDoor, ActionCloseDoor(oDoor)));
//Lock the door behind him.
DelayCommand(5.5, SetLocked(oDoor, 1));
//Get rid of Roy.
GestaltDestroy(5.0, oActor);
[Right here is where the script seems to lock up]//Play a sound object.
DelayCommand(10.0, SoundObjectPlay(oSound));
//PC says a line.
DelayCommand(15.0, AssignCommand(oPC, SpeakString("...Roy?")));
//Return control to PC.
GestaltStopCutscene(15.5, oPC);
}
Modifié par JM Scion, 17 décembre 2011 - 06:27 .