www.tombraiderforums.com

Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Level Editor > Tomb Raider Level Editor Tutorials

Reply
 
Thread Tools
Old 02-06-15, 19:26   #1
AODfan
Archaeologist
 
AODfan's Avatar
 
Join Date: Jun 2010
Location: Germany
Posts: 1,479
Default TRNG - How to create basic in-game cutscenes

Introduction
In this tutorial I will try to teach you how to make in-game cutscenes using TRNGís demo feature. If anything is unclear or you have any suggestions, feel free to drop me a PM.


Requirements
ē WADMerger
ē Basic animation knowledge
ē Basic scripting knowledge


01. Preparations
02. Scripting
03. Recording
04. Setting up the cutscene
05. Organizer
06. Camera
07. Advanced camera jumps
08. Speech heads

Last edited by AODfan; 02-06-15 at 19:52.
AODfan is offline   Reply With Quote
Old 02-06-15, 19:28   #2
AODfan
Archaeologist
 
AODfan's Avatar
 
Join Date: Jun 2010
Location: Germany
Posts: 1,479
Default

Preparations

First of all we need to add our cutscene animations to our WAD. In this tutorial I'll be using 2 actors for my cutscene; however you can also use any number of actors.

Open WADMerger and add a new animation slot to your LARA object in which you will place your cutscene animation; to do that, you can go to Animation -> Import (replace) in the drop-down menu or create a new animation in WADMerger from scratch. Once you've done that you should set the next animation to either 11 or 103 so Lara will go into her idle animation after the cutscene is done, you can of course link it to any other animation you want but if you don't change it at all, the animation will simply loop forever. Try to remember the amount of frames your cutscene has or write it down somewhere. It will be important for later!

Save your WAD and move on to the next actor of your cutscene. Your other actors should be either in enemy slots or in one of the animating slots (keep in mind that some animating objects can't play any animations). In my past experiences other slots simply didn't want to play their animations so it's best to stick to one of those slots.

I placed my second actor in the ANIMATING10 slot and added 3 animations. Animation 0 contains a single looping frame; this is what the player will see before the cutscene starts. It's important to trigger the actor before the cutscene starts. If the player isnít supposed see your other actors, simply move them through the ground or walls!

The second animation is the cutscene animation. Make it link to the third animation by changing Next Animation to 2. The third animation is the state the actor will be in after the cutscene finished. In my case it's a key Lara will pick up so I moved it into the ground, made it loop forever, and removed its collision (You can do that by going to Collision -> Disable frame collision in the drop-down menu).
Once you've done that for all your actors, it's time to do some scripting.

Last edited by AODfan; 02-06-15 at 19:49.
AODfan is offline   Reply With Quote
Old 02-06-15, 19:31   #3
AODfan
Archaeologist
 
AODfan's Avatar
 
Join Date: Jun 2010
Location: Germany
Posts: 1,479
Default

Scripting

Open NG Center and scroll down to the Options section. For the ability to create cutscenes you will need to add Diagnostic= ENABLED. This will enable lots of on-screen information in-game. We don't need most of it so we will specify what exactly should be shown, which can be done with the DiagnosticType command. The first field can be anything you want. I mostly add DGX_CHEATS because it doesn't take up too much space. For a full list click on the Reference tab and search "DGX_". In the extra DGX field you now need to add EDGX_RECORDING_DEMO. This will allow us to record our cutscene later in the game. Since it's an extra flag, it can't stay alone, so that's why we needed to add DGX_CHEATS before.

If you've done everything right you should now have the following commands under your Options section:

Diagnostic= ENABLED
DiagnosticType= DGX_CHEATS, EDGX_RECORDING_DEMO

Last edited by AODfan; 02-06-15 at 19:49.
AODfan is offline   Reply With Quote
Old 02-06-15, 19:36   #4
AODfan
Archaeologist
 
AODfan's Avatar
 
Join Date: Jun 2010
Location: Germany
Posts: 1,479
Default

Recording

Compile your script and open the level editor. Place Lara on the square your cutscene will take place and place and add a trigger for F80 on the same square. The flipeffect should trigger Lara's cutscene animation. Nothing else is needed for now so output your WAD and compile your level.

Start the game and load your level. Make sure Lara plays the correct animation. I highly suggest that you enable cutscene organizers by pressing F4! This will allow us to trigger frame specific things later. Even if you don't plan on using them you should still enable it just in case.

Once you've enabled the organizers go back to the main menu and load your level again. While it's still loading press and hold F11. The game will start recording your cutscene the moment your level finishes loading.

I hope you still remember the exact length of your cutscene animation because you will need it now. Try to stop the recording process about the same time your animation ends. It's almost impossible to stop it frame perfect but it's better to stop it a few frames later than a few frames too early. If you ever change the level order or change Lara's outfit (retexturing is fine), you will need to re-record the cutscene so keep that in mind! While recording you can also rotate Lara to reposition her a bit, just make sure the player canít see it later.

Inside your data folder, you should now find a file called demo1.pak. This is your cutscene and needs to be included with your level when you upload it for everyone to play! The text file is pretty irrelevant and doesn't need to be included. It can help you find out which demo.pak file is which cutscene if you have more than one, but other than that itís pretty useless.

Last edited by AODfan; 02-06-15 at 19:49.
AODfan is offline   Reply With Quote
Old 02-06-15, 19:39   #5
AODfan
Archaeologist
 
AODfan's Avatar
 
Join Date: Jun 2010
Location: Germany
Posts: 1,479
Default

Setting up the cutscene

Open NG Center again and scroll down to your level. It's time to use the Demo= command. Use whatever demo flag suits your needs. You can find them all under the reference tab. I'll use DEMF_CINEMA_SCREEN which adds black bars to the top and bottom of the screen (like FlyBy's). Type whatever your demo flag requires in the Parameter field, otherwise just type IGNORE. In the InfoText field you should type IGNORE again as it's only used in the title level before the demo starts.

In the DemoLegendText field you can type a small text to show during the cutscene. You need to type the same text you typed into that field in the ExtraNG section of your language strings. I think it would look a bit strange in our case so I suggest that you just type IGNORE into that field. In the WaitingTime field you can set a specific amount of time before the cutscene will start. However Lara will have to stand still for the amount of seconds you type into that field before the cutscene starts so it's only really useful if you want small demos to play in the title level like in the first 3 games. Just type IGNORE again.

In the last field, the DemoIndex array, you now need to add all the cutscenes that will play in your level. Remember how your cutscene was called demo1.pak? You need to type that 1 into the field now. If you want more cutscenes to play in that level you have to add them there too. Let's say you want to play demo1.pak and demo5.pak in your level. You would just type 1, 5 in the DemoIndex field.

If you're too lazy to type all that or just want to check if you did everything right, you can just copy mine.

Demo= DEMF_CINEMA_SCREEN, IGNORE, IGNORE, IGNORE, IGNORE, 1

Last edited by AODfan; 02-06-15 at 19:50.
AODfan is offline   Reply With Quote
Old 02-06-15, 19:44   #6
AODfan
Archaeologist
 
AODfan's Avatar
 
Join Date: Jun 2010
Location: Germany
Posts: 1,479
Default

Organizer

Now we will set up our cutscene organizer. They basically work like normal organizers but will trigger a TriggerGroup at specific frames of the cutscene. Type FO_DEMO_ORGANIZER in the flag field and the ID of your cutscene in the Parameter field. If it's your very first cutscene it will most likely be 1. The ID is the same we just typed in our Demo command and can be found in the cutscenes file name. Like I mentioned before TriggerGroups will be triggered at specific frames in the cutscene. So if you type 20, 1, the organizer will trigger TriggerGroup 1 at the 20th frame of the cutscene.

You can leave that alone for now and open the editor again.

Move Lara back to her original position and place a LARA_START_POS object on the square your cutscene will take place. We will teleport Lara to the object later so there aren't any inconsistencies in the cutscene later regarding Lara's position. The flat end of the object is where Lara will later face after she was teleported. I suggest that you give the Lara start position object some high OCB code so it doesn't conflict with anything else like enemy AI. Place your actors and triggers for them somewhere in the level that the player has to activate before he reaches the cutscene. Alternatively, you can just activate all 5 OCB code bits.

I'm going to do a TR4 styled cutscene, which means I'll take away the players control over Lara while the screen slowly fades to black before the cutscene starts.

If you want to do the same, remove the flipeffect underneath the start position object so you'll be left with a blank square. Place F51 on the square your cutscene will start at (meaning the trigger wonít be under the start position object) and disable all keyboard commands for 2 seconds. Place F85 on the same square. I set the timer to Long and the extra field to Fade Out and Fade In. Then place F127 to trigger a new organizer that we will create in a bit and set the trigger to One Shot so the cutscene only plays once.
If you want to trigger the cutscene through a puzzle hole, enter the OCB code 1045 and set the Key trigger for the puzzle hole as one shot instead. The OCB code was used in the retail game to trigger cutscenes but since those were disabled in the LE version it doesn't do anything. The benefit of using that OCB code is that the cutscene will start immediately without Lara doing the insert animation first.

Back in NG Center we need to create a new organizer. Use the FO_TICK_TIME flag this time. Type IGNORE in the Parameter field. I want the cutscene to start just before the screen gets brighter again so I trigger my TriggerGroup 30 seconds after I triggered the organizer.

In the TriggerGroup you need to add F379 to start the cutscene. Don't let the numbers in the timer field fool you! Ď1í doesn't necessarily equal demo1.pak. In our Demo command we added the cutscenes we want to play in this level at the very end. Let's say your level contains cutscenes 1 and 5 so you type 1, 5 at the end of the Demo command. If you want to trigger cutscene 1 now you would choose 1 in the timer field but if you want to trigger cutscene 5 you wouldn't choose 5 but 2 since it's the second cutscene in the Demo command. Besides the cutscene itself I also triggered the cutscene audio (F68), Animation 1 for my second actor (A15) and teleport Lara to my LARA_START_POS object (F79).

Compile your script and your level to see if everything is working correctly.

Last edited by AODfan; 02-06-15 at 19:50.
AODfan is offline   Reply With Quote
Old 02-06-15, 19:47   #7
AODfan
Archaeologist
 
AODfan's Avatar
 
Join Date: Jun 2010
Location: Germany
Posts: 1,479
Default

Camera

Now we're going to work on the cameras. You can use the normal camera objects, like Cameras and FlyBys, or the cutscene camera flipeffects. I personally prefer to use FlyBys because they give you a lot of freedom but if you already ran out of FlyBy sequences or still need them I would suggest using the cutscene camera flipeffects.

Place your first FlyBy camera and give it the OCB codes 0 (Snap to start of sequence from Lara cam), 6 (Snap back to Lara at end of sequence), 9 (Disable look key break out), and 11 (Enable Lara control). I recommend enabling 11 because you might have to rotate Lara a bit during the cutscene but if you disable her controls in the FlyBy nothing will happen. The player can't control Lara during the cutscene so you don't need to worry about player messing it up.

Once you placed the camera, export A45 to activate it. Create a new TriggerGroup in your script and paste the exported trigger into it. We're going to add it to our cutscene organizer now. To do that first type 0 so it activates on the first frame of the cutscene and then enter the ID of your trigger group like this:

Organizer= 1, FO_DEMO_ORGANIZER, 1, 0, 2
TriggerGroup= 2, $5000, 806, $2D


If you're using any other method, youíll have to activate your cameras like that too. If youíre using the cutscene camera flipeffects you have to assign a Leading or Extra Actor role to your moveables with A87.

Once youíre done placing the cameras for your cutscene, export F85 with the same settings you used for the beginning of the cutscene. You need to trigger it a few frames before the cutscene ends. In my case I had to trigger it 29 frames before the cutscene ends but it seems to be different for each cutscene. You have to go in-game a couple of times and try to get it right by trial and error. Remember how I said itís better to record cutscenes that are a bit too long? We will now trigger one last TriggerGroup at the frame our cutscene is supposed to end. This TriggerGroup should contain a trigger to cancel your current camera (A45 for FlyBys) and F380 to stop the cutscene. I put the ID of my cutscene in the timer field but Iím not sure if thatís necessary (actually Iím not even sure if this trigger works at all).

Last edited by AODfan; 02-06-15 at 19:50.
AODfan is offline   Reply With Quote
Old 02-06-15, 19:48   #8
AODfan
Archaeologist
 
AODfan's Avatar
 
Join Date: Jun 2010
Location: Germany
Posts: 1,479
Default

Advanced camera jumps

If youíre using Coreís cutscene animations you might notice that sometimes actors stop moving and then jump into a new position. This is because the camera didnít focus on the actor at that point so they didnít have to be animated at that point. Itís really hard to make the camera jump at exactly the same frame the jumping around happens but thereís a simple trick for that. If youíre using FlyBys for your cutscenes you need to start a new FlyBy sequence. Trigger a TriggerGroup at exactly the frame you want your camera to change. The TriggerGroup should cancel the current FlyBy sequence and then trigger a new one. Both can be done with A45. You can only do this up to 7 times in one level! Itís best to use this method if you still have some spare FlyBy sequences or if your cutscene is in a separate level from the rest of your game. If you want to save you sequences you can also try combining different cameras. You could jump from a FlyBy camera to the cutscene camera triggers for example.

Donít be afraid to experiment.

Last edited by AODfan; 02-06-15 at 19:51.
AODfan is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 11:05.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.