Fallout 3
0 of 0

File information

Last updated

Original upload

Created by

Imp of the Perverse

Uploaded by

Imp of the Perverse

Virus scan

Safe to use

About this mod

This is a modder\'s resource that can be used as a guideline for setting up a counter that displays on the HUD. Un-customized, is shows a cap counter and a beer counter.

Permissions and credits
One Fierce Beer Counter r2
(HUD Counter Template.esp)

NOTE: If you downloaded release 1, and have not yet released your mod, you should download release 2 and update your code to reflect the new changes. It will show/hide itself better when in menus, and the position adjustment code will conflict less with some users key mapping. You'll also be able to selectively show/hide the HUD counter based on conditionals within your fallout script.



This file is a modder's resource (unless you feel the need to be constantly reminded of the size of your caps and beer stashes) that can be used to add counters to the HUD. Unaltered, this file adds two, one for counting caps, and another for counting beers.

By default, the two counters appear at the left hand side of the screen, mid way up, but their position can be changed by holding down the right control key and using the arrow keys.

Each counter has its own warning levels. If the quantity dips below a certain count, the counter will switch from solid green (or whatever your chosen hud color is) to solid red. If it dips below a second, lower count, it will begin to blink on and off (very attention grabbing).

I've used a pretty generic naming convention for everything, and added comments that should help you figure out both the xml and fallout scripting changes that you would need to make to add a custom HUD counter to your mod.

These counters are compatible with DarN's UI, but DUI is not required.


Changes from release 1

The UI float XXXXGMShowHUD has been replaced by XXXXShowHUD and XXXXForceHUD. XXXXShowHUD can be used to determine whether the entire HUD is visible, so if, for example, you only want it visible when a certain helmet is worn, or when you're in combat mode, etc., use a conditional statement in your fallout script that sets that UI float to 1, and 0 otherwise. XXXXForceHUD can be used to force the HUD visible at times when it would otherwise be invisible, such as when the Pipboy is accessed, or when you are in a menu. It is now used when adjusting the position of the display. The hiding of the HUD when in menus is now accomplished automatically within the XML code by copying the visibility of stock HUD items.

Some changes have been made to the position adjustment block of the fallout script to prevent players that use the arrow keys for directional controls from running around in circles while making adjustments.

The vanilla copy of the hud_main_menu.xml file has been moved from data\main to data\prefabs\XXXX\main to prevent accidental overwrites of existing copies of hud_main_menu.xml. You should instruct your users to copy the \main folder into the \menus folder only if hud_main_menu.xml is not already present in their data directory. If it is present, they should just enter the line by hand, to prevent messing up whatever mod put it there in the first place.


Basic Installation

First install the latest version of FOSE

1) Paste the contents of the compressed data directory into your data directory, as with any other mod.

2) Navigate to "Fallout 3\Data\menus\main", and check to see if hud_main_menu.xml is there.

3a) If it is not, or if that folder does not exist, move the \main folder located in data\menus\prefabs\XXXX into the data\menus folder.

3b) If the file is there, open it up using a text editor. Scroll to the bottom, and just above the last line, add:

The last two lines will then look like:

4) Check the HUD Counter Template.esp in your load order manager, and you're done. Order is unimportant.

Once installed, check to make sure any further mods you install do not overwrite hud_main_menu.xml. If they do, re-add the "include" line once the file has been overwritten. If you're not sure, check (it should be pretty apparent, the hud counters will disappear the next time you play the game).



1) Delete the "XXXX" folder from "menus\prefabs".
2) Open hud_main_menu.xml in a text editor and delete the second to last line:

3) Delete the HUD Counter Template.esp file.



Open the XXXX_HUD.xml file found in "menus\prefabs\XXXX".

If you are unfamiliar with XML, a pretty good tutorial can be found here:


though it's probably not needed. XML is more an agreed upon way of formatting data than a programming language. It be used to store anything from bibliographical data to sports statistics. Fallout uses it to store menu formatting data, and some other games, like Dragon Ages, use it to store nearly all of the information in the game.

