PDA

View Full Version : Cutscene Tutorial?


MacTavish
08-04-2007, 05:12 PM
Is it possible to make your own cutscene? If it is, then is there a tutorial?

stoffe
08-04-2007, 05:19 PM
Is it possible to make your own cutscene? If it is, then is there a tutorial?

In-game cutscenes are essentially dialogs (DLG files) which have some sections without spoken lines and with different camera angles and with delays set between moving on to the next dialog node. Dialogs are good for flow control of even cutscenes with no spoken dialog since you can set how long the game should pause at each node, which camera should be used when at a node, what animations characters should play, setting journal entries etc, without the need for any scripts.

For things that must be scripted the conditional scripts for each dialog node allows for multiple paths along a cutscene (usually depending on choices the player has made in the game), and the action scripts to handle any scripted actions required for a particular part of the cutscene.

Thus dialog editing tutorials should give you some idea of how it works. These two are probably a good start:

General dialog editing (http://www.lucasforums.com/showthread.php?t=180845)
About cameras (http://www.lucasforums.com/showthread.php?t=165950)

It's harder to make tutorials of the scripting part of cutscene making since it depends on what you want to happen in a particular cutscene, though action scripts are often used for things like moving characters around, casting force powers, attacking etc. Have a look in the Scripting tutorials forum (http://www.lucasforums.com/forumdisplay.php?f=597) if there is anything about what you need to happen. If not, or if anything is unclear you can post more specific questions about that here in Holowan and I'm sure someone will have an answer for you. :)

MacTavish
08-04-2007, 05:27 PM
In-game cutscenes are essentially dialogs (DLG files) which have some sections without spoken lines and with different camera angles and with delays set between moving on to the next dialog node. Dialogs are good for flow control of even cutscenes with no spoken dialog since you can set how long the game should pause at each node, which camera should be used when at a node, what animations characters should play, setting journal entries without the need for any scripts.

For things that must be scripted the conditional scripts for each dialog node allows for multiple paths along a cutscene (usually depending on choices the player has made in the game), and the action scripts to handle any scripted actions required for a particular part of the cutscene.

Thus dialog editing tutorials should give you some idea of how it works. These two are probably a good start:

General dialog editing (http://www.lucasforums.com/showthread.php?t=180845)
About cameras (http://www.lucasforums.com/showthread.php?t=165950)


What I am trying to do is when my character walks to a certain place, a dialogue starts between two NPC's. Is there a script for that?

stoffe
08-04-2007, 05:46 PM
What I am trying to do is when my character walks to a certain place, a dialogue starts between two NPC's. Is there a script for that?

If you want something to happen when the player walks in a particular location it's usually handled via triggers. A trigger is a "hot zone" you place within an area that fires a script whenever someone walks into it. There are a couple of tutorials for how to place triggers in this thread:

http://www.lucasforums.com/showthread.php?t=145870

As for the script fired by the trigger it could look something like this, as an example (green lines are comments describing what the next line does):

void main() {
// ST: Check if it's the player entering the trigger, and that it hasn't already fired
if (!GetLocalBoolean(OBJECT_SELF, 40) && (GetEnteringObject() == GetFirstPC())) {
// ST: Get the two NPCs who should converse, set their tags below.
object oNPC1 = GetObjectByTag("TagOfFirstNPC");
object oNPC2 = GetObjectByTag("TagOfSecondNPC");

// ST: Check if both NPCs who should converse are present in the area
if (GetIsObjectValid(oNPC1) && GetIsObjectValid(oNPC2)) {
// ST: Make sure the trigger only fires once.
SetLocalBoolean(OBJECT_SELF, 40, TRUE);

// ST: Start the dialog, change DialogFileName to the name of the DLG file.
AssignCommand(oNPC1, ActionStartConversation(GetFirstPC(), "DialogFileName", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE));
}
}
}


Set the parts in red above to the tags of the two NPCs who should talk (Tags are set in their UTC files). Change DialogFileName in the script to the name of your DLG file (without the .dlg suffix).

This will make the first NPC start a conversation the first time the player trips the trigger. The conversation is technically started with the player, you'll set in the DLG file itself so that they will appear to talk to each other.

In the dialog file you only use the Entry nodes for a conversation between two NPCs. Leave the Reply nodes blank to put them in (Continue) mode to link together the Entries. Then you set the tag of who is supposed to talk in the Speaker field of each Entry node, and the tag of the one they are talking to (who they will face) in the Listener field. Alternate the Speaker and Listener field to make the two NPCs talk back and forth.

MacTavish
08-04-2007, 06:58 PM
Stoffe, this is awesome. Thanks alot.