View Full Version : Dod Weapon/Corpse Stay
Wilson [29th ID]
01-13-2007, 11:33 PM
/* DOD WEAPON/CORPSE STAY
* Created by the 29th Infantry Division
* www.29th.org (A Realism Unit)
* www.dodrealism.branzone.com -- Revolutionizing Day of Defeat Realism
*
* DESCRIPTION
* Will allow a server-side control of how long weapons stay
* on the ground, and how long corpses stay on the ground.
* Warning: Having too many weapons/corpses will cause lag
* (This is done by very high settings of the CVARs)
*
* KNOWN BUGS
* If player dies in mid air, fake corpse will fall through the ground
*
* CVARs
* dod_weaponstay <-1/0/#>
* Setting to 0 will turn off Weaponstay
* Setting to -1 will force weapons to stay the entire round
* Setting above 0 will force weapons to stay for their normal period plus this #
*
* dod_corpsestay <-1/0/#>
* Setting to 0 will turn off Corpsestay
* Setting to -1 will force corpses to stay the entire round
* Setting above 0 will force corpses to stay this #
*/
diamond-optic
01-13-2007, 11:43 PM
ohh nice heheh i'll be trying this out probably monday (heh my day off so ill def be able to find time.. :p)
jason
01-14-2007, 01:02 AM
Nice...try it out on our linux boxy :)
Kiel |17.SS|
01-14-2007, 05:59 AM
Oh sweet! I'll be testing this out tonight!
{SR} *Raggy*
01-14-2007, 11:13 AM
* Setting above 0 will force weapons to stay for their normal period plus this #
I am guessing that is in seconds...
Wilson [29th ID]
01-15-2007, 06:43 AM
DAYS!
It's technically gametime #s which I am pretty sure is seconds.
Kiel |17.SS|
01-15-2007, 05:01 PM
sweet it works! Thanks!
Kiel |17.SS|
01-15-2007, 06:14 PM
I found a problem. When I set it to -1, and then I set it to something else, the guns/corpses won't disapear.
Kiel |17.SS|
01-15-2007, 08:31 PM
Also, when you set the gun/corpsestay to 1 min. then you set it to 2 sec. after you drop a gun or someone dies, that won't dissapear until a min. is up.
Wilson [29th ID]
01-16-2007, 12:09 AM
It's designed that way. Each individual corpse or weapon has its own timer that is set when they are created/dropped.
Kiel |17.SS|
01-16-2007, 12:11 AM
I have a problem. Every time I use that mod, no one can join the server. I can't join either. It'll start loading, then it'll just get stuck at a part.
Wilson [29th ID]
01-16-2007, 02:32 AM
Do you have the fakemeta module enabled on your server?
That's very strange...this plugin doesn't do anything that would do that. And it works fine for me.
Wilson [29th ID]
01-20-2007, 04:31 AM
Updated. Fixed runtime error.
Lost-Wisdom
06-07-2008, 10:44 AM
Hmm, there isn't any instructions on where to put the files, which folder do I place it in?
Wilson [29th ID]
06-07-2008, 03:25 PM
There aren't any instructions because it's the same as any other plugin ;)
Just put the .amxx file into the /plugins/ and add the filename to configs/plugins.ini
Unleashed108
06-16-2008, 05:36 AM
dam wilson =)
Suggestion: add this code to your corpse generation parameters. It will allow the corpse to take on the 'body' of the victim. Without it, your corpse will spawn helmets and change faces etc. The gear part of the model, as far as I can tell, can't be set on a non-player entity. That's why the body parameter is mathmatically adjusted, to eliminate the gear part.
new m_iBody = get_msg_arg_int(9)
m_iBody -= (m_iBody / 336) * 336
set_pev(ent, pev_body, m_iBody)
I use it in a plugin I wrote (based off of this one BTW, Thanks) that makes the corpse 'fade away' (instead of just sinking into oblivion) and it works nicely.
Edit:
Posted Corpse Fade (http://www.dodplugins.net/forums/showthread.php?t=1458) plugin.
-
=|[76AD]|= TatsuSaisei
12-21-2008, 01:45 AM
Suggestion: add this code to your corpse generation parameters. It will allow the corpse to take on the 'body' of the victim. Without it, your corpse will spawn helmets and change faces etc. The gear part of the model, as far as I can tell, can't be set on a non-player entity. That's why the body parameter is mathmatically adjusted, to eliminate the gear part.
new m_iBody = get_msg_arg_int(9)
m_iBody -= (m_iBody / 336) * 336
set_pev(ent, pev_body, m_iBody)
I use it in a plugin I wrote (based off of this one BTW, Thanks) that makes the corpse 'fade away' (instead of just sinking into oblivion) and it works nicely.
Edit:
Posted Corpse Fade (http://www.dodplugins.net/forums/showthread.php?t=1458) plugin.
-
your code can be simplified ... remove the goofy math (no matter what m_iBody is it ends up being 0 all the time)
set_pev(ent,pev_body,0);
|= TatsuSaisei;11437']no matter what m_iBody is it ends up being 0 all the time
The pev_body value on a player can be 0, but its usually not. Its a sumation of the different body parts (body, helmet, head, and gear). Setting the pev_body changes the model displayed. Allowing you to control those elements. As explained in the post, the math is needed to eliminate the gear. Setting the body on a player is different than setting a body on other entities. Players can accept an integer body value, whereas other entities only accept a byte (256 max) value. So setting the body with gear included can produce undesireable results.
diamond-optic
12-21-2008, 04:42 AM
wow in the process of writing a big long post because i wasnt understanding the math.. i got the solution.. woohoo saves me looking like a complete fool (ill take partial fool any day!)
i wasnt getting any 0's but i was always having the body value being the same before and after... then i did the math without using float values after the division.. all groovy now lol.. :D
tho im curious as to how you came about the 336 value..
tho im curious as to how you came about the 336 value..
lol - it wasn't easy. Mainly trial and error setting the pev_body value on players. Although it sounds easy now, after you figure it out.
On the player model. There are 4 model part groups, Body, Helmet, Head and Gear which are set via the pev_body key. Once you've cycled through all of one body part, increasing the value jumps to the next body part. Then the count starts all over again. Kind of a funky binary count, only in decimal.
The Body part has 6 submodels (#s 0 - 5).
The Helmet part has 8 submodels (#s that are multiples of 6 (0, 6, 12, 18, 24, 30, 36, 42).
The Head part has 7 submodels (#s that are multiples of 48 (0, 48, 96, 144, 192, 240, 288).
The Gear part has 7 submodels (#s that are multiples of 336 (0, 336, 672, 1008, 1344, 1680, 2016)
So, to eliminate the Gear part, do the math. And like I said, while you CAN set pev_body to these values on a PLAYER, the value seems to be limited to byte-size on other entity types. Weird. But then again, I think DOD is the only HL1 mod to have this many body options.
=|[76AD]|= TatsuSaisei
12-21-2008, 12:19 PM
Forgive me, I completely forgot how "integer" math is handled (truncates the numbers after any decimal) and after reading your further comments I have to say even I didn't realize DoD had that sort of depth in setting "body numbers" ... I believe that may "answer" some other long standing questions I have had...
So while I am "sorry" to have said your math was "goofy", I am glad I said something and got this explanation out of you.
Sorry, and Thanx !!
Does anyone know if there are issues with this conflicting with other plugins, or server stability issues, beyond the extra strain caused by a higher entity count? I'm wondering specifically about the Damage Infliction and Medic mods. I'm just getting a lot of small weird glitches, and I'm wondering if they might be related to this plugin.
The only reason why I am singling out this plugin is that I know that Sturmbot used to have the option to have corpses not decay, and it was known to cause problems at times.
edit: Actually I think I solved my own problems. I find that AMXX plugins that mess with entities need to be loaded at the top of the plugins.ini file, and that appears to have solved the problems I was having with this plugin.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.