Creating Static Cameras
In response to Fair Strides' request for a more detailed tutorial on cameras I've made one. This one only covers static cameras, but I'll probably write one on animated cameras later on.
You can download the tutorial in .docx format here.
You can download the tutorial in .pdf format here.
You can download the tutorial in .rtf format here.
Here's another tutorial on cameras by Tupac Amaru which goes over the very basics of cameras. It covers some things I do and some things I don't. I actually used Tupac's method for orientation, but I've found that you need to subtract 90 from your base angle in order for it to work (and that is reflected in the source script for my addition to Star Admiral's armbands).
Without further ado, let's get started:
Cameras in the KotOR games are rather simple once you get the hang of them, but before I start explaining much let’s do a quick overview on what cameras are.
Cameras: Static viewpoints that you can setup at any given location in an area. They provide you the freedom to make in-game dialogue into more than just a sequence of talking. For the purpose of this tutorial cameras will only refer to static cameras, not animated cameras.
Prior to starting any kind of modding you’ll want the proper tools for what you’re doing. So, without further delay, here are the five things you’ll need to make a camera.
1. tk102’s K-GFF Editor
Make sure all these tools are installed and ready for use before beginning this tutorial. K1 Utility Armbands is a mod, so therefore it will install into the game’s directory via the TSL Patcher but it is still necessary to have installed in order to follow this tutorial. You will need cheats enabled for this tutorial. I recommend this thread to walk you through the process of enabling them (note that the cheat enabling process in this thread is for KotOR 1, however essentially the same steps can be applied to KotOR 2 as well). Also, to be clear, this tutorial covers static cameras only. Animated cameras are not covered at all.
Before you start making your camera, you’ll have to extract all the files from the game that are necessary for its creation.
So, open up KotOR Tool. Depending on which game you wish to edit, expand the KotOR 1 tree or the KotOR 2 tree. I’ll be editing KotOR 1 for this tutorial, so I’m going to expand that one.
After you’ve expanded your game’s tree, expand RIMs, then Modules. From there you’ll be presented with a list of modules found within the game. The module names displayed here are the game files’ actual names. To help with matching these names to the areas you visit in-game, I recommend looking here for KotOR 1, and here for KotOR 2.
You’re going to need to expand the module name which is not followed by an “_s” (without the quotes, of course). I’m editing Manaan Ahto West for this tutorial so I expanded manm26aa.rim.
From there you want to expand Dynamic Area Info. There you’ll see a GIT file, the base file in which a camera’s information - and many other bits of data pertaining to a module - is stored.
Extract it to a directory of your choice (I recommend a folder titled Module GIT File).
Next, you’re going to want to create a folder in the directory where the extracted GIT file is. Name this folder “Original Module Files.”
Once that is done, you’ll want to select the .rim and extract the entire RIM file to your newly created Original Module Files folder. Repeat this step for the _s part of the module you’re editing (in my case, manm26aa_s.rim).
Now, you’re going to want to open up the GIT file you extracted with tk102’s K-GFF editor. When your GIT file is open, I recommend you fold all trees by going to View -> Fold All, and then only expand the struct labeled CameraList.
Below you’ll find the layout of a GIT file’s generic camera entry that can be found under CameraList.
CameraList is, as you’d imagine, a grouping of all the cameras contained within this one GIT file. The cameras are then separated into STRUCT’s. Now contained within any camera’s STRUCT, you have six fields that flesh out the identity of this individual camera.
CameraID – This is a numeric value given to your camera so it can be used later in a dialogue file. This number can go anywhere from one to infinity, I imagine, but I’ve never had a module go above one hundred cameras. Also, I’d endeavor to make sure this ID is unique – I’ve never had a module where two separate cameras used the same CameraID, but I’m guessing it wouldn’t be pretty.Usually, whenever you create a camera you’ll want to select the whole STRUCT and copy it. Then, select the CameraList and paste it. This is a fast way to give you a camera which won’t override any of the existing ones, providing you change the camera ID number.
All right, now that we’ve gone through the basics of the GIT’s camera layout, let’s move onto actually creating a camera.
To start off you, you’re going to want to get all the information necessary from the game, so fire up whichever KotOR you’re modding. When you first get into the area you want a camera, make sure to enter in this cheat “giveitem sa_ori_arm” minus the quotes, of course. This will give you the orientation armband. When activated, this armband gives you tons of information about the playing character’s position, angle orientation, bearing, X and Y orientation, distance from other objects, closest types of objects to the player, etcetera.
(NOTE: The armband gives you the information about the PLAYING character. This means your character that you name and play the game as for the most part. As it is setup currently, if a party member were to use the armband it would still shoot back the player’s information.)
So, as you can see below I’m on Manaan, talking to my trusty, and very enduring, friend Trask Ulgo.
Now, say I wanted to have a camera set up facing that Sith Officer standing next to me, I’d need to walk over there, face her, and then use the orientation armband.
To face the way you want the camera to face, I recommend going into first person mode by pressing caps-lock, or whatever key you have it as, and moving around until the center of the screen is where you want the center of the camera to be.
It’s very important to remember that when the orientation armband gives you the orientation, it is NOT the orientation of the third person camera, but the actual direction the player model is facing (I made this mistake when first using the orientation armband).
Anyway, so once you’re off and facing the way you want your camera to face you should equip the orientation armband and use it (it equips just like an energy shield is and is used like one).
After using the armband, you’ll need to recover the information it has gathered by going to the Feedback screen. This can be found by going to the messages screen in the menu, then clicking on show feedback.
In the show feedback screen, as you can see above, it says that my poorly random-name-generated character has used the orientation armband and then it begins the output, showing you all kinds of information. We’re currently interested in only three things however: player position, quaternion X and quaternion Y.
(NOTE: The quaternion inputs are only available with the custom version of the utility armbands which has a download link at the top of the tutorial.)
Player location is shown in the screen above, as is quaternion X, but we’re going to need to scroll down for the Y.
Now that we’ve gotten all the inputs needed for the orientation of the camera it’s time to go back to the GIT file and enter the information. Copy a preexisting camera STRUCT and paste it, as described earlier, to give you your own camera. Find the orientation field, then enter in the quaternion X orientation into the top box and the quaternion Y orientation into the bottom, such as below.
Now the position information is given to you as a set of three numbers, in my case:
-67.875 -3.850 57.50
These numbers are the X, Y, and Z coordinates, respectively. Enter them into the GIT field, X going into the top slot, Y into the middle and Z into the bottom, as it is below.
Next we’ll do all the other fields that don’t really require information from the armband:
CameraID – I’d make this number one higher than the ID of the last camera in the module (i.e., if the camera found above yours in the CameraList has an ID of 9, make your camera’s ID 10. My camera ID in this case actually is 10).Okay, so you’re finished with the GIT, save it and close K-GFF (or leave it open, if you prefer).
On to the dialogue portion!
Putting the camera into dialogue is really simple actually. You setup your scene/conversation in the DLG Editor and when you’re done, you can go back through and add in all your camera entries. In my case I only have one camera I’ll be using, and it’s for testing purposes, so my dialogue looks like the picture below (for those that need a comprehensive tutorial on how to setup dialogues, I recommend this one and this one to cover most of the basics).
To enter in your camera, select the node you want to edit. Then, change the CameraID field to your camera’s ID field, and the camera angle to 6, as it is shown below (the camera angle for static cameras must ALWAYS be 6).
You might want to add a delay on there too, depending on what you’re doing with the camera. I set my delay to 30, so I’d be sure that I would have enough time to look at the camera and make sure it was setup properly. When you’re done setting up your dialogue save it.
Now open up stoffe’s ERF editor.
We’re going to use stoffe’s ERF editor to create a .MOD file. .MOD files are used to “override” the original information for the module that was found within your module’s two .RIM files (in my case, manm26aa.rim and manm26aa_s.rim) with your newly modified information. I put override in quotes because the two original files themselves are never actually replaced (and they never should be). The game uses a .MOD file above a .RIM file to load a module when you’re playing the game. If a .MOD exists, it ignores the two .RIM files, essentially. This allows you to “override” the original game without actually deleting or replacing the game’s original files.
So, on to creating your .MOD.
Go to the File menu in the ERF editor, then hit new (or just press Ctrl+N).
This will cause a Save As dialogue box to pop up. Navigate to the directory where your GIT file, and your Original Module Files folder, is located. Make the file name the same name as the module you’re editing (in my case, manm26aa) and change the save as type from ERF file to Module file. Then hit save.
Now because there are no files in your new .MOD, no .MOD file will show up in your directory. So, the next step is adding all the files. Click the Add Resources to this File button.
This will cause an Open dialogue box to pop up. Navigate to the Original Module Files folder you created earlier, and open it. Once there, select all the files inside it and click the open button in the dialogue box. Then save the .MOD.
This will cause your .MOD to be filled with all the files from both the module’s .RIM’s.
Now you want to add in your modified files. Select the add resources button again and navigate to where your GIT file and dialogue file are. Add them both to the .MOD
(If your dialogue is just for testing purposes, like mine, you’ll probably want to put it in the override).
Take your newly-saved .MOD and put it in the modules folder (SWKotOR/SWKotOR2 -> Modules).
Go in game and make your way to the module you’ve added the camera to.
(NOTE: You MUST load a save from before having entered the area in order for your camera to actually show up.)
Your camera should now show up within your dialogue.
That’s all there is to it.
Nice job FG. Very thorough. FG's in conjunction with this thread
Covers placeable camera making. Well done!!
Hey FG, great tutorial really very useful. Thank you very much! And I'm not trying to be "that guy" but is there anyway you could add I link of that tutorial I'm .rtf format(or at least send me one)? I have no way to open .docx.
|All times are GMT -4. The time now is 05:32 PM.|
Powered by vBulletin®
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
LFNetwork, LLC ©2002-2011 - All rights reserved.