Raised This Month: $51 Target: $400
 12% 

Creating a "clone" of a player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kinsi
Senior Member
Join Date: Apr 2013
Old 01-21-2017 , 23:11   Creating a "clone" of a player
Reply With Quote #1

Hai there,

i've been trying for the past few hours or so to do something that seemed easy at first, but apparently isnt.

Essentially, i am looking to create a clone of a player in a different location that moves / rotates and animates just like its "parent". It does not necessarily need to have the items / weapons of its "parent", just the model itself is enough.

I've tried to spawn a prop_dynamic_override w/ the model of the player, setting the effect flags EF_BONEMERGE|EF_PARENT_ANIMATES and parenting / attaching it to the player w/ SetParentAttachmentMaintainOffset, unfortunately i guess the bonemerging "ignores" the MaintainOffset, as the model then (still) is ported into its parent.

Further on i've tried to just spawn a prop_dynamic_override and clone pretty much every netprop that seemed to have something to do w/ animations, and that unfortunately did not result in anything.

Has somebody every had success doing something like this? Does anyone possibly know how one could do this?

Thanks!
Kinsi is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-22-2017 , 01:30   Re: Creating a "clone" of a player
Reply With Quote #2

copying the sequence netprop would probably be the only way to copy animations to a prop. However it looks half-baked.
Also yeah you cant change the position of a prop when it's bonemerged, i've tried everything. The bones are set to the same position and angle as the parent.
Mitchell is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 01-22-2017 , 02:43   Re: Creating a "clone" of a player
Reply With Quote #3

There's all sorts of stupid things that seem to affect the position things get parented to, like whether or not you setparent before or after DispatchSpawn is called, whether or not you set the caller/activator when calling SetParent and what you set those too, etc...
__________________
Chdata is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 01-22-2017 , 03:18   Re: Creating a "clone" of a player
Reply With Quote #4

Quote:
Originally Posted by Mitchell View Post
copying the sequence netprop would probably be the only way to copy animations to a prop. However it looks half-baked.
Also yeah you cant change the position of a prop when it's bonemerged, i've tried everything. The bones are set to the same position and angle as the parent.
Because attachments are handled client side, and bone merge simply tells the client to attach the prop to the client using same named bones
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Kinsi
Senior Member
Join Date: Apr 2013
Old 01-22-2017 , 11:49   Re: Creating a "clone" of a player
Reply With Quote #5

Quote:
Originally Posted by Mitchell View Post
copying the sequence netprop would probably be the only way to copy animations to a prop. However it looks half-baked.
Also yeah you cant change the position of a prop when it's bonemerged, i've tried everything. The bones are set to the same position and angle as the parent.
I've tried that. Unfortunately, when i copy the m_nSequence netprop from the client to the prop_dynamic_override it simply does nothing. The prop still rests in the "idle" pose

PHP Code:
SetEntProp(playerCloneProp_Send"m_nSequence"GetEntProp(clientProp_Send"m_nSequence"));
ChangeEdictState(playerCloneFindDataMapInfo(playerClone"m_nSequence")); 
Other props i tried to copy (addionally) which have done nothing: m_flPlaybackRate, m_flFrozen, m_nSequence, m_flAnimTime, m_flSimulationTime, m_bSimulatedEveryTick, m_bAnimatedEveryTick, m_flCycle
Attached Images
File Type: jpg mspaint_2017-01-22_17-46-12.jpg (94.9 KB, 395 views)

Last edited by Kinsi; 01-22-2017 at 11:51.
Kinsi is offline
Kinsi
Senior Member
Join Date: Apr 2013
Old 01-23-2017 , 11:05   Re: Creating a "clone" of a player
Reply With Quote #6

Well, i guess the journey is over. Theres a netprop for the player called m_bClientSideAnimation. Its set to 1.

Even when i set it to 0, and change m_bSimulatedEveryTick and m_bAnimatedEveryTick to 1, values like m_nSequence, m_flCycle will keep the value of 0.

If somebody knows how / if i could work around this somehow that would be neat


Last edited by Kinsi; 01-23-2017 at 11:06.
Kinsi is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 01-23-2017 , 12:09   Re: Creating a "clone" of a player
Reply With Quote #7

Spawn a bot and translate cmd's from a valid player to it.
Quote:
tv_enable "1"
tv_name "Bot"
These CV create a dummy spectator bot. The bot doesn't require navigations and does nothing after forced spawn, just standing on the ground and waiting for somebody to kill him. Though you can easily manipulate him with the puppet mod: https://forums.alliedmods.net/showthread.php?t=132773 (at least it was possible in cs:s a few years ago) You can also use hostages the same way, only they are not so pliable.
If you want it to work your way, you may use CEntity extension and override the animation part of the CCPlayer class. This extension has such implementation for tf2: https://forums.alliedmods.net/showthread.php?t=127034 and this part of the extension still does its work, so you can just copy and past it, though I only tested it with CS:S
There is an extension NPC for CS:S: https://forums.alliedmods.net/showthread.php?t=161331
It only runs under CSS v73, but you may find some useful stuff there.

Last edited by kadet.89; 01-23-2017 at 13:57.
kadet.89 is offline
Send a message via Skype™ to kadet.89
Kinsi
Senior Member
Join Date: Apr 2013
Old 01-23-2017 , 13:21   Re: Creating a "clone" of a player
Reply With Quote #8

Should've added CS:GO to the title, my bad.

The issue is that this would still not calculate animations on the server.

Like i said i need to 1:1 mimic a player in a different location which unfortunately isnt possible as the animations are seemingly calculated on the client and not the server.

Not only does CENtity look extremely complicated, also would that cause this thing to get kinda out of hand. I think i might've to look for a different way of solving my problem. Still, thank you though for the idea.
Kinsi is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 01-23-2017 , 14:01   Re: Creating a "clone" of a player
Reply With Quote #9

If you need just a prop_dynamic entity with blended animations, you may try this:
https://forums.alliedmods.net/showthread.php?t=268065
Yep, it's not simple, but it does exactly what you want (these Items are simple dynamic props + animation blender). I know a CS:S server where it's used to add custom animations to default player models
There used to be an entity for duplicate animations of a character in HL2, don't remember the name of it... may be there is something similar in CS:GO..

Last edited by kadet.89; 01-23-2017 at 14:08.
kadet.89 is offline
Send a message via Skype™ to kadet.89
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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