AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [CS:S] Dead body player does have an entity index ? (https://forums.alliedmods.net/showthread.php?t=242058)

Zack771 06-13-2014 10:25

[CS:S] Dead body player does have an entity index ?
 
Hi,

I'd like to know if dead body player got an entity index, in order to make it move or something other with the dead body ?

Thanks by advance.

xf117 06-13-2014 10:45

Re: [CS:S] Dead body player does have an entity index ?
 
You mean a ragdoll?
This code works in CS:GO, i assume it is the same for CS:S.
You can get it in "player_death" event.
PHP Code:

new ragdoll GetEntPropEnt(clientProp_Send"m_hRagdoll"); 

ragdoll - your entity index.

Mitchell 06-13-2014 15:10

Re: [CS:S] Dead body player does have an entity index ?
 
clients render the player ragdolls differently, as in not server side, however most clientside predictions will work (parenting was proven to work also.

Zack771 06-13-2014 18:24

Re: [CS:S] Dead body player does have an entity index ?
 
Quote:

Originally Posted by xf117 (Post 2151057)
You mean a ragdoll?
This code works in CS:GO, i assume it is the same for CS:S.
You can get it in "player_death" event.
PHP Code:

new ragdoll GetEntPropEnt(clientProp_Send"m_hRagdoll"); 

ragdoll - your entity index.

Yeah a ragdoll. Thanks i'm gonna try that.

And do you think i can make it move ? Like the puppet mod
Quote:

Originally Posted by Mitchell (Post 2151184)
clients render the player ragdolls differently, as in not server side, however most clientside predictions will work (parenting was proven to work also.

What is clientside predictions please ?

xf117 06-13-2014 18:44

Re: [CS:S] Dead body player does have an entity index ?
 
It basically means ragdoll's behavior may vary for different players.
And no, the way puppet mod works, you cannot apply it to a dead body. You can try to create a bot and control it.

Zack771 06-16-2014 05:33

Re: [CS:S] Dead body player does have an entity index ?
 
Quote:

Originally Posted by xf117 (Post 2151290)
It basically means ragdoll's behavior may vary for different players.

What do you mean by "ragdoll's behavior" ?

Quote:

Originally Posted by xf117 (Post 2151290)
And no, the way puppet mod works, you cannot apply it to a dead body. You can try to create a bot and control it.

Don't think to the bot, i keep it in mind. Thanks ^^

xf117 06-16-2014 05:55

Re: [CS:S] Dead body player does have an entity index ?
 
On your side, corpse might be thrown away by explosion, but another player might see him falling in the hole or something. They are not synced between players. Usual entities like barrels are handled server side (if not specified manually), all players will see the same barrel in the same position, and if you kick it, all players will see it. But with these ragdolls you can't guarantee that all players will see the same picture.

Mitchell 06-16-2014 09:27

Re: [CS:S] Dead body player does have an entity index ?
 
Quote:

Originally Posted by Zack771 (Post 2152489)
What do you mean by "ragdoll's behavior" ?

As in most players have custom mods installed that make the ragdolls fly around, etc. Or if you join the server late, it will just create ragdolls where the player died, and give it no animation or velocity.
85% of the time a player sees the ragdoll in a different position then everyone else does. How ever you could attach a prop_ragdoll to the client, just wouldn't be recommended since it uses a lot of server resources to broadcast ragdoll positions etc.

Zack771 06-17-2014 13:22

Re: [CS:S] Dead body player does have an entity index ?
 
Quote:

Originally Posted by xf117 (Post 2152497)
On your side, corpse might be thrown away by explosion, but another player might see him falling in the hole or something. They are not synced between players. Usual entities like barrels are handled server side (if not specified manually), all players will see the same barrel in the same position, and if you kick it, all players will see it. But with these ragdolls you can't guarantee that all players will see the same picture.

Quote:

Originally Posted by Mitchell (Post 2152575)
As in most players have custom mods installed that make the ragdolls fly around, etc. Or if you join the server late, it will just create ragdolls where the player died, and give it no animation or velocity.
85% of the time a player sees the ragdoll in a different position then everyone else does. How ever you could attach a prop_ragdoll to the client, just wouldn't be recommended since it uses a lot of server resources to broadcast ragdoll positions etc.

Oh ok i perfectly understand now thanks.
I do not know that, so if i see a ragdoll in a position, another player can see it in another position ? Interesting.

Ok so i think i'm gonna control a bot like you suggest ^^

So subject is closed. Thanks a lot for your help =)

Powerlord 06-17-2014 17:40

Re: [CS:S] Dead body player does have an entity index ?
 
Quote:

Originally Posted by Mitchell (Post 2152575)
As in most players have custom mods installed that make the ragdolls fly around, etc. Or if you join the server late, it will just create ragdolls where the player died, and give it no animation or velocity.
85% of the time a player sees the ragdoll in a different position then everyone else does. How ever you could attach a prop_ragdoll to the client, just wouldn't be recommended since it uses a lot of server resources to broadcast ragdoll positions etc.

It's possible to force ragdolls to be done on the server side... I think. At least there's a DataMap for it: m_bForceServerRagdoll.

Edit: This datamap may only exist on things decended from CAI_BaseNPC, though.

Edit2: Nope, it's on the CTFPlayer class in TF2 as well, so it's likely part of CBaseCombatCharacter.


All times are GMT -4. The time now is 11:16.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.