Simple HUD mod
Sewlek
The programmer previously known as Schimmel Join Date: 2003-05-13 Member: 16247Members, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Developer
in Modding
<div class="IPBDescription">example mod</div>hey everyone,
i sat down today for an hour to finally make a mod again, this time it's just UI and the main purpose was to give a small example for a mod. please don't request any additional features, i will most likely not update it, but feel free to ask questions here or copy the code.
the texture used is very basic, i know it's not looking very beautiful but it serves the purpose.
screenshots:
<img src="http://img853.imageshack.us/img853/9319/2012082500002.jpg" border="0" class="linked-image" />
<img src="http://img440.imageshack.us/img440/1410/2012082500001.jpg" border="0" class="linked-image" />
[attachment=36126:simplehud.zip]
i sat down today for an hour to finally make a mod again, this time it's just UI and the main purpose was to give a small example for a mod. please don't request any additional features, i will most likely not update it, but feel free to ask questions here or copy the code.
the texture used is very basic, i know it's not looking very beautiful but it serves the purpose.
screenshots:
<img src="http://img853.imageshack.us/img853/9319/2012082500002.jpg" border="0" class="linked-image" />
<img src="http://img440.imageshack.us/img440/1410/2012082500001.jpg" border="0" class="linked-image" />
[attachment=36126:simplehud.zip]
Comments
find the variable you need to adjust! :)
Bad things happen when I attempt basic stuff like this.
<center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/UStDijM4Bk8"></param><embed src="http://www.youtube.com/v/UStDijM4Bk8" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center>
<center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/cNQeZGJk9kU"></param><embed src="http://www.youtube.com/v/cNQeZGJk9kU" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center>
Overall, I do like it, but there are a few things I'd like to see changed.
- The marine bars need more contrast as it was difficult to see them against the map colors
- It'd be nice if the marine w/a levels and alien upgrades were still available (I think putting them on the right side of the screen when you pull up the minimap would be the best)
My thought exactly :D
Think it was ArcHUD.
I remodeled the bar element and simplified the health bar a bit more. Also, I added a medium sized minimap, the weapon/armor level indicicator and window size based scaling. The result looks like this:
<a href="http://imageshack.us/photo/my-images/835/je2mod2.jpg/" target="_blank"><img src="http://img835.imageshack.us/img835/3373/je2mod2.jpg" border="0" class="linked-image" /></a>
<a href="http://imageshack.us/photo/my-images/99/je2mod.jpg/" target="_blank"><img src="http://img99.imageshack.us/img99/8103/je2mod.jpg" border="0" class="linked-image" /></a>
<a href="http://host07.ath.cx/download/NS2/build217-je2mod-0.1.zip" target="_blank">build217-je2mod-0.1.zip</a>
simplehud and je2mod-0.1 do not play well with the exo:
<a href="http://imageshack.us/photo/my-images/337/je2mod3.jpg/" target="_blank"><img src="http://img337.imageshack.us/img337/9349/je2mod3.jpg" border="0" class="linked-image" /></a>
That bug is fixed in je2mod-0.3: <a href="http://host07.ath.cx/download/NS2/build217-je2mod-0.3.zip" target="_blank">build217-je2mod-0.3.zip</a>
I tried to add some code to display the "heatAmount" of the minigun in the ability bar. I came up with code like this:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> if activeWeapon:isa("ExoWeaponHolder") then
local weapons = { Shared.GetEntity(activeWeapon.leftWeaponId), Shared.GetEntity(activeWeapon.rightWeaponId) }
local heat, maxHeat = 0, 0
for _, weapon in ipairs(weapons) do
if weapon and weapon:isa("Minigun") then
heat = heat + weapon.heatAmount
maxHeat = maxHeat + 1
end
end
return (maxHeat - heat) / maxHeat
end<!--c2--></div><!--ec2-->
It works, but... I am not sure if this a "good" way of doing this.