Hud Reference (FAQ)

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Hud Reference (FAQ)

Post by RepSharpshooter »

Some people have had questions/trouble with huds, so I wrote a reference of the hud file. With it you can modify and add components to the hud for your specific mod map.

What can you do with this?

Well one example is making the Republic Commando hud for your mod map. Basically any hud you want you can make for your mod map.

Download HUD Reference as formatted .rtf file.

Oh, also a question you may have:, How big do I make my hud msh?
The answer is around 4 meters or so. It really doesn't matter, you can always use Scale() to change the size.

Here is an unformmated version for archival's sake, it's very hard to read though:
Hidden/Spoiler:
Hud Configs

Basics that you need to know

Hud files are located in data_MOD\common\hud and 1playerhud.hud is used for the pc version. Also make sure you modify the one in the hud\pc folder. Hud files are munged into the ingame.lvl. Meshes (.msh) used by the hud are found in common\mshs.


Hud elements

Several things make up basic hud elements− groups, models, and text. There are many other specific ones, mainly dealing with health bars, mini maps, and objectives, but we’ll stick to the basics.

Groups
The most general element is the group. The group is a group of hud elements like models and text. It is as follows:

Group("player1weaponinformation") ← name of group
{
PropagateAlpha(1)
Viewport(1)
Position(0.000000, 1.00000, 0.000000, "Viewport") ← position of group
ZOrder(255) ← the order in which it’s drawn on top of others
EventEnable("player1.weaponsEnable") ← when it will appear
EventDisable("player1.weaponsDisable") ← when it will disappear

Here in the group goes models and/or text.

}

Models
A model is a msh file that will be displayed on the screen:

Model3D("player1weapon1backdrop") ← name of model
{
Mesh("hud_weapon_backdrop") ← name of the msh file that is found in common/mshs/
Viewport(1)
Position(0.00000, 0.000000, -2.212803, "Viewport") ← transformations, note that you can leave out any of these if you don’t need them.
Rotation(0.804269, 90.747269, 359.999695)
Scale(0.27000, 0.26000, 0.260000)
ZOrder(8)
EventEnable("player1.spawn")
EventDisable("player1.die")

}

Therefore it is possible to add/modify hud elements by utilizing these components.
A quick list of known hud elements:
hud_weapon_backdrop – the weapon backdrops in the lower left hand corner.

Text
I really don’t use any text, but it looks simple enough. Most parameters look self-explanatory if you ever wished to use text.

Text("player1weapon1overheat")
{
TextBreak("Word")
TextStyle("Shadow")
Text("game.weaponOverheat") ← points to localized word
TextAlignment("Center", "Top")
TextFont("gamefont_medium")
Position(0.500000, 0.750000, 0.000000, "Viewport")
ZOrder(5)
Color(230, 70, 0)
ColorPulseRate(0.750000)
FadeInTime(0.250000)
FadeHoldTime(0.100000)
FadeOutTime(1.000000)
EventEnable("player1.weaponsOverheat")
EventDisable("player1.weaponsDisable")
}


Hud icons

The hud icon for a weapon is a little bit different. The model for player1weapon does not have a specific mesh, it takes upon whatever weapon the unit has, whether a shotgun or a rifle. Therefore, it uses an event mesh. For example: EventMesh("player1.weapon1.mesh") The game then uses a MeshInfo tag to specify what to do with certain meshes (such has how to position a shotgun, or how to position a rifle).

Primary weapons found in:
Group("player1weapon1group")

Secondary weapons found in:
Group("player1weapon2group")

Format is as follows:
MeshInfo("msh_name_goes_here")
{
Position(-0.252832, 0.341293, 0.014590, "Viewport")
Rotation(0.804269, 90.747269, 359.999695)
Scale(0.27000, 0.26000, 0.260000)
}



Munging the hud files.

Huds go in the ingame.lvl. Note that a complete ingame.req is found in BF2_ModTools\data\Common not your data_MOD folder. If you wish to create a mod map that only modifies the hud, do as follows.

Change your ingame.req in ..\data_MOD\ to this:

ucft
{
REQN
{
"model"
"any_new_msh_you_added_to_common_mshs"
"just_list_them_all_here"
}
REQN
{
"config"
"1playerhud"
}
}

Then in your lua change it as follows:

ReadDataFile("ingame.lvl")
ReadDataFile("dc:ingame.lvl") --add this part

After you munge it, make sure to copy the ingame.lvl

from: BF2_ModTools\data_MOD\_LVL_PC
to: Star Wars Battlefront II\GameData\Addon\MOD\data
perhaps at some point I'll bbcode format it.
theITfactor
Chief Warrant Officer
Chief Warrant Officer
Posts: 327
Joined: Wed Jun 28, 2006 12:56 pm
Projects :: The Pwnfest and Games Complex
Games I'm Playing :: SWTOR
xbox live or psn: You and I Know
Location: The Old Republic
Contact:

Re: Hud Reference (FAQ)

Post by theITfactor »

Very useful, I'll have to try this out :wink:
theultimat
Lieutenant General
Lieutenant General
Posts: 679
Joined: Sun Apr 13, 2008 1:39 pm
Location: UK

Re: Hud Reference (FAQ)

Post by theultimat »

Yay! Thanks Rep'!
Post Reply