applying health to weapons
Moderator: InsideQC Admins
30 posts
• Page 2 of 2 • 1, 2
Try this:
Replace the following code at health_touch():
To this:
This will remove the health rotting, I think the problem comes from that.
When you get a megahealth box, you health will no longer rot down, but it'll still limit to 250.
If you don't like that I'll try to write a different health rotting code.
Replace the following code at health_touch():
- Code: Select all
// Megahealth = rot down the player's super health
if (self.healtype == 2)
{
other.items = other.items | IT_SUPERHEALTH;
self.nextthink = time + 5;
self.think = item_megahealth_rot;
self.owner = other;
}
else
{
if (deathmatch != 2) // deathmatch 2 is the silly old rules
{
if (deathmatch)
self.nextthink = time + 20;
self.think = SUB_regen;
}
}
To this:
- Code: Select all
if (deathmatch != 2) // deathmatch 2 is the silly old rules
{
if (deathmatch)
self.nextthink = time + 20;
self.think = SUB_regen;
}
This will remove the health rotting, I think the problem comes from that.
When you get a megahealth box, you health will no longer rot down, but it'll still limit to 250.
If you don't like that I'll try to write a different health rotting code.
-

Orion - Posts: 476
- Joined: Fri Jan 12, 2007 6:32 pm
- Location: Brazil
I'm running into one small problem.
If I'm standing on a spawnpoint for an item and it respawns beneath me I get stuck. I have to shoot my way out.
Why doesn't the player "pick up" the item?
If I'm standing on a spawnpoint for an item and it respawns beneath me I get stuck. I have to shoot my way out.
Why doesn't the player "pick up" the item?
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
-

redrum - Posts: 410
- Joined: Wed Mar 28, 2007 11:35 pm
- Location: Long Island, New York
in SUB_regen
do
setorigin(self, self.origin);
This will force the entity to update so the touch will register.
...or some bullshit
do
setorigin(self, self.origin);
This will force the entity to update so the touch will register.
...or some bullshit
Benjamin Darling
http://www.bendarling.net/
Reflex - In development competitive arena fps combining modern tech with the speed, precision and freedom of 90's shooters.
http://www.reflexfps.net/
http://www.bendarling.net/
Reflex - In development competitive arena fps combining modern tech with the speed, precision and freedom of 90's shooters.
http://www.reflexfps.net/
- Electro
- Posts: 312
- Joined: Wed Dec 29, 2004 11:25 pm
- Location: Brisbane, Australia
Why not rather use forceretouch or whatever it was called?
redrum: instead of doing what the un-cool Electro said, in SUB_Regen, add a line at the bottom that says:
That should do the trick!
redrum: instead of doing what the un-cool Electro said, in SUB_Regen, add a line at the bottom that says:
- Code: Select all
force_retouch = 2;
That should do the trick!
I was once a Quake modder
-

Urre - Posts: 1109
- Joined: Fri Nov 05, 2004 2:36 am
- Location: Moon
Bueller?
This is what I have, still getting "stuck"
- Code: Select all
void() SUB_regen =
{
self.model = self.mdl; // restore original model
self.solid = SOLID_BBOX; // allow it to be touched again
self.health = 25;
self.takedamage = DAMAGE_AIM;
self.th_die = ItemDie;
self.touch = self.blocked;
sound (self, CHAN_VOICE, "items/itembk2.wav", .8, ATTN_NORM); // play respawn sound
setorigin (self, self.origin);
force_retouch = 2; //not working
};
This is what I have, still getting "stuck"
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
-

redrum - Posts: 410
- Joined: Wed Mar 28, 2007 11:35 pm
- Location: Long Island, New York
It sucks that your mod isn't on some cool engine because then the items could just be SOLID_CORPSE (though i'm not sure if SOLID_CORPSE register trigger-like touches)...
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
- Sajt
- Posts: 1215
- Joined: Sat Oct 16, 2004 3:39 am
Tried to get DP running, won't work though.
Stupid NVidia card!
Anyway, I figured my problem out. I changed self.solid = SOLID_BBOX; to self.solid = SOLID_TRIGGER;
Not the best fix, items don't blow up when you hit them, b/c you don't actually hit them anymore. BUT, when a rocket explodes nearby then they explode!
Also, the bots won't grab an item until after it respawns
I'm still hoping FrikaC will make some QW friendly bots. Just need them to be able to transfer map to map. That would complete my mod
Stupid NVidia card!
Anyway, I figured my problem out. I changed self.solid = SOLID_BBOX; to self.solid = SOLID_TRIGGER;
Not the best fix, items don't blow up when you hit them, b/c you don't actually hit them anymore. BUT, when a rocket explodes nearby then they explode!
Also, the bots won't grab an item until after it respawns
I'm still hoping FrikaC will make some QW friendly bots. Just need them to be able to transfer map to map. That would complete my mod
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
-

redrum - Posts: 410
- Joined: Wed Mar 28, 2007 11:35 pm
- Location: Long Island, New York
at work now so I can't double check this, but a way around checking to see if you'll get stuck is for the item before it spawns running a small findradius. If it returns an entity with
classname == "player"
that means you, (or any other client on the server) would get stuck in it. Or you could make it a broader scope and just check if the entity's
.takedamage == DAMAGE_YES.
Now to recall the code, I think it would be
That's work for the initial check I'd think to make it so if you would've gotten stuck it makes it SOLID_TRIGGER. However then the issue you have as you said before things like traceline and TraceAttack stuff can't inflict damage, only spawned entities moving in 3d space or the T_RadiusDamage stuff. So you may want to consider giving the entitiy if it is SOLID_TRIGGER a think function that updates every couple of seconds checking to see if a player is still in it.
Or you could force retouch as stated above however I've never come across this issue, mainly because DP supports SOLID_CORPSE and a few ways around this. You could possibly start by giving it a SOLID_TRIGGER and give it a .think, and if something is touching it and is a player then continue running this check until no player is touching it and then make it SOLID_BBOX.
Granted continuous findradius's can be taxing, but once every couple of seconds and stopping once a player or damageable object is no longer in it's immediate collision space is well within bounds.
classname == "player"
that means you, (or any other client on the server) would get stuck in it. Or you could make it a broader scope and just check if the entity's
.takedamage == DAMAGE_YES.
Now to recall the code, I think it would be
- Code: Select all
local entity e;
e = findradius (self.origin, (choose radius size here));
self.solid = SOLID_BBOX;// make solid object by default.
while (e)
{
if (e.classname == "player") // found player in radius
{
self.solid = SOLID_TRIGGER;// make non solid or else get stuck
return;
}
e = e.chain; // loop through entities.
}
That's work for the initial check I'd think to make it so if you would've gotten stuck it makes it SOLID_TRIGGER. However then the issue you have as you said before things like traceline and TraceAttack stuff can't inflict damage, only spawned entities moving in 3d space or the T_RadiusDamage stuff. So you may want to consider giving the entitiy if it is SOLID_TRIGGER a think function that updates every couple of seconds checking to see if a player is still in it.
Or you could force retouch as stated above however I've never come across this issue, mainly because DP supports SOLID_CORPSE and a few ways around this. You could possibly start by giving it a SOLID_TRIGGER and give it a .think, and if something is touching it and is a player then continue running this check until no player is touching it and then make it SOLID_BBOX.
Granted continuous findradius's can be taxing, but once every couple of seconds and stopping once a player or damageable object is no longer in it's immediate collision space is well within bounds.
- Chris
- Posts: 79
- Joined: Sat Aug 05, 2006 5:31 am
30 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest