Originally posted here: Spydave.com:80
Created by: Spydave
Mirrored here for archival purposes
OK first things first ... have a good understanding of what message your cinema will convey. Plan it out before you begin actually making it. A good guide would be to sketch out some rough story boards. But the purpose of a cinema is to bring some purpose to the game that cannot be achieved through regular gameplay. Some good uses of cinemas are for story building, character building, and plot chances to name a few. There are several articles on cinema building techniques so i will not go very deep into that ... but I suggest you find some of these articles and read up on them ... trust me ;)!
Ok from this view you can see a top down view of the finished tutorial. Basically I have created a simple room ... 4 walls, ceiling, and a floor. I have copied and pasted an exact copy of the room beside of it. The room on the left is to be our room for the cutscene. The room on the right is set up to hold a place from the gamestartpoint ... the place where the Player will spawn in the game. Later we will teleport this 'gamestartpoint' into the cutscene room and remove the Cate actor from the game so it will appear that after the cutscene the player has regain control of the cate character.
So in the room to the right I have placed ...
One Gamestart point
One Insidedef object
On the outside of both maps you will see ...
In the room to the left I have placed ...
Two Neutral AI
Note: When doing cut scenes you want to avoid undesirable reactions from the AI. This is why AI have three states to choose from ... GOOD, BAD, and NEUTRAL. A GOOD AI will not attack another GOOD AI and vice versa for the BAD AI. On the other hand a BAD AI and a GOOD AI will obviously see each other as an enemy and therefore attack. Personally if I'm not wanting my AI to attack each other ... I use the NEUTRAL AI ... which is to say regardless of the state of the AI this one will remain Neutral and not see the other AI as a threat.
One AI brush bound to one AI volume ... to allow for AI movement One Central CinematicTrigger with four keys bound to it One Insidedef object Four Cinematic Triggers set up for dialogue only One teleport object One AI Node One trigger One worldproperties object One Insidedef object And four lights
Here you can better see the placement of the AI's movement. At the start of the cutscene I want Cate to walk (through the AI volume) up to Bruno (desinated by the AI Node) and the conversation should begin (by means of the Trigger object). At the end of the cutscene the player will be spawn in (through the teleportpoint object) ... and the actor Cate will be removed.
Ok so we want Cate to walk to the AI node at levels start ...easy enough to do. Select the Actor Cate and in her properties click on the "Commands" button ... As you can see I have added in the "Initial" field the text ... "goto pts=AINode0" ..... where AINode0 is the m=name of the node I want actor cate to go to. NOTE: we could also make Cate run to this node by adding the text ... "goto pts=AINode0 move=run" Now Cate should at level's start immediately move to AINode 0.
Now let's take a look at our main CinematicTrigger. This one is to be our camera for the entire cinema. Take a quick look at it in the sample map. It's name is "CinematicTrigger0" ... no fancy naming conventions for the tutorial ... I think that makes it easier ... of course you can rename it to anything you like just be sure to reference it correctly. Now the first thing you should notice is it has a series of keys bound to it. Think of these keys as 'camera positions' if you will. During the course of this tutorial CinematicTrigger0 will be moved by commands to these keys giving us different camera angles when needed. Decide what camera angles you have in mind ... set CinematicTrigger0 the active parent in the node view window and insert a key first in the exact position with the exact rotation of CinematicTrigger0. Then insert keys where you want the camera to be positioned and the adjust the keys 'Rotation' fields to give the right angle. Doing that should give your Camera it's path.
Now if we set the 'TimeSamps' in the keys then CinematicTrigger0 will follow the path set by the keys like a normal keyframer. We don't want that in this case so on the 1st key in it's MessageTarget I have "sdf" avoid targer and in MessageName I have: "msg CinematicTrigger0 (keyframer pause)" Which will pause our camera letting us move it when and how we please.
Now look at the properties of CinematicTrigger0. Notice 'CanSkip' is set to 'True' ... meaning the player can if so chooses skip the cutscene and go directly into the game 'StartOn' is also set to 'True' enabling us to start the cutscene at levels start ... NOTE: if you want to enable a cutscene somewhere else besides the levels start the command would be .... "msg CinematicTrigger0 on" Look at the fields ... CleanUpTriggerTarget and CleanUpTriggerMessage ... this message will be sent either at the end of the cutscene ... when CinematicTrigger0 is turned off ... or if the player chooses to skip the cutscene by pressing the spacebar.
CleanUpTriggerTarget = some void field I use "sdf" ... you can also put in the name of the object you want to target ... but that will limit you to just that one target using "sdf" will allow you to send messages to mulitiple objects ... and that is what we need. CleanUpTriggerMessage = msg AI_NEUTRAL_Hero0 remove;msg player (teleport TeleportPoint0); msg player (fadein 2.0) meaning .... msg AI_NEUTRAL_Hero0 remove ... will remove 'actor cate' from the level. msg player (teleport TeleportPoint0) ... will teleport the player (gamestartpoint) to Teleportpoint0 ... which I have placed near 'actor Cate's' location. msg player (fadein 2.0) .... will fade in making the view not so hard when the camera shifts to player view ... 2.0 is a time increment and can be adjusted to how you see fit.
Hit the 'Camera' button now notice the CinematicTrigger defaults to a camera ... that is already set up for us. There will be a time when this will be changed ... as in our CinematicTriggers used just for dialogue later on.
Hit the 'KeyFramer' button Now we have our CinematicTrigger set up with a series of keys bound to it ... but we need to make it a keyframer. Set "CreateKeyFramer' to 'True' In the BaseKeyName we need to reference to our Keys ... I left them at their default name Key ... (Key0, Key01, Key02, Keyo3) ... so the BaseKeyName would be "Key" Like wise if I had named them Camera0, Camera01, Camera02, Camera03 ... then the BaseKeyName would then be "Camera".
Now when 'actor Cate' gets to the AI Node we want the dialogue to start. I have set a Trigger object to turn on one of our CinematicTriggers used just for dialogue. Now by default an AI will not activate a Trigger ... by default only the player passing through a Trigger will activate it. So... In the triggers properties ... set 'AITriggerable' to 'True' Then in the 'AITriggerName' place the name of the AI you want to activate the Trigger by touch. In our case it is "AI_NEUTRAL_Hero0" our 'actor cate' .
Now click on the Trigger's 'Targets' button. This is where we can use the Trigger to send messages to other objects. You will see I have used the Trigger to turn 'Talk1' ... (one of our CinematicTriggers used only for dialogue) ... to the on state.
Please take note in 'Talk1' the 'CreateCamera' is set to 'False' in the 'Camera' properties .... and it is not set up as a KeyFramer in the 'KeyFramer' fields ... as was CinematicTrigger0. ... the same thing applies to 'Talk2', 'Talk3', 'Talk4'. These CinematicTriggers will be used ONLY for the purposes of in game dialogue.
Now if you will notice in 'Talk1's' DialogueDoneTrigger I have my 'sdf' field and in the 'DialogueDoneTriggerMessage' I have ... "msg CinematicTrigger0 (keyframer (goto Key01))" This message is sent at the end of the dialogue ... so when no more dialogue is specified this message is sent and CinematicTrigger0 is sent to Key01 (my second camera angle ... counting the first key which paused CinematicTrigger0.
But we still have to make our characters talk ... In 'Talk1's' properties click the Dialogue' button. You will see a field called 'Delay' ... will will delay the sending of the dialogue by a time value you can set here. 'Dialogue1' is the name of the sound file you want to play ... in this case '10003'. 'WhoPlaysDialogue1' ... is simply the name of the AI who is to say this line ... in this case 'Actor cate' 'StartDialogueTriggerTarget' is simply the void field 'sdf' ... you will notice the list expands to a possible choice of twenty different dialogues ... Dialogue2 will follow after Dialogue1 ... and so on.
Now the way we have it set ... after the dialogue is finished we send Cinematictrigger0 to Key01 ... when it reaches Key01 ... Key01 has in it's 'Messagename' field ... "msg CinematicTrigger0 (keyframer pause); msg TALK2 on " ... which again pauses CinematicTrigger0 on turns on 'TALK2' this time.
now that you are getting the picture continue on using the above method to set up the rest of your dialogue.
1. Turn on Dialogue CinematicTrigger 2. Have camera (CinematicTrigger0) move to next key by 'DialogueDoneTriggerMessage' 3. In keys 'Messagename' field turn on the next Dialogue CinematicTrigger ... on and and on ... till you get to the last Dialogue CinematicTrigger ... in our case 'TALK4'.
... notice in 'TALK4's' 'DialogueDoneTriggerMessage' I have the command "msg CinematicTrigger0 off" which ends the cinema!
I hope this tutorial can help you better understand cinemas in NOLF ... and I hope you have found it useful