HI guys, after looking at a few scripts on this forum I found that lee's and CR4CK3T script helped the most. Lee's script was from a twitch he made and posted on you-tube.
I have just updated the script to work with sprites like in the images below. I have enlarged all the graphics for this demo.
I started with
CR4CK3T script which is here:-
[GER] [ENG] Modern Hud
Then found Lee's GG twitch posted on you-tube
Broadcast #36 : Player And Entity Health Types
Lee's files were add to the core files in the script bank located here:-
\Program Files (x86)\Steam\SteamApps\common\Game Guru\Files\scriptbank\stories\HealthTypes\
Any newbie like me should take a look, as they are easy to update and make it work for you.
As you can see in the four images attached the shield is set at 200, health at 100 and the bars go down by 12-25% each time.
In the second image you will see the shield is at 60 shield points left and the bar image looks less. This is correct as the shield is set to 200 points not 100 points like the health bar, so the shield image bar is updating correctly.
I have found that they don't really need to decrease by less then 12.5% for health and 25% for shields based on 100 for health and 200 for shields. This is due to the amount of damage taken and that the shields are set double the amount of the health based on Lee's script for this demo. You could add more images if you want to show smaller amounts of damage like in CR4CK3T demo.
This works for me in a medieval game style I'm making.
Keep in mind that at this point in time you can only set the sprites (000.png, 001.png - 017.png etc.) to show one at a time on screen when loading in to an array from your image directory (but you can load images individually as many as you want).
A workaround for this, is to load other image(s) like I have for the 100% health bar in to the holding area on screen for that location of the health bar. This is just until the shields reach 0%, then I move the 100% health bar off screen. You will need this once you loss a life to reappear showing your shields and health again (do not delete the sprite or it will not appear again). Easy to do with an [ if, and, else] statement.
Example:-
if myPlayerHealth >= 100 and myPlayerShield >= 1 then
SetSpritePosition(health_sprite,35.85,88) -- This is to display the health bar in the image holding area. Just like in the images below.
else
SetSpritePosition(health_sprite,100,100) -- This will move the image of screen until the script is re-run after death (You Die) and start this statement again.
end
-------------------------------------------------------------
Any question please post here or PM me.
gd Ed.
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2, Air cooled
Laptop - M17xR3