Helpneed help creating halo-style sheild system

Posts 1–2 of 2 · Page 1 of 1
need help creating halo-style sheild system
im trying to make a halo mlg mod

first thing im trying to do right now is make a shield system, checking for when the player takes damage, and subtracting from shield and waiting for the shield var hit 0 before starting to subtract from health, however the reason i want to do this is to (instead of a health bar) make a shield bar... simple for most, but for a newb like me its a perfect task to get me started!

12 bullets (all heashot) = kill
1 bullet (no sheild) = kill
9 bullets (all headshots) = drop sheild

^^ cant figure out how to do the math to make this accurate

however im not sure if im able to create variables out of the clear blue sky... however i know that if i could i would use the health bar code:

im not sure exactly how to write the code

Code:
self.maxshield = 100;
self.currentshield = self.maxshield; // only on player spawn
self.maxhealth = 100;

while( (self.maxhealth == 100) && (self.currentshield <= 100) )
{
    //draw shield bar 1/3 space of screen width centered on the top of the screen <- sheild.bar
}

while( (self.health == 100) && (self.currentshield != 100) )
{
    while ( player takes no damage ) //not sure how to detect for this
    {
        wait 3.0; //3 seconds?
        //recharge shields making sure it can be interrupted -- possibly a new thread?
    }
}
i have no idea if this is even the best method to go about starting to write this simply complicated code
any and all help will be appreciated

if you write the entire code i will add a credit for you on player spawn for your help. <- this i KNOW how to do
thanks for all the help everyone...



so far i have this:

player.maxhealth = 120;
minShieldBar = (player.maxhealth)-(player.maxhealth(.25)); //25% of player.maxhealth, 30 health = 0 barwidth
barWidth = 128;
currentShield = 100;
bulletDamage = 10;

my problem is, im not sure how one would code it so the healthbar (shieldbar) only displays from 25% - 100% of the health, after >25% of health is reached, the bar length should be 0.
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?