Armor,shield and power stat bars

Greetings

I would like to know if anyone knows how to get a armor bar, shield bar, and a power bar on the HUD with all three the bars reacting to damage, and getting them to “regenerate” their original health.

I’ve been trying for quite a while now, I’ve found two tutorials, python version and a non-python version, the non-python version at least worked half as the bars appeared, but they didn’t react to the specified damage properties.

I need three bars, shield, armor (base health) and the power bar (generator). I don’t know what I’m doing wrong, but if anyone can help it would be greatly appreciated.

regards

Hello
if you want to download (20Mb)this sad and boring “game”, you can check the “bars” system:
http://otothecleaner.free.fr/downloads/Dark_Days_V-1.0-beta.zip
If you can’t “get” the system set-up, let me know, I’ll make a basic example for you!
Bye

You might want to post your blend files to show people what you have done.
Have you been using the tutorial on http://www.tutorialsforblender3d.com/Game_Engine/HealthBar/HealthBar_Logic_2.html ?
If not give it a go, its pretty straight forward.

As for the regeneration, once you have your health bar working, you could do the following.

On the object with the property:

Property sensor…>> AND Controller…>> Property actuator
TRUE level…Add
F: (time between regen)…Prop: Property to regen
Interval…Value: amount to regen
Prop: Property to regen
Min: 0 Max: 1 below your maximum value
(to stop from regening too much)

This should ensure that your property is between the correct values and rengen the health/ammo ect.

Ah hah, thanks for the info, I made a n00b mistake, I was clearly unaware that you can’t bind something like the health bar mechanics to a armature, reason I wanted to do this was because the player ship was being controlled by the armature because I had 2 animation for the ship.

The ship tilts left or right whenever going left or right. So I removed the armature and bonded all the health bar functions related to the player, to the player model ship, however now I sacrificed animations for functionality. This is a small problem, because now I can’t get the ship to tilt when going left or right.

Anyhow, is it possible to get the shield bar to work together with the armor bar? Shield bar runs out and haven’t yet regenerated, and it starts to take damage on the armor bar? The generator I’ve sorted out so my main concern now is the shield and armor bars to work. I made an enemy that shoots at the player and the projectile works perfect for damage on the shields.

Thanks for the help guys :slight_smile:

Did you know that if you shift select objects you can link logic between them.

For the armour damage, you can set it up the same way as the health (I’m guessing a collision sensor of some sort?) and also a Property sensor that checks if the armour is 0. That way it should work only when both sensors are activated :RocknRoll:

Did you also know that it’s generally best practice to put logic into a collision box of the Player, not in the mesh or armature? Like Scar says, select the armature and the collision box, and then connect actuators for the animations (that are in the armature object) to the collision box.

Sorry for all the questions, I just want to know one thing regarding the healthbar methods, both python and non-python, if I do everything the way they say obviously it all works fine, now I want to change the name of the first bar’s (ShieldBar) property, to being instead of “Health” to “shields”, if I replace all the areas that specify to the property “health”, shields, the bars do not want to work. I’m not quite sure whether all three bars can have the same property names and if this is a good idea, that is why I want to change them, so that it is easier for me to be able to change things afterwards on the bars if needs be.

Thanks for the tips, though I’ve been using collisions a lot with the logic bricks, I have thought of the same thing as you are stating Scar89. Here is what I started to look at how to do. My first few attempts were quite close to the idea of getting the bars to work, however I’m not quite sure which actuator will be the best for getting the armor bar to react after the shield bar has been depleted.

Here is what I thought of doing.

Attachments



Changing all the properties to shield should work (without typos :S).

Use the shift select method to link that Health = 0 check on the shield bar to any controllers on the armour bar that need it. You can even copy your logic across with Ctrl C (be prepared to Crtl Z and resect in a different order if both go blank)

Very nice HUD btw :smiley: