Making Ridable Creatures

From the Oblivion ConstructionSet Wiki
Revision as of 06:02, 1 July 2006 by imported>Yarharhar
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This tutorial will walk you through the steps of creating a new ridable creature. In this case, we are going to make the mountainlion creature ridable, but you should be able to use this process on most of the other animals.

Note: This is an advanced level tutorial. If you are not comfortable with the BSA unpacker, a hex editor, and nifskope, then this is not for you. If you would just like access to new ridable creatures, there is already a project for that.


Just getting it to work

Step 1: Choosing a Creature

What you'll need for this step

  • Oblivion
  • BSA Unpacker
  • Oblivion creature meshes/animations


What to do

If you have not extracted the Oblivion mesh files, do so now. For an explanation on how to do this, check out the BSA_Unpacker_Tutorial.

First decide what animal you want to make ridable. This tutorial is going to use the cat, so for best results, use that. After extracting the mesh files, navigate to meshes/creatures/mountainlion.

Next, we are going to copy this directory and all its file and move it to the oblivion data folder. We also need to rename this folder as the changes we make to the mountain lion will be quite significant and we don't want to overwrite the stock oblivion one. For this tutorial we are going to use the folder name “lionRide”. So copy/rename the mountainlion folder to your Oblivion/data/meshes/creatures/lionRide folder.


Step 2: Preparing the Skeleton

What you'll need for this step

  • The lionRide folder you've made
  • The horse skeleton file
  • The Construction Set
  • Nifskope
  • A hex editor. If you need one, XVI32 is free, small download.

Bip02'ing the bones

If you tried to go into the construction set right now, took the stock mountainlion, and changed its creature type to horse, you would be greeted with a multitude of error messages about unreferenced nodes and such. This is because for animation reasons, horses in Oblivion use a differently named skeleton than other animals/players. When switching the creature type to horse, Oblivion expects this alternate skeleton naming convention.

There is good news, however! The only difference between regular and horse skeletons is that regular creatures' skeletons use bones named Bip01 <bone name>, while horses use Bip02 <bone name>. Just a single number difference. It's also quite easy to convert to the horse naming format with a hex editor.

