Dead bodies
Moderator: InsideQC Admins
12 posts
• Page 1 of 1
Dead bodies
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: The-Overlook-Hotel.game-server.cc
-

redrum - Posts: 410
- Joined: Wed Mar 28, 2007 11:35 pm
- Location: Long Island, New York
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().
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().
-

Orion - Posts: 476
- Joined: Fri Jan 12, 2007 6:32 pm
- Location: Brazil
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.
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.
- Sajt
- Posts: 1215
- Joined: Sat Oct 16, 2004 3:39 am
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
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...
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: Select all
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.
- Sajt
- Posts: 1215
- Joined: Sat Oct 16, 2004 3:39 am
[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.
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.
-

Orion - Posts: 476
- Joined: Fri Jan 12, 2007 6:32 pm
- Location: Brazil
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.
I tried all sorts of different ways with the code but always end up in the same situation.
- Code: Select all
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: The-Overlook-Hotel.game-server.cc
-

redrum - Posts: 410
- Joined: Wed Mar 28, 2007 11:35 pm
- Location: Long Island, New York
12 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest