NorseDude - Part V: Improving Cut-Scenes

NorseDude's Cut-Scene Tutorial

Note: these tutorials were written prior to the new cut-scene functionality added by BioWare in patch 1.30.


The purpose of these tutorials: To help the average NWN module maker create his or her own cut-scenes in NWN. Simple as that.


Requirements: Not much, but I do expect you to know at least the basics in module-creation. When I say "Create a NPC named 'Bob' with the Tag 'bob'", I will not tell you how to do just that since I expect you to know that already.


My e-mail: norsedude@tiscali.no


Part V: Improving the Cut-Scene

By now you should have a module where you talk to a guard, he takes you to his leader and then they have a very short conversation. The cut-scene works, but it's just a basic one. The stuff you can do with a cut-scene is limited to only your imagination, and there is no way I can cover everything. So for now, I can help you improve the one you already have to get you started. What you need to remember is a cut-scene is basically just a normal script combined with another normal script, and perhaps with a normal conversation or two. The problem is to do the actual scripting, but I can help you with some of that by giving you a detailed list of some common things you might want to do:


Make a NPC open a locked door: Simple. Just take a door, mark it as "Plot" so the player(s) can't break it, mark it as Locked, and require a special key to unlock. The Tag of the key can be anything. Now create the NPC who will open the door unless you already have one, and check his inventory. Create a new key, and give it the same Tag as the lock (the lock, not the door). Remember the line where the NPC walks to the door? "ActionOpenDoor(oDoor);" will have the NPC open the door, but what it is is locked? Just place the line "ActionUnlockObject(oDoor);" before this line and there you go! The player can't open the door no matter how hard he tries, but the NPC can since you gave him the key.


Make the NPC speak to another NPC: Even easier. The guard told the leader he had a prisoner, and the leader said he would take it from here, right? Well, there you go. Just add another PC response, leave it empty and add another NPC response. Keep doing this until you are happy. The Speaker Tag can be anything you want, but obviously it doesn't make much sense unless the NPC who speaks the lines are in the room.


Make the guard walk back to where he came from after delivering the prisoner: Make a waypoint where the guard is standing before he starts walking, and Tag it "WP_guard". Now add the line 'object oGuardWP = GetObjectByTag("WP_guard");' in the first script along with all the other objects. Under the object-part, type in "location lGuardWP = GetLocation(oGuardWP);". Finally, when you want the guard to walk back, simply "AssignCommand(oGuard, ActionMoveToLocation(lGuardWP));"


It's very simple, really. First we tell the game we need another object, the waypoint. Note you can use GetWaypointByTag instead of GetObjectByTag. Both will work on waypoints, and some find it easier to remember that way. I prefer to just use GetObjectByTag on all objects, but it's up to you what you want to use. Same with the two next lines, location lGuardWP and ActionMoveToLocation. First of all, you don't need that location-line at all if you don't want to. As I said earlier a waypoint is an object just like a creature or a placeable, so you could use 'ActionMoveToObject(GetObjectByTag("WP_guard"));' instead of "ActionMoveToLocation()". Personally I find it easier to handle if I put all the physical objects first, and then all the locations afterwards.


Summoning stuff that talks: Imagine this: You're walking down a corridor in a long abandoned castle, and find a large door. Just as you are about to open it, a NPC appears from thin air and warns you to not open the door, and then suddenly leaves again without a trace (a standard NPC might be dull, but what about a ghost - or mysterious person hidden in a cloak?). This can be done in many ways, including in a cut-scene. The easiest way is to create the creature you want to spawn in, note it's Tag and use that to spawn in the creature:


void main()
{
     /* This script will summon the creature with the Tag "strange_dog_1"
        at the waypoint with the Tag "strangedog1"
     */

     string strTemplate = "strange_dog_1";
     location locLocation = GetLocation(GetObjectByTag("strangedog1"));
     int bUseAppearAnimation = FALSE;
     CreateObject(OBJECT_TYPE_CREATURE, strTemplate, locLocation, bUseAppearAnimation);
}

For this script to work, you will need one creature with the Tag "strange_dog_1" and one waypoint with the Tag "strangedog1". You will also need to make the conversation for the creature before hand, as in the blueprint. To make it go away again after the conversation, simply use a "DestroyObject(OBJECT_SELF);" command in a script and launch it at the end of the conversation assigned to the creature you want to disappear. If you place the first script in the onEnter-slot on a trigger, this will make the creature appear from thin air at the waypoint. The player will need to manually talk to the creature, but after the conversation the creature will go away. If you set the bUseAppearAnimation to TRUE, the creature will even spawn in with a fancy animation effect.


Why do I mention all this, if it doesn't have anything to do with a cut-scene? Well, since it can easily be put in a cut-scene if you want. What if you are in a dark, scary cave, and suddenly a ghost appears and asks you to retrieve it's magical ring? You enter the cave, find the ring inside a chest, and get stuck in the spider's web. The ghost appears just as the huge spider appears, and you throw it the ring. With this ring, the ghost manages to kill the huge spider and rescue you. All this in the same cut-scene. And by now, I think you know how to do all this as well!


The Camera: Friend or Foe? The camera in NWN is great when it comes to playing - but it's very bad when it comes to cut-scenes. Sure there are a few mods out there that can fix this, but if you want to use that camera it would require everyone who plays your module to have the same mod installed. The only way to work around this is to have the mod included in the module-file (zip, rar, or whatever) which would take a lot more space than required, telling everyone to install that file in your readme-file, or let those who want the mod use it and don't use it in the module itself. I know it would be very interesting if you could focus the camera in a dark spot in a corner, in another room and so on, but unfortunately this isn't possible. What is possible however is rotating the camera through a SetCameraFacing() command.





 author: Michael Kenyon, editor: Charles Feduke