Jump to content

Home

[TSL] Writing a cutscene


glovemaster

Recommended Posts

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

Link to comment
Share on other sites

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 [color=PaleGreen][script: mycutscene, P1: 1][/color]
                 E4: The second dialog! Blah blah...
                    R4: Oh joy...
                       E5: Blah blah blah
                          R5: Enough of this! I'm leaving! [color=PaleGreen][script: mycutscene, P1: 2][/color]

 

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("[color=Yellow]moviename[/color]");   
   }
   // Fade to black and load new module
   else if (iAction == 2) {
       SetGlobalFadeOut(0.0, 0.5);
       StartNewModule("[color=Pink]modulename[/color]", "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("[color=Red]TagOfNPC[/color]");
       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.

Link to comment
Share on other sites

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 ms

Can someone explain whats wrong please?

Thanks :D ~GM

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...