File information

Last updated

Original upload

Created by

scanti

Uploaded by

scanti

Virus scan

Safe to use

About this mod

What does it do? It allows you to create and use a unique texture for every NPC in the game by using a simple OBSE plug-in. At the moment it only works with OBSE version 12 and Oblivion version 1.2.0.416. If you don\'t have OBSE (Oblivion Script Extender) then you can get the latest version from http://obse.silverlock.org. I\'ve includ

Permissions and credits
What does it do?

It allows you to create and use a unique texture for every NPC in the game by using a simple OBSE plug-in. At the moment it only works with OBSE version 12 and Oblivion version 1.2.0.416.

If you don't have OBSE (Oblivion Script Extender) then you can get the latest version from http://obse.silverlock.org.

I've include some examples to show how it works. I've slightly changed the faces of Uriel Septim and his bodyguards at the beginning of the game. I've also included a NPCTest.esp file that adds an example NPC in the passage way just after the secret door in your prison cell.

This is a beta version at the moment. The plug-in makes some changes to the way the game handles the loading of textures. The only side-effect I can think that it could make is remove some ArchiveInvalidation problems. However if you come across a problem then let me know.


How does it work?

It utilises the texture caching mechanism the game uses for the NPC racial textures. The racial textures are a combination of 50 textures that are in the egt files that are controlled by the texture sliders. Obviously merging together 50 textures every frame would slow the game right down. So the game merges together the textures into one unique texture for each NPC.

If you look in the Oblivion-Textures-Compressed.bsa file you'll find a directory called textures\faces\oblivion.esm. This contains several bluey grey looking textures. These are actually saved NPC racial textures and saves the game from having to blend the 50 textures each time. The problem is that the game is hard coded to only read these cached textures from the bsa file specified by the SMasterTexturesArchiveFileName1 setting in your Oblivion.ini file.

What I have done is change the engine so it checks your data folder before checking this bsa file. This will allow to create your own custom cache files. I also changed the engine so it will look for cached files from esp plug-ins. (It only checked esm plug-ins before). Plus I also fixed a bug that meant the file it looked for included the plug-in number part of the form id, which meant that if you changed the order of your plug-ins the form-id of the files would change.

The plug-in now has it's own settings file. This is saved in your My Documents\My Games\Oblivion folder and has the file name OBSEplugins.ini. If this file doesn't exist then one will be created. The settings are under the section [NPC Tweaker] and they are:

bEnabled - If set to 0 then the plug in is disabled and won't do anything. 1 enables the plug-in.

iCSGenerateTextures - Controls what racial textures are generated by the construction set when you select Export NPC Face Textures from the Character menu bar. The settings are:
0 - Only generate face textures from any loaded esm files. (This is what the CS usually does).
1 - Only generate face textures from any loaded esp files.
2 - Generate textures for all loaded plug-in files.

bCSShowTextures - If set to 1 then any characters displayed by the construction set will use your custom made face textures and not the generated ones.


I've include the source for the plug-in in the src directory.


How do I create my own textures?

The first thing you need to do is find out the form id of the character you wish to alter. You can find this out by hovering the mouse over the NPC's name in the construction set.

The naming convention for the cached textures is:

textures\faces\<name of the plug-in>\<form id>_<body part>.dds<br><br>The form id is always 8 digits and the first 2 hex numbers (which usually contain the plug-in number) must contain zeros. The body part is a single digit number and is one of the following:<br><br>0 - The character's head.<br>1 - Male ears.<br>2 - Female ears.<br><br>The dds file can be in any format as the alpha channel seems to be ignored but the game uses the DXT5 format.<br><br>You can use the construction set to generate these textures by clicking on Character &gt; Export Face NPC Textures, which you can then edit. The settings file for the plug-in will allow you to alter the behavior of this command.<br><br>The cached textures the game uses are in a special signed number format and are an offset from that character's race base texture i.e. headhuman.dds. To help you create these textures I've written a couple of utilites (in the utilites folder) :<br><br>NPCTexToFace - This converts an existing cached faced texture into a normal face texture. This will allow you to extract an existing NPC's texture from the Oblivion-Textures-Compressed.bsa file and alter it.<br><br>FaceToNPCTex - This converts your newly created face texture into the format that the oblivion engine can understand.<br><br>Both the utilities take the parameters:<br><br>NPCTexToFace/FaceToNPCTex <input file> <race base texture file> <output bmp file><br><br>At the moment the utility can only output a BMP file but the input textures can be a jpeg, bmp, tiff, gif or png file.<br><br>By the way the utilities were just thrown together and contain no error checking. If you put in the wrong information then they will most definately crash.<br><br><br>Are there any usage limitations?<br><br>Nope. As with all my stuff you can do with it what you please as long as you mention my name in your readme. My user name is scanti and you can find me on the elderscrolls forum or on my own website http://www.oblation.eu.<br><br><br>History<br><br>Current Version (0.2b)<br><br>Added support for the Construction Set (version 1.2 only).<br>Added a settings file so you can customize what the plug-in does.<br><br>0.1b<br><br>First release.<br> </output></race></body></form></name>