Inside3D!
     

Dead bodies

 
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: Sat Oct 20, 2007 10:23 pm    Post subject: Dead bodies Reply with quote

Where is the code that tells how long the dead bodies stay in the game. I looked in player and client.qc but can't find it?
_________________
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: Sat Oct 20, 2007 10:28 pm    Post subject: Reply with quote

There's no time the dead bodies stay in the game.

When a player dies, he copies his frame and model to a global entity called "bodyque_head".
When has more than 4 dead bodies in the server, the oldest body is removed from the queue.

The function is in world.qc, called CopyToBodyQue().
_________________
There's no signature here. Stop looking for one.
Back to top
View user's profile Send private message
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Sat Oct 20, 2007 10:49 pm    Post subject: Reply with quote

If you want to easily increase the size of the bodyque...

Pimp!

It's a tutorial I wrote in 2004, so it's probably rotted since then and probably doesn't compile.
_________________
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: Sun Oct 21, 2007 5:51 am    Post subject: Reply with quote

Thanks Sajt! Works great.
I reduced the number to one. Less is more Smile
Now, I have dogs in my mod. How can I change them?
_________________
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: Tue Oct 23, 2007 4:30 pm    Post subject: Reply with quote

Bueller? Bueller?
_________________
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: Tue Oct 23, 2007 5:12 pm    Post subject: Reply with quote

If dogs are normal monsters then the corpses are permanent.

It shouldn't be hard to remove them after a certain time.

I dunno if this works, but give it a try:
go to the last death frame in each of his death animations, and do something like this

Code:

void() corpse =
{
    self.think = SUB_Remove;
    self.nextthink = time + 10;
};
...
void() dog_die9 = [$death9, corpse] {};
...
void() dog_dieb9 = [$deathb9, corpse] {};






Hmm let's explain. If you don't know how these shortcut 'animation' functions work...

This:

void() dog_die1 = [$death1, dog_die2] {/*code*/};

Is short form (I think!) for this:

void() dog_die1 =
{
self.frame = $death1;
self.think = dog_die2;
self.nextthink = time + 0.1;

/* code */
};

With the added bonus that you don't have to prototype dog_die2 before you use it...
_________________
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: Tue Oct 23, 2007 8:01 pm    Post subject: Reply with quote

I'll try it out!
_________________
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: Wed Oct 24, 2007 2:12 am    Post subject: Reply with quote

[drunk mode]
You can use CpoyotBofyReu() too, at ehe very als dog's daetyh farme, bt jsut fcalling it adn cahngin cpoepse to dog-Die9 adn dog-dieb9.
But if you prefer a limitre dtime to a body be romed, vuse the code Saht gav tou.
EDIT: Call a Remove(Serlf); at dog_gdie9 and sog_Dieb9 to ir bw propelr rmobgved.
[/drunk mode]

SAP
SAP EDIT: Call a remove(self); at dog_die9() and dog_bdie9() to it be properly removed.
_________________
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: Wed Oct 24, 2007 2:28 pm    Post subject: Reply with quote

WTF! LOL
_________________
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 24, 2007 8:40 pm    Post subject: Reply with quote

When the dogs die, they don't drop to the floor. They remain in their last position for 10 seconds then disappear?
I tried all sorts of different ways with the code but always end up in the same situation.

Code:
void() dog_die1 = [$death1, dog_die2]
{
    self.nextthink = time + 10;
    self.think = SUB_Remove; 
}; 
void() dog_die2 = [$death2, dog_die3]
{
    self.nextthink = time + 10;
    self.think = SUB_Remove;
}; 
void() dog_die3 = [$death3, dog_die4]
{
    self.nextthink = time + 10;
    self.think = SUB_Remove; 
}; 
etc...........

_________________
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: Wed Oct 24, 2007 9:26 pm    Post subject: Reply with quote

These 2 lines you shouldn't add at every death frame, just in the last.
Remove the lines from all of them unless of the last death frame.
_________________
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: Thu Oct 25, 2007 2:19 am    Post subject: Reply with quote

Ok, thanks. Works great!
_________________
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
Page 1 of 1

 
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