Site Navigation
QuakeOne News
» Latest News
» News Archives
» QuakeOne Movies

QuakeOne Help
» File Downloads
» Quake Help
» Quake Servers

QuakeOne Community
» Forums
» Chat *new*
» Poll Booth
» Memberlist
» Member Map

Site Info
» Community Rules
» Moderator List

» Buy Quake

Visit QuakeOne.com On Facebook!Visit QuakeOne
on Facebook

Log in
User Name:

Password:

Not a member yet?
Register Now!
Online Users: 341
1 members and 340 guests
No Members online
Most users ever online was 2,542, 06-04-2016 at 12:58 AM.
Go Back Home > Forums > Quake Help > Servers and Coding > Regeneration Search Forums

Reply
LinkBack Thread Tools
Unread 02-27-2017, 11:25 AM   #1 (permalink)
Axe Man
USER INFO »
Posts: 13
+/-  Reputation: dancar is on a distinguished road
Join Date: Mar 2012
Currently: Offline
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?
Reply With Quote
Unread 02-27-2017, 01:09 PM   #2 (permalink)
Chthon
Mr.Burns's Avatar
USER INFO »
Posts: 1,492
+/-  Reputation: Mr.Burns will become famous soon enough
Join Date: Jan 2006
Currently: Offline
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
WWW: QuakeOne | Q1 File Repo | Quake Terminus|EuroQuake, You Tube: QuakeVoid
Servers: flanders.servequake.com | newyork.servequake.com ports 26000-6 & 10 | damage.servequake.com
NEWS : The new Quakeone file repo is now available, so click here to satisfy all your Quake 1 multiplayer needs
Reply With Quote
Unread 02-27-2017, 06:11 PM   #3 (permalink)
Chthon
talisa's Avatar
USER INFO »
Posts: 4,227
+/-  Reputation: talisa is a jewel in the roughtalisa is a jewel in the roughtalisa is a jewel in the rough
Join Date: Oct 2011
Currently: Offline
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
Reply With Quote
Unread 02-28-2017, 12:39 AM   #4 (permalink)
Chthon
Dutch's Avatar
USER INFO »
Posts: 1,042
+/-  Reputation: Dutch has a spectacular aura aboutDutch has a spectacular aura about
Join Date: Jan 2014
Currently: Offline
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.
Reply With Quote
Unread 03-01-2017, 10:27 AM   #5 (permalink)
Code Monkey
R00k's Avatar
USER INFO »
Posts: 5,773
+/-  Reputation: R00k has a spectacular aura aboutR00k has a spectacular aura aboutR00k has a spectacular aura about
Join Date: Nov 2005
Currently: Offline
Contact:  Send a message via ICQ to R00k Send a message via MSN to R00k
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 at 06:13 AM..
Reply With Quote
Unread 03-01-2017, 12:56 PM   #6 (permalink)
Axe Man
USER INFO »
Posts: 13
+/-  Reputation: dancar is on a distinguished road
Join Date: Mar 2012
Currently: Offline
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?
Reply With Quote
Unread 03-01-2017, 01:18 PM   #7 (permalink)
Chthon
Mr.Burns's Avatar
USER INFO »
Posts: 1,492
+/-  Reputation: Mr.Burns will become famous soon enough
Join Date: Jan 2006
Currently: Offline
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
WWW: QuakeOne | Q1 File Repo | Quake Terminus|EuroQuake, You Tube: QuakeVoid
Servers: flanders.servequake.com | newyork.servequake.com ports 26000-6 & 10 | damage.servequake.com
NEWS : The new Quakeone file repo is now available, so click here to satisfy all your Quake 1 multiplayer needs
Reply With Quote
Unread 03-01-2017, 07:12 PM   #8 (permalink)
Chthon
Dutch's Avatar
USER INFO »
Posts: 1,042
+/-  Reputation: Dutch has a spectacular aura aboutDutch has a spectacular aura about
Join Date: Jan 2014
Currently: Offline
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!
Reply With Quote
Unread 03-01-2017, 09:59 PM   #9 (permalink)
Hell Knight
vegetous's Avatar
USER INFO »
Posts: 221
+/-  Reputation: vegetous is on a distinguished road
Join Date: Mar 2006
Currently: Offline
Contact:  Send a message via ICQ to vegetous
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
Reply With Quote
Unread 03-05-2017, 01:07 PM   #10 (permalink)
Axe Man
USER INFO »
Posts: 13
+/-  Reputation: dancar is on a distinguished road
Join Date: Mar 2012
Currently: Offline
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?
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -6. The time now is 09:34 PM.


eXTReMe Tracker