Inside3D!
     

applying health to weapons
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Mon Oct 15, 2007 4:05 pm    Post subject: Reply with quote

Orion? Urre?
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Mon Oct 15, 2007 7:49 pm    Post subject: Reply with quote

Bueller.......?
_________________
Back to top
View user's profile Send private message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Mon Oct 15, 2007 10:13 pm    Post subject: Reply with quote

Hey, that's my line...
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
Orion



Joined: 12 Jan 2007
Posts: 413
Location: Brazil

PostPosted: Mon Oct 15, 2007 10:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Mon Oct 15, 2007 11:13 pm    Post subject: Reply with quote

Thanks man! I'll try it out Smile
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Mon Oct 15, 2007 11:32 pm    Post subject: Reply with quote

That fixed the problem, I could live without the rot!
Thanks!
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Thu Oct 25, 2007 4:16 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Electro



Joined: 29 Dec 2004
Posts: 241
Location: Brisbane, Australia

PostPosted: Thu Oct 25, 2007 6:54 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Thu Oct 25, 2007 8:00 am    Post subject: Reply with quote

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:

Code:
force_retouch = 2;


That should do the trick!
_________________
Look out for Twigboy
Back to top
View user's profile Send private message Visit poster's website
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Thu Oct 25, 2007 4:32 pm    Post subject: Reply with quote

Already had setorigin(self, self.origin); in there.
force_retouch = 2; didn't help Crying or Very sad
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Wed Oct 31, 2007 1:06 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Wed Oct 31, 2007 1:14 am    Post subject: Reply with quote

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
View user's profile Send private message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Wed Oct 31, 2007 2:20 am    Post subject: Reply with quote

Tried to get DP running, won't work though.
Stupid NVidia card! Crying or Very sad

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! Very Happy

Also, the bots won't grab an item until after it respawns Crying or Very sad

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 Very Happy
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
Chris



Joined: 05 Aug 2006
Posts: 78

PostPosted: Wed Oct 31, 2007 9:54 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Thu Nov 01, 2007 3:11 am    Post subject: Reply with quote

Thanks for the additional knowledge!!
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group