Announcement

Collapse
No announcement yet.

Regeneration

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MadGypsy
    replied
    @dancar

    This is easy just write a couple/few scripts

    Script 1: clone nearest health to player
    Script2: an AI for cloned health boxes to find the player much like a bot would

    From there it's simple, every X seconds the nearest health box will clone itself, navigate and "jump" into the player. I'm sure you will agree this is the most sensible way to go. You could even figure out how to put a noclip flag on all cloned health so it doesn't have to worry about walls. A slight upgrade and you could have bad health chasing the player around muah-ha-ha

    Leave a comment:


  • dancar
    replied
    Originally posted by R00k View Post
    Wait, what are you *really* trying to do; just change the behavior of the Pent?
    The idea was that your health regenerates over a certain period of time. I don't know, 5 points x second.

    I hate invulnerability in all games, no matter is for player or monsters, I can't stand it.

    Leave a comment:


  • R00k
    replied
    Originally posted by dancar View Post
    Thanks, looks really good, but I have a question, stupid probably. If I want to tell the game to change the inv. powerup into the regen. from Total Destruction, what I must do?
    Wait, what are you *really* trying to do; just change the behavior of the Pent?

    The code he posted above will also regen the armor value too. I didnt go that far because pent doesnt protect armor, and i was too lazy to type that much

    Leave a comment:


  • ijazz
    replied
    Basically,you go to items.qc and you should find a void() powerup_touch
    (or something like that) and find the powerups code and their self.netname.

    change self.netname to anything
    example

    self.netname= "The Stupid Slow-Regen Thing!"


    If you want to make the IT_INVULNERABILITY into a IT_REGEN
    simply find all mentions of IT_INVULNERABILITY and change it to IT_REGEN.
    Don't forget the defs.qc part,though.

    Leave a comment:


  • bgf0302
    replied
    Originally posted by Mr.Burns View Post
    If no QuakeC coder but I would probably experiment with something like the following:

    Code:
    local float increm, maxh;
    
    maxh = self.max_health
    increm=10
    if (self.health < maxh)
    	{
             self.health = self.health + increm;
            }
    Obviously the above is untried, untested and probably wrong in a number of aspects but it might help

    Kind regards
    Monty
    Untried, untested and probably wrong is the only fun way to code!!

    Leave a comment:


  • dancar
    replied
    Originally posted by vegetous View Post
    From Total Destruction II
    Thanks, looks really good, but I have a question, stupid probably. If I want to tell the game to change the inv. powerup into the regen. from Total Destruction, what I must do?

    Leave a comment:


  • vegetous
    replied
    From Total Destruction II

    Code:
                   //
                    // RUNE 4 REGENERATION
                    //
                    if (runeof(self) == 4)
                       {
                            local float ma;
                            // regenera health
                            if (self.health < self.max_health)
                               {
                                    self.health = self.health + 5;
                                    if (self.health > self.max_health)
                                       self.health = self.max_health;
                               }
                            // regenera armor
                            if (self.armorvalue > 0)
                               {
                                    if (self.armortype == 0.3) ma = 100; else
                                    if (self.armortype == 0.6) ma = 150; else
                                    if (self.armortype == 0.8) ma = 200; else
                                    if (self.armortype >= 0.9) ma = 250; else
                                       {
                                            self.armortype = 0.3; // bugfix... armadura verde inicial
                                            ma = 100;
                                       }
                                    if (self.armorvalue < ma)
                                       self.armorvalue = self.armorvalue + 5;
                                    if (self.armorvalue > ma)
                                       self.armorvalue = ma;
                               }
                       }
               }
    Last available source code here:

    https://mega.nz/#!IdZxAALI!7dvZJD-Oo...hcaoLAOFx2Tq0I

    Leave a comment:


  • Dutch
    replied
    Originally posted by Mr.Burns View Post
    In case you didn't know Rook is one very accomplished and talented QuakeC guy and we're lucky to have him as one of our members

    Kind regards
    Monty
    Agreed, R00k has bailed me out of several QC jams!

    Leave a comment:


  • Mr.Burns
    replied
    I would trust Rook's QuakeC over mine any day. Come to think of it I would trust Rook's Quake anything over mine every day and twice on weekends ;-)
    In case you didn't know Rook is one very accomplished and talented QuakeC guy and we're lucky to have him as one of our members

    Kind regards
    Monty

    Leave a comment:


  • dancar
    replied
    Originally posted by R00k View Post
    look in client.qc find "CheckPowerups" find the portion that has the pent
    then do what Burns suggests.

    if (self.invincible_finished)
    {
    if (self.health < max_health) self.health += 1;
    Thank you all

    ROOk, your code is slight different from Burns'one (if not, I apologie). I will try your, right?

    Leave a comment:


  • R00k
    replied
    look in client.qc find "CheckPowerups" find the portion that has the pent
    then do what Burns suggests.

    if (self.invincible_finished)
    {
    if (self.health < self.max_health) self.health += 1;
    Last edited by R00k; 03-06-2017, 06:13 AM.

    Leave a comment:


  • Dutch
    replied
    Originally posted by dancar View Post
    I would like to change the invulnerability powerup into a regenaration powerup.

    This's the original code:

    void () item_artifact_invulnerability =
    {
    self.touch = powerup_touch;
    precache_model ("progs/invulner.mdl");
    precache_sound ("items/protect.wav");
    precache_sound ("items/protect2.wav");
    precache_sound ("items/protect3.wav");
    self.noise = "items/protect.wav";
    setmodel (self, "progs/invulner.mdl");
    self.netname = "Pentagram of Protection";
    self.items = IT_INVULNERABILITY;
    setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
    StartItem ();
    };

    What should I write to make the change, please?
    Keep in mind, this is only the code for the Pentagram's spawn function (i.e. the in-game item). The behavior it has on the player is found in several different functions. T_Damage(), CheckPowerUps(), and PutClientInServer() are just a few off the top of my head.

    This is actually fairly in-depth if you're not entirely familar with the QC base. The coding itself should not be that difficult, but tracking down all the functions that relate to the pentagram may be. You'll want to search for all functions that reference IT_INVULNERABILITY and self.invincible_time (I believe that's what the global float is called) and alter them from there.

    Leave a comment:


  • talisa
    replied
    you could look into the QC of the drake mod, they actually have two regeneration powerups called the 'rejuvinators'

    https://www.quaddicted.com/webarchiv...%3Fid=169.html

    and they included the QC source with the mod

    Leave a comment:


  • Mr.Burns
    replied
    If no QuakeC coder but I would probably experiment with something like the following:

    Code:
    local float increm, maxh;
    
    maxh = self.max_health
    increm=10
    if (self.health < maxh)
    	{
             self.health = self.health + increm;
            }
    Obviously the above is untried, untested and probably wrong in a number of aspects but it might help

    Kind regards
    Monty

    Leave a comment:


  • dancar
    started a topic Regeneration

    Regeneration

    I would like to change the invulnerability powerup into a regenaration powerup.

    This's the original code:

    void () item_artifact_invulnerability =
    {
    self.touch = powerup_touch;
    precache_model ("progs/invulner.mdl");
    precache_sound ("items/protect.wav");
    precache_sound ("items/protect2.wav");
    precache_sound ("items/protect3.wav");
    self.noise = "items/protect.wav";
    setmodel (self, "progs/invulner.mdl");
    self.netname = "Pentagram of Protection";
    self.items = IT_INVULNERABILITY;
    setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
    StartItem ();
    };

    What should I write to make the change, please?
Working...
X