So, what we need to do now is open up every one of the lionRide files(.nif AND .kf) in the hex editor of your choice (Note to visual studio users: Visual studio can't find/replace text strings in the hex editor, sorry). In the hex editor, go to the find/replace feature and set it to text string mode. Set the editor to search for any instance of the text "Bip01" and have it replace it with the text "Bip02" (without the quotes). Then just have it run the replace-all option. There should be around 40-50 replacements per file.

Copying Horse Nodes

The lion skeleton is almost ready now. There are three nodes we need to add the lion skeleton; I will first describe their purposes. Mountable creatures have two special nodes named "ActorParent" and "EntryPoint".

"EntryPoint" determines from where a player approaches a mountable creature (usually the left side). This node is also necessary for dismounting as it determines where the player ends up after getting off the horse.

"ActorParent" determines where a player attaches to the mountable creature. By making it a child of different bones, you determine where they ride on the animal (For example, making it a child of spine2 results in the player riding on the creature's back, which is desired). This however, brings up an interesting problem. Bone positions/scales/rotations are determined in part by their placement in a creature's skeleton, but can be changed and overwritten by animations. We can't actually change ActorParent's scale/rotation/position to fine tune where the player is positioned on the animal, as the values will get overwritten by animations that get played. This is where the third node comes in.

The last node we add is a new, unique node that won't be referenced in any animation or model files. It's only purpose in the skeleton is to have translations/scales/rotations and have the ActorParent as its child. It then passes any transformations it has down the line to ActorParent and then the actor mounted on the creature!

So let's start by adding our custom transformation node. Open the skeleton.nif file in your lionRide folder, with nifskope. We need to insert a blank node. To do this, right click on the block list window and in the block menu that pops up, choose insert. The node type you want to insert is 'ninode' located under the 'n' section. After inserting it, move it to the bottom of the tree (just highlight the node, hold control+down arrow). Name it something unique, I'm going with 'xform'. You don't need to make any other changes at this point, just save the skeleton.

Now, navigate to the meshes/creatures/horse folder and open up the skeleton.nif inside, with nifskope.

In nifskope, find the node named "ActorParent" (Should be node 195), right click it, and select "copy branch". Now, using this same instance of nifskope, navigate and open up the skeleton.nif in your lionRide folder once more.

Back in the lionRide skeleton, right click the block list window and choose 'paste branch'. This will put the ActorParent node into the lion skeleton with all the data it needs. Now we just need to link it all up. In the 'xform' node, double click on its 'num children' attribute, and increment it by 1. Then, in its list of children, make the new child link point to the ID of the ActorParent node in the skeleton (This number is probably 266).

Now, find the bone in the skeleton you want the player to be riding off of, let’s try Bip02 Spine2. Navigate to said node (36), and give it a new child link, pointing to the xform node. Now save your changes.

The last step is similar. Go back into the horse skeleton, and copy the node “EntryPoint” (Should be ID 291). Go back into the lion skeleton and paste this branch as well. Then make this node a child of the 'Scene Root' ninode.

At this point, your skeleton is usable!

Step 3: Mounting/Dismounting - Part 1

What you'll need for this step

  • The lionRide folder you've made
  • The horse mounting/dismounting animations
  • The Construction Set

Get the animations

Now we need to add the mounting and dismounting animations to the creature. Navigate to your meshes/creatures/horse/idleanims folder, and copy the horsemount.kf and horsedismount.kf files. Paste them into the meshes/creatures/lionRide/idleanims folder, and rename the files catmount.kf and catdismount.kf, respectively.

Setting up the Creature

Now open up the construction set and load the Oblivion master file. In the object window, navigate through the creatures list until you find the stock mountain lion (CreatureMountainLion). Duplicate it with the ID of your choice (I used RidableMountainLion) and name it "Riding Lion" or something to that effect.

The other changes you'll need to make to it: Change the creature type from "Creature" to "Horse". Change the skeleton file to point to the lionRide/skeleton.nif you've been editing. Under AI, turn down its aggressiveness so it doesn't attack everyone, and remove it from the creature faction. At this point, place the creature somewhere in the world, for testing purposes. I normally just stick them in the market district somewhere. One thing to note: You should NOT be getting any error messages at this point, if you are, then you've done something wrong.

Once you've placed the creature, save this mod as an esp, and then reload it. We need to edit the creature's idle animations (and they won't show up until a save/reload of the mod file).

After reloading the mod in the construction set, navigate to the gameplay->idle animations folder. On the left side, find the idle animation corresponding to your creature's folder (It should be lionRide). We need to add the idle animations that correspond to mounting and dismounting the animal. So right click on your lionRide entry, and choose "Insert Child". Give the child ID "lionMountDismount", require it to return a file, and give it condition "Getsitting > 0".

Now give lionMountDismount two children. One named lionMount, the other lionDismount. For the lionMount animation, select the catMount.kf file, and for the dismount animation, give it catDismount.kf. lionMount needs to have condition "Getsitting == 12", while lionDismount needs condition "Getsitting == 14".

Once you've set up these values, save your mod, load it into Oblivion, and try it out!

...and now you've probably noticed that the lion looks absolutely ridiculous while mounting and the player looks just as silly while riding. Don't worry! We'll deal with that in the next section!

Making it look good

I'm still writing this section up. In the meantime, here is a list of things we will cover:

  • Correcting the mounting/dismounting animations using the Oblivion Mount Project Animation Warper(the OMPAW)
  • Reducing the crazy bobbing movements of the player while on the cat
  • Changing the cat's size (Making it BIGGER)
  • Adding the player's riding animations to the cat with the OMPAW
  • Giving it proper 'mount' A.I.
  • Creating makeshift animations for actions not covered by the stock cat's animations, like jumping, swimming, etc.