Custom HUD mods
Posted: Fri May 14, 2004 8:16 am
Haro haro-
here is my custom HUD for painkiller thx to MrMouse for extraction/import in pak files
so it features:
metroid prime-like HUD
3D radar with positioning for closest objective
bunny hop speed meter on the left
souls count meter (before reaching demon morph) on the right
life and armor gauges (in the middle, upper one is life lower is armor each only decreases when below 100)
easy-to-see ammo gauges (the big colored ones) on each side
i will enhance the experience with glowing things but i m quite happy with the result for now
http://tokyo.cool.ne.jp/barfhappy/primehud.zip

So... what did i change ?
i created new textures
in lscript/hud/hud.lua
i added several materials in the Hud definition wich i initialized in Hud:LoadData() .
I modified some older ones too.
I modified the code in Hud:Render(delta) to display correctly my elements
if you want to do modifications, don t forget to allways use:
Cfg.HUDSize*w/1024 as multipliyer for width/horizontal position values
Cfg.HUDSize*h/768 as multipliyer for height/vertical position values
Cfg.HUDSize is the ratio (small, medium, large), w and h must be initialized like that:
local w,h = R3D.ScreenSize()
they give you width and height of the screen
btw 1024*768 is the internal resolution of the game and you use it to place your objects
for example if you want to draw an element of yours in the middle of the screen you ll write:
and so on and so forth, i ll let you explore the code (dirty, i ve not cleaned up the commentaries) 
anyway, to change the weapon icons and ammo display you have to modify each weapon lua function DrawHUD(delta)
they are in templates/weapons
painkiller.lua
shotgun.lua
stakegungl.lua
minigunrl.lua
driverelectro.lua
here is my custom HUD for painkiller thx to MrMouse for extraction/import in pak files
so it features:
metroid prime-like HUD
3D radar with positioning for closest objective
bunny hop speed meter on the left
souls count meter (before reaching demon morph) on the right
life and armor gauges (in the middle, upper one is life lower is armor each only decreases when below 100)
easy-to-see ammo gauges (the big colored ones) on each side
i will enhance the experience with glowing things but i m quite happy with the result for now
http://tokyo.cool.ne.jp/barfhappy/primehud.zip

So... what did i change ?
i created new textures
in lscript/hud/hud.lua
i added several materials in the Hud definition wich i initialized in Hud:LoadData() .
I modified some older ones too.
I modified the code in Hud:Render(delta) to display correctly my elements
if you want to do modifications, don t forget to allways use:
Cfg.HUDSize*w/1024 as multipliyer for width/horizontal position values
Cfg.HUDSize*h/768 as multipliyer for height/vertical position values
Cfg.HUDSize is the ratio (small, medium, large), w and h must be initialized like that:
local w,h = R3D.ScreenSize()
they give you width and height of the screen
btw 1024*768 is the internal resolution of the game and you use it to place your objects
for example if you want to draw an element of yours in the middle of the screen you ll write:
Code: Select all
local w,h = R3D.ScreenSize()
local trans = HUD.GetTransparency()
local mysizex, mysizey = MATERIAL.Size(self._matMyMaterial)
self:QuadTrans(self._matMyMaterial,(512-mysizex/2)*Cfg.HUDSize*w/1024,(384-mysizey/2)*Cfg.HUDSize*h/768,Cfg.HUDSize,false,trans)
anyway, to change the weapon icons and ammo display you have to modify each weapon lua function DrawHUD(delta)
they are in templates/weapons
painkiller.lua
shotgun.lua
stakegungl.lua
minigunrl.lua
driverelectro.lua