Announcement

Collapse
No announcement yet.

Regeneration

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

  • 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?

  • #2
    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
    Mr.Burns
    "Helping to keep this community friendly, helpful, and clean of spammers since 2006"
    WWW: Quake Terminus , QuakeVoid You Tube: QuakeVoid
    Servers: Quake.shmack.net, damage.servequake.com

    News: JCR's excellent ctsj_jcr map is being ported to OOT

    Comment


    • #3
      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
      .
      are you curious about what all there is out there in terms of HD content for quake?
      > then make sure to check out my 'definitive' HD replacement content thread! <
      everything that is out there for quake and both mission-packs, compiled into one massive thread

      Comment


      • #4
        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.
        'Replacement Player Models' Project

        Comment


        • #5
          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.
          www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

          Comment


          • #6
            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?

            Comment


            • #7
              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
              Mr.Burns
              "Helping to keep this community friendly, helpful, and clean of spammers since 2006"
              WWW: Quake Terminus , QuakeVoid You Tube: QuakeVoid
              Servers: Quake.shmack.net, damage.servequake.com

              News: JCR's excellent ctsj_jcr map is being ported to OOT

              Comment


              • #8
                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!
                'Replacement Player Models' Project

                Comment


                • #9
                  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
                  Fórum QuakeBrasil

                  Lots of Quake related stuff


                  Comment


                  • #10
                    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?

                    Comment


                    • #11
                      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!!
                      Best FPS's of All-Time: Quake, Goldeneye, Half-Life
                      https://www.LFGdating.com

                      Comment


                      • #12
                        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.
                        Dude,lets party!
                        Bring some food and drink.I got Arcane Dimensions 2.666!?!

                        Comment


                        • #13
                          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
                          www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

                          Comment


                          • #14
                            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.

                            Comment


                            • #15
                              @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
                              http://www.nextgenquake.com

                              Comment

                              Working...
                              X