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

[CS:GO] Animating a player model entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bakuryu
Member
Join Date: Dec 2011
Old 09-25-2016 , 19:26   [CS:GO] Animating a player model entity
Reply With Quote #1

I was able to spawn a player model as an prop_dynamic, but I cannot get it to animated using

Code:
    SetVariantString("testWalkN");
    AcceptEntityInput(EntIndex , "SetAnimation", -1, -1, 0);
Here is the full script (minus the on start)

Code:
public Action OnRoundStart(Event event, const char[] name, bool dontBroadcast)
{
    char model[128];
    GetClientModel(1, model, 128);
    
    int EntIndex = CreateEntityByName("prop_dynamic");
    SetEntityModel(EntIndex,model);
    DispatchSpawn(EntIndex);
    SetVariantString("testWalkN");
    AcceptEntityInput(EntIndex , "SetAnimation", -1, -1, 0); 
    
    float hOrigin[3];
    GetClientAbsOrigin(1, hOrigin);
    TeleportEntity(EntIndex, hOrigin, NULL_VECTOR, NULL_VECTOR);  
    PrintToChatAll(model);
}
The model shows up, but it doesn't move. If I use ent_fire on it in game it also doesn't work, although if I set it to ragdoll it does lay flat instead of being in the default position.
Bakuryu is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 09-25-2016 , 22:01   Re: [CS:GO] Animating a player model entity
Reply With Quote #2

https://forums.alliedmods.net/showpo...1&postcount=12

try it
__________________
8guawong is offline
Bakuryu
Member
Join Date: Dec 2011
Old 09-26-2016 , 22:38   Re: [CS:GO] Animating a player model entity
Reply With Quote #3

Quote:
Originally Posted by 8guawong View Post
Unfortunately it didn't work.
Bakuryu is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 09-26-2016 , 23:54   Re: [CS:GO] Animating a player model entity
Reply With Quote #4

https://forums.alliedmods.net/showpo...7&postcount=16
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Bakuryu
Member
Join Date: Dec 2011
Old 09-29-2016 , 11:41   Re: [CS:GO] Animating a player model entity
Reply With Quote #5

Quote:
Originally Posted by friagram View Post
Didn't work either, tried before and after dispatch.
Bakuryu is offline
Bakuryu
Member
Join Date: Dec 2011
Old 10-02-2016 , 17:28   Re: [CS:GO] Animating a player model entity
Reply With Quote #6

OK so an update, I got it to work finally. The thing I am still having an issue with is that the animation I want is technically a combination of sequences (two to be specific). Is there a way to have more than one sequence on a model entity?
Bakuryu is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 10-02-2016 , 22:18   Re: [CS:GO] Animating a player model entity
Reply With Quote #7

Quote:
Originally Posted by Bakuryu View Post
OK so an update, I got it to work finally. The thing I am still having an issue with is that the animation I want is technically a combination of sequences (two to be specific). Is there a way to have more than one sequence on a model entity?
mind sharing how you did it?
__________________
8guawong is offline
Bakuryu
Member
Join Date: Dec 2011
Old 10-04-2016 , 12:26   Re: [CS:GO] Animating a player model entity
Reply With Quote #8

Quote:
Originally Posted by 8guawong View Post
mind sharing how you did it?
Here is the code that worked for me. Mind you like I said it will only do one animation and not a combination of them.

Code:
    int EntIndex = CreateEntityByName("prop_dynamic_override");
    DispatchKeyValue(EntIndex, "model", "models/player/custom_player/legacy/ctm_idf.mdl");
    ActivateEntity(EntIndex);
    DispatchSpawn(EntIndex);
    SetVariantString("move_knife_r");
    AcceptEntityInput(EntIndex, "SetAnimation");
    AcceptEntityInput(EntIndex, "Enable");
Anyone know if its possible do add more than one sequence?
Bakuryu is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 10-04-2016 , 12:33   Re: [CS:GO] Animating a player model entity
Reply With Quote #9

Quote:
Originally Posted by Bakuryu View Post
Here is the code that worked for me. Mind you like I said it will only do one animation and not a combination of them.

Code:
    int EntIndex = CreateEntityByName("prop_dynamic_override");
    DispatchKeyValue(EntIndex, "model", "models/player/custom_player/legacy/ctm_idf.mdl");
    ActivateEntity(EntIndex);
    DispatchSpawn(EntIndex);
    SetVariantString("move_knife_r");
    AcceptEntityInput(EntIndex, "SetAnimation");
    AcceptEntityInput(EntIndex, "Enable");
Anyone know if its possible do add more than one sequence?
isn't that the solution i gave you which you said didn't work?

https://forums.alliedmods.net/showpo...56&postcount=3

back to the topic.... you can use different animation ongameframe i guess or a timer to change its animation?
__________________

Last edited by 8guawong; 10-04-2016 at 12:34.
8guawong is offline
Bakuryu
Member
Join Date: Dec 2011
Old 10-21-2016 , 15:39   Re: [CS:GO] Animating a player model entity
Reply With Quote #10

Quote:
Originally Posted by 8guawong View Post
isn't that the solution i gave you which you said didn't work?

https://forums.alliedmods.net/showpo...56&postcount=3

back to the topic.... you can use different animation ongameframe i guess or a timer to change its animation?
My code activates the entity before its dispatched. Not sure why that made a difference but it did.

Second how do I use more than one animation on the prop? They have to be simultaneous because that is how the animations for the models work apparently. So I need a combination of "move_knife_r" and move_knife_aim_run which creates a running knife animation, why there isn't just a running knife animation I am not sure.
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 20:15.


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