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

[CS:GO] Animating a player model entity


Post New Thread Reply   
 
Thread Tools Display Modes
Bakuryu
Member
Join Date: Dec 2011
Old 11-04-2016 , 14:44   Re: [CS:GO] Animating a player model entity
Reply With Quote #11

Anyone got any ideas? I am not familiar with using things that are in the SDK, but could that be something I could use.
Bakuryu is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 11-04-2016 , 14:59   Re: [CS:GO] Animating a player model entity
Reply With Quote #12

The closest thing you could do is teleport a prop with the same model and animate that. You would need an extension afaik to blend the animations correctly.
Mitchell is offline
Bakuryu
Member
Join Date: Dec 2011
Old 11-06-2016 , 13:59   Re: [CS:GO] Animating a player model entity
Reply With Quote #13

Quote:
Originally Posted by Mitchell View Post
The closest thing you could do is teleport a prop with the same model and animate that. You would need an extension afaik to blend the animations correctly.
That won't really work unless I can mask part of the model. Having the same prop would just look like two models doing two different things, plus I don't think the top part would animate right as I don't think it has movement unless it is paired with the other sequence. So how would I go using/making an extension?
Bakuryu is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 11-07-2016 , 04:52   Re: [CS:GO] Animating a player model entity
Reply With Quote #14

Use CEntity framework. Override "player" entity class and add a new interface for animations. This partially done in tf2dodgeball and my fork for css hl2ents.
kadet.89 is offline
Send a message via Skype™ to kadet.89
Bakuryu
Member
Join Date: Dec 2011
Old 11-13-2016 , 20:25   Re: [CS:GO] Animating a player model entity
Reply With Quote #15

Quote:
Originally Posted by kadet.89 View Post
Use CEntity framework. Override "player" entity class and add a new interface for animations. This partially done in tf2dodgeball and my fork for css hl2ents.
Can you elaborate a little more? You said its partially done in tf2dodgeball and your fork of css hl2ents, is that this?
Bakuryu is offline
arthurdead
Senior Member
Join Date: Jul 2013
Old 11-13-2016 , 21:48   Re: [CS:GO] Animating a player model entity
Reply With Quote #16

you want to animate the actual player entity or an entity with a player model ?

if its an entity with a player model

you need to get the m_AnimOverlay of the entity and manipulate it

https://github.com/arthurdead/utilse...handler.h#L115
https://github.com/arthurdead/utilse...imating.h#L204

if its the actual player entity

i dont think you can but idk

Spoiler

Last edited by arthurdead; 11-13-2016 at 21:59.
arthurdead is offline
Bakuryu
Member
Join Date: Dec 2011
Old 12-17-2016 , 12:58   Re: [CS:GO] Animating a player model entity
Reply With Quote #17

Here is what I am ultimately trying to do. I want to create clones of a player, without using bots. Unless there is a way to make bots not take up player slots (is there?) I need to create basic clones that at best follow the player, do the same animations as the player, and stay level with the ground. Am I going about this the right way, or is there a better way?
Bakuryu is offline
Bakuryu
Member
Join Date: Dec 2011
Old 01-10-2017 , 12:52   Re: [CS:GO] Animating a player model entity
Reply With Quote #18

Anyone got any suggestions? I am thinking of making a new post entirely for this since the animation is only half the battle, but its kind of key at this point.
Bakuryu is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 01-12-2017 , 20:59   Re: [CS:GO] Animating a player model entity
Reply With Quote #19

If it's just a clone, you can just create a 0.1 second repeating timer and in there, get the real player's current sequence (not sure if the animation is included) and apply it to the clone.

Note: You must record the created clone first or you will have a hard time to figure it out.

PHP Code:
int cloneEnt[client];

void CreateClone(int client)
{
    
float clientOrigin[3], clientAngles[3];

    
GetEntPropVector(clientProp_Send"m_vecOrigin"clientOrigin);
    
GetClientEyeAngles(clientclientAngles);
    
    
int EntIndex CreateEntityByName("prop_dynamic_override");
    
DispatchKeyValue(EntIndex"model""models/player/custom_player/legacy/ctm_idf.mdl");
    
    
TeleportEntity(EntIndexclientOriginclientAnglesNULL_VECTOR);
    
DispatchSpawn(EntIndex);
    
    
cloneEnt[client] = EntIndex;
    
    
CreateTimer(0.1ProcessCloneclientTIMER_REPEAT);
}

public 
Action ProcessClone(Handle timerany client)
{
    if (!
IsClientInGame(client))
    {
        
RemoveClone(client); // remove the clone if client leaves..
        
return Plugin_Stop;
    }
    
    if (
cloneEnt[client] <= || !IsValidEntity(cloneEnt[client]) || !IsValidEdict(cloneEnt[client])
    {
        return 
Plugin_Stop// if clone doesn't exist..
    
}
    
    
int clientSequence GetEntProp(clientProp_Send"m_nSequence");
    
    
float currentOrigin[3], currentAngles[3];
    
    
GetEntPropVector(clientProp_Send"m_vecOrigin"currentOrigin);
    
GetClientEyeAngles(clientcurrentAngles[3];
    
    
SetEntProp(cloneEnt[client], Prop_Send"m_nSequence"clientSequence);
    
TeleportEntity(cloneEnt[client], currentOrigincurrentAngleNULL_VECTOR);
    
    return 
Plugin_Continue;
}

void RemoveClone(int client)
{
    if (
cloneEnt[client] <= || !IsValidEntity(cloneEnt[client]) || !IsValidEdict(cloneEnt[client])
    {
        return;
    }
    
    
AcceptEntityInput(cloneEnt[client], "Kill");
    
cloneEnt[client] = 0;


Last edited by cravenge; 01-12-2017 at 21:13.
cravenge is offline
Bakuryu
Member
Join Date: Dec 2011
Old 01-30-2017 , 16:50   Re: [CS:GO] Animating a player model entity
Reply With Quote #20

Quote:
Originally Posted by cravenge View Post
If it's just a clone, you can just create a 0.1 second repeating timer and in there, get the real player's current sequence (not sure if the animation is included) and apply it to the clone.

Note: You must record the created clone first or you will have a hard time to figure it out.

PHP Code:
int cloneEnt[client];

void CreateClone(int client)
{
    
float clientOrigin[3], clientAngles[3];

    
GetEntPropVector(clientProp_Send"m_vecOrigin"clientOrigin);
    
GetClientEyeAngles(clientclientAngles);
    
    
int EntIndex CreateEntityByName("prop_dynamic_override");
    
DispatchKeyValue(EntIndex"model""models/player/custom_player/legacy/ctm_idf.mdl");
    
    
TeleportEntity(EntIndexclientOriginclientAnglesNULL_VECTOR);
    
DispatchSpawn(EntIndex);
    
    
cloneEnt[client] = EntIndex;
    
    
CreateTimer(0.1ProcessCloneclientTIMER_REPEAT);
}

public 
Action ProcessClone(Handle timerany client)
{
    if (!
IsClientInGame(client))
    {
        
RemoveClone(client); // remove the clone if client leaves..
        
return Plugin_Stop;
    }
    
    if (
cloneEnt[client] <= || !IsValidEntity(cloneEnt[client]) || !IsValidEdict(cloneEnt[client])
    {
        return 
Plugin_Stop// if clone doesn't exist..
    
}
    
    
int clientSequence GetEntProp(clientProp_Send"m_nSequence");
    
    
float currentOrigin[3], currentAngles[3];
    
    
GetEntPropVector(clientProp_Send"m_vecOrigin"currentOrigin);
    
GetClientEyeAngles(clientcurrentAngles[3];
    
    
SetEntProp(cloneEnt[client], Prop_Send"m_nSequence"clientSequence);
    
TeleportEntity(cloneEnt[client], currentOrigincurrentAngleNULL_VECTOR);
    
    return 
Plugin_Continue;
}

void RemoveClone(int client)
{
    if (
cloneEnt[client] <= || !IsValidEntity(cloneEnt[client]) || !IsValidEdict(cloneEnt[client])
    {
        return;
    }
    
    
AcceptEntityInput(cloneEnt[client], "Kill");
    
cloneEnt[client] = 0;

Ok well this works sort of. The model follows me around, but is not animated..
Bakuryu is offline
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 11:24.


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