Results 1 to 2 of 2
  1. #1
    Twizzy's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    28
    Reputation
    6
    Thanks
    1
    My Mood
    Psychedelic

    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
    Last edited by Twizzy; 07-16-2012 at 07:45 AM.

  2. #2
    Twizzy's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    28
    Reputation
    6
    Thanks
    1
    My Mood
    Psychedelic
    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.

Similar Threads

  1. need help with Halo Combat Evolved for pc
    By [V]ast [K]nowledge in forum General
    Replies: 5
    Last Post: 10-21-2011, 05:36 PM
  2. Need help creating Injector
    By ghostdogg1985 in forum Programming Tutorials
    Replies: 0
    Last Post: 11-01-2009, 07:27 AM
  3. I Need help creating a money hack program?
    By mg_8090 in forum General
    Replies: 8
    Last Post: 08-10-2009, 02:17 PM
  4. Need help with creating account
    By someone23465 in forum WarRock Korea Hacks
    Replies: 9
    Last Post: 12-01-2007, 12:40 PM
  5. For all who need helps and n00bs that want start to create hack easily
    By idiot123 in forum WarRock - International Hacks
    Replies: 1
    Last Post: 08-20-2007, 12:05 PM