View previous topic :: View next topic |
Author |
Message |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Mon Oct 15, 2007 4:05 pm Post subject: |
|
|
Orion? Urre? _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
leileilol

Joined: 15 Oct 2004 Posts: 1321
|
Posted: Mon Oct 15, 2007 7:49 pm Post subject: |
|
|
Bueller.......? _________________
 |
|
Back to top |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Mon Oct 15, 2007 10:13 pm Post subject: |
|
|
Hey, that's my line... _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
Orion

Joined: 12 Jan 2007 Posts: 413 Location: Brazil
|
Posted: Mon Oct 15, 2007 10:44 pm Post subject: |
|
|
Try this:
Replace the following code at health_touch():
Code: |
// 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: |
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. _________________ There's no signature here. Stop looking for one. |
|
Back to top |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Mon Oct 15, 2007 11:13 pm Post subject: |
|
|
Thanks man! I'll try it out  _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Mon Oct 15, 2007 11:32 pm Post subject: |
|
|
That fixed the problem, I could live without the rot!
Thanks! _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Thu Oct 25, 2007 4:16 am Post subject: |
|
|
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? _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
Electro
Joined: 29 Dec 2004 Posts: 241 Location: Brisbane, Australia
|
Posted: Thu Oct 25, 2007 6:54 am Post subject: |
|
|
in SUB_regen
do
setorigin(self, self.origin);
This will force the entity to update so the touch will register.
...or some bullshit _________________ Unit reporting!
http://www.bendarling.net/ |
|
Back to top |
|
 |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Thu Oct 25, 2007 8:00 am Post subject: |
|
|
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! _________________ Look out for Twigboy |
|
Back to top |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Thu Oct 25, 2007 4:32 pm Post subject: |
|
|
Already had setorigin(self, self.origin); in there.
force_retouch = 2; didn't help  _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Wed Oct 31, 2007 1:06 am Post subject: |
|
|
Bueller?
Code: | 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 69.113.123.178:27500 |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Wed Oct 31, 2007 1:14 am Post subject: |
|
|
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. |
|
Back to top |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Wed Oct 31, 2007 2:20 am Post subject: |
|
|
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  _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
Chris
Joined: 05 Aug 2006 Posts: 78
|
Posted: Wed Oct 31, 2007 9:54 pm Post subject: |
|
|
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
Code: |
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. |
|
Back to top |
|
 |
redrum

Joined: 28 Mar 2007 Posts: 367 Location: Long Island, New York
|
Posted: Thu Nov 01, 2007 3:11 am Post subject: |
|
|
Thanks for the additional knowledge!! _________________ Welcome to the Overlook Hotel 69.113.123.178:27500 |
|
Back to top |
|
 |
|