Dynamic HUD Elements

This pack is released to be "a modder's resource", but there is also a ready-to-go example which will give you a "sweet-heart" shaped health...

Download

Uploading...
Do not refresh or leave this page!

File Description

This pack is released to be "a modder's resource", but there is also a ready-to-go example which will give you a "sweet-heart" shaped health icon on your screen, which will change in colour and opacity as player's health decreases. That example also resembles my original intention: to replace the default HUD elements (health, armor, stamina, light, noise) with icons that would rather change colour or opacity instead of a horizontal or vertical straight "bar". By the time I achieved what I wanted, I noticed that I like my own custom "bars", I've previously made for myself, more, so I didn't want to do anything further than the "sweet-heart" example. Still, I thought somebody might find the functionality useful and I decided to release it anyway.

Read More

Screenshots
Readme
----------------------------------------------------
Dynamic Hud Elements
for S.T.A.L.K.E.R - Shadow of Chernobyl
by denizsi (Cihan Beşiktepe)
----------------------------------------------------

This pack is released to be "a modder's resource", but there is also a ready-to-go example which will give you a "sweet-heart" shaped health icon on your screen, which will change in colour and opacity as player's health decreases. That example also resembles my original intention: to replace the default HUD elements (health, armor, stamina, light, noise) with icons that would rather change colour or opacity instead of a horizontal or vertical straight "bar". By the time I achieved what I wanted, I noticed that I like my own custom "bars", I've previously made for myself, more, so I didn't want to do anything further than the "sweet-heart" example. Still, I thought somebody might find the functionality useful and I decided to release it anyway.

The files in this pack are:

/scripts/denizsi.script
/scripts/bind_stalker.script
/textures/ui/ui_hud_heart.dds
/config/ui/ui_custom_msg.xml

"bind_stalker.script" only contains one custom function call (and one "commented out" function call). There is nothing else vital to this "mod" in this file.

"denizsi.script" is where all the relevant new functions lie. There are five functions. Three of these are slight variations of each other, and involve scaling any given game value -or any value of your own- that have highest and lowest limits, to the default alpha/colour range (which is 0 to 255) to be used with functions that involve colours. Ie. To find what any value between x and x+y would correspond to between 0 and 255.

"ui_custom_msg.xml" contains one new entry by the name "ui_hud_dynamic_heart"

"ui_hud_heart.dds" is a 128x128 image only containing a black &white "sweet-heart", hollow in the middle middle

----------------------------------------------------
  INSTALLATION
----------------------------------------------------

You can try out the preset example by putting the files to their respective folders. Ie.

   ui_hud_heart.dds to /gamedata/textures/ui/
     denizsi.script to /gamedata/scripts
bind_stalker.script to /gamedata/scripts
  ui_custom_msg.xml to /gamedata/config/ui

----------------------------------------------------
  THANKS
----------------------------------------------------

I must specifically thank Atrocious and rspeed/russo from FileFront/OL forums who helped me tremendously in showing me my mistakes and pointing me in the right direction, even to the point of giving the complete answer a few times; It would probably take me a dishearteningly longer time to figure all of this out myself (if at all before I'd quit in anguish);

and also to Cpt. Borovich, NatVac for their contributions with their replies on GSC forum.

All the relevant forum threads can be reached through these links:

http://www.gsc-game.com/index.php?t=community&s=forums&s_game_type=xr&sec_id=16
http://forums.filefront.com/s-t-l-k-e-r-soc-modding-editing/364674-changing-hud-bars-icons-dynamic-transparency-colour.html
http://board.oblivion-lost.de/showthread.php?t=12929

----------------------------------------------------
  QUICK REFERENCE:
For a complete, and intricately detailed "dummy guide", read "Details Dynamic_HUD_Elements.txt"
----------------------------------------------------

(1)	function return_argb(obj)

- Returns a value that's obj's equivalent on 0-255 scale.
- "obj" can have any value that's between 1.0 and 0 (eg. db.actor.health, self.object.radiation etc.) unless, of course, you circumvent that restriction by first scaling your own variable to the corresponding value between 1.0 - 0.0

(2)	function return_argb_cs(c1,c0,obj)

- Returns a value that's obj's equivalent on c1-c0 "sub-scale"
- "obj" can have any value that's between 1.0 and 0 (eg. db.actor.health, self.object.radiation etc.)

(3)	function return_argb_csx(c1,c0,hp1,hp0,obj)

- Returns a value that's obj's equivalent on c1-c0 sub-scale where obj itself is on a HP1-HP0 scale.
- hp1, hp0 can have any value, integer or decimal, and so can obj provided that it's between the two.

(4)	function dynamic_argb_cs(obj,img_xml_ref,ac1,ac0,ahp1,ahp0,rc1,rc0,rhp1,rhp0,gc1,gc0,ghp1,ghp0,bc1,bc0,bhp1,bhp0)

- Is a "standalone" function which calls the third function above from within for each alpha/colour channel.
- "img_xml_ref" variable references a custom entry name in ui_custom_msg.xml for the image to be displayed on HUD, which is "ui_hud_dynamic_heart" in this case.
- hp1, hp0 can have any value, integer or decimal, and so can obj provided that it's between the two.
- Other variables are for alpha, red, green and blue channels, with individual scale or sub-scale limits for each colour and variable scale.

(5)	function dynamic_argb(obj,img_xml_ref)
- A simplified version of the fourth function above. Only needs input for obj variable and the custom image reference in ui_custom_msg.xml
- Desired alpha/colours must be set manually in denizsi.script. I imagine this to be less resource-taxing.

----------------------------------------------------
I can be reached via e-mail and msn both at:
denizsi@hotmail.com
----------------------------------------------------

Read More

Comments on this File

There are no comments yet. Be the first!

denizsi


50 XP


Registered 29th June 2008

1 Files Uploaded

Share This File
Embed File