Dr. Strangenif Or: How I learned to Stop Worrying and Love NifSkope
Ok, so this isn't really a tutorial (yet), just a collection of random jottings about the NifSkope file format, specifically in regards to Fallout 3 models (I'll add Oblivion-specific stuff later). This information may be partial, misleading, ill-informed, senseless or just plain wrong, so use at your own risk.
Types of Game Objects
The game uses several different types of objects. My investigations have only touched on two of them so far: static and havoked (clutter).
Static Objects
Static objects are objects that cannot be moved. (That doesn't mean they can't be animated, only that they can't be picked up and moved around by the player.) A good example of a static object is a piece from a tileset (the modular models used to create the interiors of vaults, etc.).
The following information is based on 2 samples: vhallsm1way01.nif and fachallsm1way01.nif
BSX
Settings that control what the nif is allowed to do, or tell the engine what kind of object is, more or less. Static objects use a value of 2 (enable collision).
Extra Data
Both objects have ColGroupInfo = 1 set. Both use Mopps collision with multiple materials. Is this a 'Collision Group'?
Collision
bhkCollisionObject bhkRigidBody bhkMoppBvTreeShape bhkPackedNiTriStripsShape hkPackedNiTriStripsData
The following settings for bhkRigidBody are identical in both nifs:
| Name | Value |
|---|---|
| Layer | OL_STATIC |
| Collision Response? | RESPONSE_SIMPLE_CONTACT |
| Motion System | MO_SYS_FIXED |
| Deactivator Type | DEACTIVATOR_SPATIAL |
| Solver Deactivation | SOLVER_DEACTIVATION_OFF |
| Quality Type | MO_QUAL_FIXED |
Havoked Clutter Objects
Havoked clutter objects are objects that can be picked up, dropped, kicked, and generally knocked around. A good example of a havoked clutter object is an empty Nuke Cola bottle. (This information has not been compared to other types of havoked objects.)
The following information is based on 2 samples: tincan01.nif and ashtray01.nif
BSX
Havoked clutter objects generally use a value of 66. (Enable collision = 2, + 64 ?).
Extra Data
Both objects have Unyielding = 0 set. The tincan01.nif also has NoDecal = 1 set.
Collision
bhkCollisionObject bhkRigidBody bhkConvexVerticesShape
The following settings for bhkRigidBody are identical in both nifs:
| Name | Value |
|---|---|
| Layer | OL_PROPS |
| Collision Response? | RESPONSE_SIMPLE_CONTACT |
| Motion System | MO_SYS_BOX |
| Deactivator Type | DEACTIVATOR_SPATIAL |
| Solver Deactivation | SOLVER_DEACTIVATION_LOW |
| Quality Type | MO_QUAL_DEBRIS |
Nodes and Properties
Some information of interest about specific nodes or properties.
NiStringExtraData
NiStringExtraData is added to pretty much every nif in the game. (And if it hasn't been, it was probably an oversight.) This string is used to tell the game stuff about the nif that is not covered by the other nodes/properties. Here's a short list of NiStringExtraData flags and my conjectures:
- ColGroupInfo
- Set
ColGroupInfo = 1to alert the engine that the object has a group of collision objects instead of a single object? Used on static objects. - NoDecal
- Set
NoDecal = 1to prevent the engine from rendering decals on this object. Used for small objects that shouldn't have things like bullet holes, etc., applied to them. - Unyielding
- Small clutter objects (ashtray and tin can) both have
Unyielding = 0. Does that mean that they're 'yielding'?
Adding a NiStringExtraData to Your Nif
You can add a NiStringExtraData to your nif by using the following procedure:
- Right click on 0 BSFadeNode and select Block -> Insert.
- Scroll down to NiS... and select NiStringExtraData.
- Select NiStringExtraData. You will notice that there are two strings that need to be added in the Block Details window, one called 'Name' and one called 'String Data'. The name is easy to set: just left-click where it says 'Txt' in the value field of the Name row and create a new string called UPB (make sure you get the letters in the right order). To get the string data, see below.
- Copy the string you want to use from another file. Use a vanilla nif that has the same function as your nif. To copy a string, open the vanilla nif in another instance of NifSkope, select NiStringExtraData, left-click where it says 'Txt' in the value column of the Block Details window in the String Data row to pull up the little string editing window, select the string you want to copy so it shows up in the text edit field at the bottom of the little window, highlight the string and copy it to your clipboard.
- Go back to your custom nif and pull up the little string editing window again: select the NiStringExtraData node, left-click where it says 'Txt' in the Block Details window in the String Data row, paste the text in the little text edit field from your clipboard. Count the position that your string has in the list, starting with 0. In other words, if there are 5 strings in the little string edit window, the string you just added will be last and will have an index of 4.
- The NiStringExtraData won't update automatically. You have to point it to your new string. Select the NiStringExtraData node in the Block List window, double click where it says 'Txt' and enter the index of your string. If your index is 4, enter 4.
- You now have a new NiStringExtraData in your nif, but it's not connected to anything. To connect it to the 0 BSFadeNode, highlight the BSFadeNode in the Block List window, find where it says Num Extra Data in the Block Details window, add one to the number of extra data nodes in the value column (ie. if it says 1, change it to 2). Right click on the little green arrows beside Extra Data List and select Array -> Update. Expand the Extra Data List, find the Extra Data List entry that says 'None' and double-click it. Enter the node number of your NiStringExtraData and you're all set.
Last updated July 15, 2011
© 2009-2011 Dave Finch