The tricky part about XML is that the way it is interpreted changes from application to application, and without seeing the code that reads it, trying to figure it out can be like trying to learn a language while hearing only one side of the conversation. Luckily, DarN and a few others have created enough custom xml files that the ground is laid to figure out much of what Bethesda was up to.

The folks at Bethesda (or possibly the FOSE crew, not sure actually) have incorporated a few non-standard tricks into their xml files. One of them is conditional operations. Things like greater than and less than statements. They've also worked in some basic arithmetic operations - adding, multiplying, and so forth within the xml data itself. You won't need to learn their syntax for it to get your customizations to work, I've handled that for you, but if you're interested, take a look at the file. Things like mean multiply,
for divide, for greater than, etc.

The final thing, and one you'll need to familiarize yourself with, is I/O (input/output). Data elements with the source (src) set to io() are points where your fallout script can communicate strings or numbers to the xml file. FOSE is required for that part, but its what lets you manipulate what shows up on the screen via your script. The I/O elements will use the following syntax:

where "copy" (which just puts a copy of the value in that location) can be replaced by other operators, like "add" or "and". The src="io()" designates it as and IO object, and the trait="_yourIOVariableName" determines what tag will be used in your fallout script to refer to that particular IO object.

To set the above variable in your script, use the SetUIFloat or SetUIString FOSE command, like so:

SetUIFloat "HUDMainMenu\_yourIOVariableName" 10

This would set that particular IO item to 10. HUDMainMenu is the file path to the variable's location - since your XXXX_HUD.xml file is included in hud_main_menu.xml with that added line, its code is seen as part of that file.

Look through the xml for comments, either above or to the right of lines of code. These will instruct you in what you will need to change. Anywhere you see "XXXX" you should, in general, replace it with something unique to your mod, like an abbreviation of its name or something. Your text editor's find and replace feature works great. Other values will need to be changed depending on the number of counters you intend to display, and the lables you want for those counters.

This file first sets up a rect (rectangle) object, just big enough to contain two hud counters, and positioned mid way up the left side of the screen. It's x and y position are also dependent upon io() items that can be set in your fallout script with the commmand "setuifloat".

Nested within that first rect are two more, one for each counter, stacked vertically on top of one another. Each of those nested rectangles contains two text boxes, arranged side by side. The left hand text box contains the counter lable, and the right hand text box contains the count. The count is another io() object, but the lable text is set in the .xml file. If you feel like getting tricky, you can turn the lable text into an io() object as well, but there's no need to and leaving it as it is will simplify your fallout script (actually it just occurred to me while writing this.)

There are also io() objects that will let you determine whether the counters are visible, and what color they are displayed in (you're limited to 2 colors at the moment, hud default and hud alternate).

Once you've familiarized yourself with the xml, and made the required changes if you think you can see what needs to be done, open up the HUD Counter Template.esp file in the GECK (with FOSE editing enabled). Filter for XXXX in the object window. There is one quest script that manages the HUD counters, XXXXHUDMainQuestScript, and one quest, XXXXHUDMain. Again, these should be renamed to something unique to your mod, and probably incorporated into its .esp, unless you're trying to keep FOSE separate.

If you're familiar with fallout scripting, the script should be fairly self explanatory. The gamemode block first sets both counters to "visible" using the SetUIFloat command. The next two blocks of code each set the value of a counter, its color, and whether it's visible. The third block of code adjusts the position of both counters. The menumode line of code hides the HUD counter whenever you enter a menu (including conversations, fast travel, and the Pipboy).

Blocks of this script can be reworked to control the overall visibility of either hud element. You could make them visible only when the player has a certain helmet equipped, or is sneaking, or in combat. You can change the values that are displayed. You can change or remove the warning appearances.

Obviously, if everyone starts adding hud elements they're going to start overlapping. This file's positioning feature is a partial solution to that, but you should probably make the positioning modifier key (right control by default) something that can be reassigned by the player, or every mod that uses it is going to have their HUD elements in lockstep. Another method would be to make a configuration menu for your mod, with one menu that says:


Use the arrow keys to position the HUD counters.

You can set the hud items visible while in that menumode, and only check for the arrow key presses then.

I'm sure this leaves lots of questions, but should give you a pretty good start. Feel free to comment or message me.