lfnetwork.com mark read register faq members calendar

Thread: Creating Static Cameras
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 09-04-2013, 07:20 PM   #1
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,281
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
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
2. tk102’s Dialogue Editor
3. stoffe’s ERF Editor
4. Fred Tetra’s KotOR Tool (Here is the original release thread for those interested, the download link there is down)
5. Utility Armbands

Here is the original link for the armbands. All credit goes to Star Admiral for the creation of the utility armbands, I just modified his script to include two new fields necessary to orienting the cameras correctly. I also modified his setup of the installer to work for KotOR 2 as well.


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.

FieldOfView – Another numeric value, this acts similar to a zoom setting, allowing you to give the camera a larger space to look at, without moving its actual location. I don’t mess around with this too much, and the few times I did set it to an extreme, like one hundred, the camera’s view looked odd. I generally keep FieldOfView in the fifty-five to sixty-five range.

Height – This gets added on to whatever you set as the value for the Z coordinate in position (more on position later). I find the average height of a person in the KotOR games tends to be around 1.5 so I generally set most cameras to have a height nearer to that number.

Orientation –

Here is a picture of a basic orientation field:



Now this is the part about cameras that got under my skin when I was first learning to use them. Essentially, as you can see above, the orientation requires two numbers. However, KotOR apparently uses quaternions (weird number value used nowhere else in the game) to calculate the orientation for static cameras and I, for the life of me, had never been able to get the orientation to work very well when first starting out. So, I eventually became frustrated enough with guessing and checking that I added a little bit to the orientation armband’s scripting (from K1 Utility Armbands) in order to give me the correct values to input into the orientation fields (more on that later).

Pitch – This one’s rather simple. It’s just a numerical value that determines if the camera is pointing up, down, or straight. It can range anywhere from 0 to 180, with 0 being straight down, 90 being straight ahead and 180 being directly up. The range might even go beyond 180, or below 0, but I’ve never tried that.

Position -
Here is a picture of a basic position field:



Position, as you can see, has three slots. The top is the X coordinate, the middle is the Y coordinate and the bottom is the Z coordinate. You enter a specific value for each one, depending on where you want the camera located in the area.
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.

Show spoiler

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).

Show spoiler


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.

Show spoiler


Show spoiler

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.

Show spoiler


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).

FieldOfView – Again, as I said earlier, generally keep FieldOfView between 55 and 65. For this one I’ll just leave it at 65.

Height – I usually set this at about 1.5, because I find that amounts to the average height of a person in the KotOR’s. Depending on what you want to do though, this may be much higher or lower.

Pitch – I’m going to have mine at 90, because I want my camera facing straight ahead (0 makes the camera look directly down and 180 makes it look directly up).
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.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version

Last edited by Fallen Guardian; 10-08-2013 at 09:16 PM. Reason: 9/4/13 - Added links. 9/5/13 - Added PDF and RTF files for download. 10/8/13 - Added link for cheat enabling tutorial.
Fallen Guardian is offline   you may: quote & reply,
Old 09-04-2013, 07:43 PM   #2
newbiemodder
Gentleman Modder
 
newbiemodder's Avatar
 
Join Date: Feb 2009
Location: Chicago
Posts: 701
Veteran Modder 
Nice job FG. Very thorough. FG's in conjunction with this thread

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

Covers placeable camera making. Well done!!


Who's more foolish, the fool or the fool that follows?

Just exactly what is a head-piece to the Staff of Ra?

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

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

http://www.lucasforums.com/showthrea...t=newbiemodder
newbiemodder is offline   you may: quote & reply,
Old 09-04-2013, 07:54 PM   #3
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,281
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Quote:
Originally Posted by newbiemodder View Post
Nice job FG. Very thorough. FG's in conjunction with this thread

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

Covers placeable camera making. Well done!!
Thanks nm, I'll add that link to the top of my post.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 09-04-2013, 10:43 PM   #4
supreme kotor
Junior Member
 
supreme kotor's Avatar
 
Join Date: Mar 2013
Location: I'm lost.
Posts: 324
Current Game: Modding.. Wait is that a game?
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.

Sorry-SupremeKotor


Current WIP: Learning to mod Kotor
supreme kotor is offline   you may: quote & reply,
Old 09-04-2013, 10:58 PM   #5
Fair Strides 2
Junior Member
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 495
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by supreme kotor View Post
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.

Sorry-SupremeKotor
Use Abiword.


Always remember modders: "Quality= Effort*Time"

Quote:
Originally Posted by Jae Onasi
Hi! I messaged him on Facebook and got this answer: "Sure if he wants to release a new KSE, no problem. I'm surprised he was able to find all the perl modules. I released them a long time ago but they were buried somewhere in the KSE thread." So, go for it--please give him credit for the original work, though!
KSE 3.3.4 is LIVE!!! Check it out here.

12/13/13 -- Fixed KSE 3.3.4 bugs. Please check the above link.
Fair Strides 2 is offline   you may: quote & reply,
Old 09-05-2013, 05:14 PM   #6
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,281
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
Quote:
Originally Posted by supreme kotor View Post
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.

Sorry-SupremeKotor
No trouble at all, I'll add an .RTF and a throw in a .PDF file as well.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Creating Static Cameras

Thread Tools
Display Modes

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

Forum Jump


All times are GMT -4. The time now is 03:49 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.