Helmet FOV


Downloads: TESSource

Discussion: ESF Thread

 

Contents


•  Description

•  Installation

•  Compatibility

•  Technical Details

•  Instructions for Modders and Helmet Reference

•  Version History

•  Permission

•  Credits

 

Description


Equipping a helmet while having Helmet FOV activated will mask parts of your screen in first person view to simulate decreased field of view (FOV) due to the helmet's shape.

Currently all helmets contained in the original game, the Knights of the Nine DLC, the Shivering Isles expansion as well as a few user-created custom ones will be affected by this (see Helmet Reference for a more complete list).

NEW:

•  OBSE is now required (not optional anymore).

•  Fixed being able to see the edges of the FOV plane when using widescreen resolutions.

•  New streamlined file structure for easier integration of new FOV textures and animations.

 

Installation


Unzip the included files to your Oblivion Data directory.

Activate the .esp file in the Oblivion Launcher's Data Files menu or via using your favorite mod manager (e.g. OBMM).
You will need to start the game using one of the several OBSE launchers.

 

Note: If you have earlier versions (pre-v1.10) installed it is recommended to deactivate and delete any files associated with it since almost all of them have been renamed/reorganized (these files don't do any harm though, this is just a reminder to avoid cluttering your directories with useless dupes).

 

Compatibility


No known compatibility issues as far as the .esp part is concerned.

However, installing a mod that overwrites the  ...\characters\_1stperson\skeleton.nif  will break this modification - a merge of both skeleton files should be considered in that case.

 

Technical Details


The Helmet FOV effect is basically a simple rectangular plane floating right in front of your eyes in first person view.

More specifically it is a single plane with a texture flip controller which passively stores all textures. This plane is indirectly attached to the Camera01 bone inside the  _1stperson\skeleton.nif  file – that will make it visible only in 1st person view. Furthermore there's another Node inbetween the FOV plane and the Camera01 bone that is defaulted to being invisible and can be toggled on/off depending on your helmet state (e.g. to remove the FOV effect in case you're not wearing any headgear).
Animation (.kf) files have then been created to dynamically switch between textures of the FOV plane (applying NiFlipControllers). To actually trigger these .kf files the mod utilizes the game's Idle Animations feature, checking for the value of a certain global variable.
That variable is set in a global script which runs in the background checking for any changes done to the helmet slot (OBSE function GetEquippedObject 1) or whether a savegame has been loaded to refresh the animation state (OBSE function GetGameLoaded). Once one of these conditions is met the script will iterate through a list of strings to determine what kind of helmet has been equipped by means of comparing these strings with the respective model filepath of whatever is currently present in the helmet slot (OBSE function CompareMaleBipedPath).

 

Instructions for Modders and Helmet Reference


Since v1.10 all animation and texture files have been renamed to match the order in which the textures are listed inside the NiFlipController of the 1stperson skeleton.nif.
The following template was used:

•  0 No Helm

•  Vanilla Light Armor

•  1 Fur (Male)

•  2 Fur (Female)

•  3 Leather (Thief)

•  4 Chainmail (Male)

•  5 Chainmail (Female)

•  6 Mithril

•  7 Elven

•  8 Glass

•  9 Townguard

•  Vanilla Heavy Armor

•  10 Iron

•  11 Steel

•  12 Blades

•  13 Dwarven

•  14 Orcish

•  15 Ebony (Male)

•  16 Ebony (Female)

•  17 Daedric

•  18 Legion

•  Vanilla Unique

•  19 Grey Fox

•  20 Bloodworm Helm

•  21 Helm of Oreyn Bearclaw

•  22 Masque of Clavicus Vile

•  23 Pit Helmet

•  Vanilla Hoods

•  24 Generic Hood

•  25 Dark Brotherhood Hood

•  Knights of the Nine

•  26 Helmet of the Crusader

•  Shivering Isles

•  27 Amber

•  28 Madness

•  29 Dark Seducer

•  30 Golden Saint

•  31 Order Hood

•  32 Zealot Hood

•  33 Thadon's Crown

•  Custom

•  34 Mythic Dawn Hood

•  35 Lich Helmet

•  36 Pegasus Helmet

If a modder wishes to add support for a helmet to use an existing FOV effect the following things must be done:

•  Modify the quest script of the Helmet FOV .esp file

- Open the .esp file with the TES Construction Set and locate the HelmetFOVQuestScript.

- Find the elseif branch that corresponds to the FOV effect you wish to use.

