Rev/HUD

From Serious Sam Wiki
Jump to: navigation, search

Introduction

Since a lot of people want to make their own HUDs, or have special HUD styles of their own, there's a themable HUD system in Serious Sam Revolution. This page will describe how this works. To simply test a HUD, you want to take a look at the following console commands:

/hud_strTheme = "ThemeName"
/ReloadHUD()

You can use ReloadHUD to reload the HUD theme completely mid-game. This way you can modify the textures and script and meanwhile see your changes ingame without restarting the game.

Starting out

The general idea of themable HUDs is that there's 3 parts to it:

  1. Textures
  2. Fonts
  3. Script
  4. Description file

All HUD theme textures should go in TexturesMP/[ThemeName]/Interface/. Here's a list of files that will be looked for upon theme loading:

Interface/HSuper.tex             Health icon
Interface/Oxygen-2.tex           Oxygen icon (when you're in water)
Interface/IBead.tex              Multiplayer score icon (in the top left)
Interface/ISkull.tex             Multiplayer mana or deaths icon (in the top left)
Interface/IScore.tex             Campaign score icon (in the top left)
Interface/IMessage.tex           Message icon (netricsa message, in the top right)

Interface/ArSmall.tex            Small armor icon (used when armor is less than or equal to 50)
Interface/ArMedium.tex           Medium armor icon (used when armor is less than or equal to 100)
Interface/ArStrong.tex           Strong armor icon (used when armor is more than 100)

Interface/Paused.tex             Paused icon during demo playback
Interface/Fast.tex               Fast icon during demo playback
Interface/Slow.tex               Slow icon during demo playback

Interface/AmShells.tex           Shells ammo icon
Interface/AmBullets.tex          Bullets ammo icon
Interface/AmRockets.tex          Rockets ammo icon
Interface/AmGrenades.tex         Grenades ammo icon
Interface/AmFuelReservoir.tex    Fuel ammo icon (flamer)
Interface/AmElectricity.tex      Electricity ammo icon (laser, ghostbuster)
Interface/AmCannonBall.tex       Cannonballs ammo icon
Interface/AmSniperBullets.tex    Sniper bullets ammo icon
Interface/AmSeriousBomb.tex      Serious bomb ammo icon

Interface/WKnife.tex             Knife weapon icon
Interface/WColt.tex              Colt weapon icon
Interface/WSingleShotgun.tex     Single shotgun weapon icon
Interface/WDoubleShotgun.tex     Double shotgun weapon icon
Interface/WTommygun.tex          Tommygun weapon icon
Interface/WMinigun.tex           Minigun weapon icon
Interface/WRocketLauncher.tex    Rocket launcher weapon icon
Interface/WGrenadeLauncher.tex   Grenade launcher weapon icon
Interface/WLaser.tex             Laser weapon icon
Interface/WCannon.tex            Cannon weapon icon
Interface/WGhostBuster.tex       Ghostbuster weapon icon
Interface/WChainsaw.tex          Chainsaw weapon icon
Interface/WSniper.tex            Sniper weapon icon
Interface/WFlamer.tex            Flamer weapon icon

Interface/PInvisibility.tex      Invisibility powerup icon
Interface/PInvulnerability.tex   Invulnerability powerup icon
Interface/PSeriousDamage.tex     Serious damage powerup icon
Interface/PSeriousSpeed.tex      Serious speed powerup icon
Not all files have to be present for the theme to load, if a file can't be found it will simply use the original texture.

You can also make custom fonts, which will be located in Fonts/[ThemeName]/. Fonts can be easily generated with Angelo's Font Generator Tool. The fonts you can modify are:

Display3-narrow.fnt              General font used for playernames and other text that contains more than just numbers

 !"$#%&'()*+,-./01234
56789:;<=>?@ABCDEFGHI
JKLMNOPQRSTUVWXYZ[\]^
_`abcdefghijklmnopqrs
tuvwxyz{|}~ÄÀÁÂÇÆÈÐËÈ
ÉÊÍÌÎÏÖÒÓÔŠÜÙÚÛÑŽßäáà
âèæçðëéèêöóòôšüúùïíìî
ûñž¡¿

Numbers3.fnt                     Numbers used for health/armor/score and other numbers

01234
56789
+-*=/
().,

An extended font map could be:

 !"#$%&'()*+,-./0123456789
:;<=>?@ABCDEFGHIJKLMNOPQRS
TUVWXYZ[\]^_`abcdefghijklm
nopqrstuvwxyz{|}~¡¢£¤¥¦§¨©
ª«¬®°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅ
ÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß
àáâãäåæçèéêëìíîïðñòóôõö÷øù
úûüýþÿCciŒœŠšŸŽžƒ?ˆ?°˜–—‘’
‚“”„†‡•…‰‹›°€™

The script

The script is a simple ini file that gets called upon theme initialization (and when ReloadHUD gets called). It is located in Scripts/Themes/[ThemeName].ini.

A typical script could look like this: (the following is taken from the "modern" HUD theme which gets shipped with the game)

// Modern theme, by Sedinus
hud_fThemeIconScale = 0.25;

Here, we simply change the icon scale, since the theme's textures are 4 times as large as the original textures. (The original textures are 32x32)

The following is a list of variables you can use in your script:

hud_fThemeIconScale

hud_strThemeUnderlay
hud_fThemeUnderlayX
hud_fThemeUnderlayY
hud_fThemeUnderlayWidth
hud_fThemeUnderlayHeight

hud_strThemeOverlay
hud_fThemeOverlayX
hud_fThemeOverlayY
hud_fThemeOverlayWidth
hud_fThemeOverlayHeight

hud_bThemeShowBackdrops

hud_bThemeShowHealth
hud_bThemeShowHealthIcon

hud_bThemeShowArmor
hud_bThemeShowArmorIcon

hud_bThemeShowWeaponIcon
hud_bThemeShowAmmo
hud_bThemeShowAmmoIcon

hud_bThemeShowKills
hud_bThemeShowKillsIcon

hud_bThemeShowDeaths
hud_bThemeShowDeathsIcon

hud_bThemeShowScoreLeft

hud_bThemeShowAmmoBar

hud_bThemePlayersInvertAlign

hud_fThemeHealthOffsetX
hud_fThemeHealthOffsetY
hud_fThemeHealthIconOffsetX
hud_fThemeHealthIconOffsetY

hud_fThemeArmorOffsetX
hud_fThemeArmorOffsetY
hud_fThemeArmorIconOffsetX
hud_fThemeArmorIconOffsetY

hud_fThemeKillsOffsetX
hud_fThemeKillsOffsetY
hud_fThemeKillsIconOffsetX
hud_fThemeKillsIconOffsetY

hud_fThemeDeathsOffsetX
hud_fThemeDeathsOffsetY
hud_fThemeDeathsIconOffsetX
hud_fThemeDeathsIconOffsetY

hud_fThemeScoreLeftOffsetX
hud_fThemeScoreLeftOffsetY

hud_fThemeAmmoBarOffsetX
hud_fThemeAmmoBarOffsetY

hud_fThemePlayersOffsetX
hud_fThemePlayersOffsetY

hud_ulThemeHUDColor
hud_ulThemeHUDTextColor
hud_ulThemeBorderColor
hud_ulThemeColorMax
hud_ulThemeColorTop
Note that these are also modifiable via console!

Conclusion

When you're done with your theme, you can make a .des file next to the .ini file for the script (in Scripts/Themes) to make it appear in the HUD themes menu. The contents of the file should look something like this: (starting with the name, ending with the description which it will display when you hover your mouse over the menu item)

Kitty
Do you like kitties? Then this is the theme for you.

It can also contain formatting codes:

^cff0000^f5SUPER MEGA ULTRA DESTRUCTOR HUD EXTREME PRO
^cff0000^f5ONLY USE IF YOU ARE EXTREME PRO!!!111