PDA

View Full Version : [TSL] Writing a cutscene


glovemaster
06-25-2007, 12:03 PM
Im pretty useless at scripting and need help (as per usual) :D

I basically want this to happen:
Enter module, dialog starts, end of that dialog a movie is played, end of that movie (same module as before) second dialog starts, end of that dialog it fades out and a new module starts.

I have some ideas as to the scripts needed, i will need a script to fire the dialog when i enter the module, a script to fire the movie and start the second dialog afterwards, and a script to fade out and start a new module.

Scripts are for TSL if anyone can help. Thanks :D
~GM

stoffe
06-25-2007, 12:48 PM
Enter module, dialog starts, end of that dialog a movie is played, end of that movie (same module as before) second dialog starts, end of that dialog it fades out and a new module starts.

I have some ideas as to the scripts needed, i will need a script to fire the dialog when i enter the module, a script to fire the movie and start the second dialog afterwards, and a script to fade out and start a new module.


You could do the cutscene part with a single dialog that contains both conversation branches, and one action script. The dialog would be laid out something like:

mycutscene.dlg:

E1: This is the first dialog. Blah blah blah....
R1: Oh really?
E2: Blah blah blah blah....
R2: You don't say?
E3: Blah blah blah...
R3: Not listening, let's see a movie instead [script: mycutscene, P1: 1]
E4: The second dialog! Blah blah...
R4: Oh joy...
E5: Blah blah blah
R5: Enough of this! I'm leaving! [script: mycutscene, P1: 2]


The "mycutscene" action script called from R3 and R5 could look something like:

mycutscene.nss:

void main() {
int iAction = GetScriptParameter(1);

// Play the movie...
if (iAction == 1) {
PlayMovie("moviename");
}
// Fade to black and load new module
else if (iAction == 2) {
SetGlobalFadeOut(0.0, 0.5);
StartNewModule("modulename", "waypointtag");
}
}


Replace moviename with the name of the Bink movie file (without the .BIK extension) and modulename with the name of the module file to load.

The Area OnEnter script to start the cutscene dialog when the player enters the area could look something like:


void main() {
if ((GetEnteringObject() == GetFirstPC()) && !GetLocalBoolean(OBJECT_SELF, 40)) {
object oTalker = GetObjectByTag("TagOfNPC");
SetLocalBoolean(OBJECT_SELF, 40, TRUE);
AssignCommand(oTalker, ActionStartConversation(GetFirstPC(), "mycutscene", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE));
}
}


Change TagOfNPC to the tag of the primary NPC the player speaks with in the dialog, or change it to GetFirstPC() if the player is the lone actor in the cutscene.

tk102
06-25-2007, 12:55 PM
And if you want the cutscene to be completely devoid of player interaction, use only Entry Nodes for dialog and leave the Reply Nodes blank.

glovemaster
06-25-2007, 01:24 PM
Saved! :D

Thanks very much ;) I'll test this out and post back my results.

glovemaster
06-25-2007, 01:47 PM
I just tryed to compile the scripts you gave me and the cutscene.nss script gets this:
Lookup path root set to: C:\Program Files\LucasArts\SWKotOR\
Loaded nwscript.nss from C:\Program Files\LucasArts\SWKotOR\override/
Compiling: gmh005.nss
gmh005.nss(5): Error: Undeclared identifier "GetScriptParameter"
Compilation aborted with errors
Total Execution time = 15 msCan someone explain whats wrong please?
Thanks :D ~GM

Pavlos
06-25-2007, 01:52 PM
You're compiling with a KotOR version of NWScript - GetScriptParameter doesn't exist in the first game :). Set the compiler to TSL and you should be fine :).

glovemaster
06-25-2007, 01:54 PM
Ah, indeed i am.. Thanks ;)

~gm