- Add another compare string condition similar to the ones already provided (e.g. if your helmet resides in  ...\armor\myarmory\  choosing "\myarmory\" would make sense).


If a modder wishes to add a new FOV effect to the list the following things must be done:

•  Create a texture similar to those already provided

- E.g. a square texture with certain parts made [semi-]transparent via alpha channel editing.

•  Modify the  ...\characters\_1stperson\skeleton.nif 

- Open the file with NifSkope and locate the FOV bone (attached to the Camera01 bone near the head.

- Attached to that you'll find a mesh labeled FOV:0 which in turn contains a NiTexturingProperty with a NiFlipController.

- Expand the NiFlipController entry in the Block List, right-click the last NiSourceTexture entry and select Block -> Insert -> NiSourceTexture.

- Attach this new source texture block to the flip controller by selecting the controller, incrementing its Num Sources value (in the Block Details List; press F3 if you're missing one) by one, updating the Sources array below it (by pressing the green arrow icon or by right-click and Array -> Update) and typing in the block number of your new source texture block into the new empty entry at the very end of the array.

•  Create an animation file similar to those already provided

- Open an existing fov_*.kf file with NifSkope, look for the NiFloatInterpolator block and change its Float Value to the number of the absolute position of your new source texture block inside the flip controller (if your texture is the 38th one in the array the float value will need to be 37 since the controller starts counting at 0).

- Save this modified file to an appropriate name (e.g. following existing naming conventions for the sake of keeping everything organized).

•  Modify the quest script of the Helmet FOV .esp file

- Open the .esp file with the TES Construction Set and locate the HelmetFOVQuestScript.

- Edit the script to contain a new elseif branch using appropriate compare strings (e.g. if your helmet resides in  ...\armor\myarmory\  choosing "\myarmory\" would make sense) and setting the global variable's value to the aforementioned source array position.

- Finally open the Idle Animation Manager in the Construction Set, expand the HelmetFOVAnims entry, create a new Sibling of the last entry, name that appropriately, set the conditions similar to existing entries (using the source array position value) and specify your new .kf file for it.


Note #1: As a general rule of thumb making your helmet's folder name as unique as possible is a good idea to make sure your helmet gets picked when it should; however, in case this piece of headgear is merely a retexture of an existing helmet it would be recommended to put the helmet.nif into a subfolder of the respective base item to save space in the script as that is a fixed limit in the Oblivion script engine. Have a look at the entry for the Legion Helmet as that contains a lot of aliases for various retextures, something that should be avoided if possible.

Note #2: If your helmet has a separate female version residing in a folder (or a subfolder thereof) that serves as string compare criterion, you will need an additional GetIsSex check (take a look at the Fur or Chainmail entries for comparision; since the male and female version are right next to each other in regards to flip controller source array positions the female version's global variable setting formula contains an additional increment: ## + gender, where gender is 1 if female).

 

Version History


1.00 Initial Release [1/29/2007]

•  Includes FOVs for all vanilla helmets

1.01 HotFix [1/29/2007]

•  Deleted a lot of redundant script checks, no more waiting after switching helmets required

1.02 Update [1/30/2007]

•  Added KotN Add-On .esp file

•  Added OBSE Add-On .esp file

•  Tweaked a few textures

1.03 Update [2/13/2007]

•  Fixed scripts to avoid FOV anims overriding vanilla Idle Animations

1.10 Update [7/27/2008]

•  Almost complete rewrite (using OBSE functions) and reorganization of files

•  Native support of KotN, SI as well as some custom helmets

•  Fixed problems with widescreen resolutions

1.11 Hotfix [8/2/2008]

•  Fixed script to properly apply anims when changing helmets in 3rd person view

 

Permission


The textures used inside this mod might not suit everyone's tastes, so feel free to replace them with your own versions - and don't forget to share these with the community :)

Furthermore the technique behind Helmet FOV is not limited to using simple planes; it is, in fact, possible to use a real 3D model instead.
This mod simply aims at providing the community with a base to start off - feel free to discuss in the aforementioned ESF thread.

 

Credits


Credit goes to Haydox, Plissken, Jeggy of the ES Forums for the original mod idea,

to Dejaside, Quarn and TheTalkieToaster of the ES Forums for helping with the scripts,
to Dev_akm, Wrye, Timeslip of the ES Forums for providing tools to create interdependant mod files,
and of course to Bethesda Softworks for creating TESIV: Oblivion ;)

 

XMarksTheSpot