Raised This Month: $32 Target: $400
 8% 

[CSGO] Setting animation on prop_physics_override


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Razmo51
Senior Member
Join Date: Aug 2011
Location: Event "player_death
Old 05-14-2015 , 18:35   [CSGO] Setting animation on prop_physics_override
Reply With Quote #1

Hello,


I'm trying to create an entity and throw it at his spawn, I had it working with a prop_physics_override, but now I want to animate it, si I used the 'SetAnimation' input, but it didn't work ...

I tried with the prop_dynamic_override and then the Animation worked, but I can't throw the prop anymore

Here's my code:


Code:

stock Throw(client)
{
    new Float:pos[3];
    GetClientAbsOrigin(client, pos);
    new entity = CreateEntityByName("prop_dynamic_override");
    // new entity = CreateEntityByName("prop_physics_override");
    if (IsValidEdict(entity))
    {
        SetEntityModel(entity, MODEL);
        SetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity", client);
        
        SDKHook(entity, SDKHook_Spawn, SDKHook_OnEntitySpawned);
        
        SetEntPropFloat(entity, Prop_Send, "m_flElasticity", 0.0);
        SetEntityGravity(entity, 0.01);
        
        DispatchSpawn(entity);
        
        new Float:angles[3] = {0.0, 0.0, 0.0};
        TeleportEntity(entity, pos, angles, NULL_VECTOR);
        
        // Works with prop_dynamic_override but not with prop_physics_override
        SetAnim(entity, "Fly01");

        return entity;
    }
    return -1;
}

SetAnim(ent, const String:anim[])
{
    SetVariantString(anim);
    AcceptEntityInput(ent, "SetAnimation");
}


public SDKHook_OnEntitySpawned(entity)
{
    CreateTimer(0.1, Throw, entity);
}

// Works with prop_physics_override, but not with prop_dynamic_override
public Action:Throw(Handle:Timer, any:ent)
{
    if(IsValidEdict(ent))
    {
        new client = GetEntPropEnt(ent, Prop_Send, "m_hOwnerEntity");

        if(IsPlayerAlive(client))
        {
        
            new Float:fPos[3], Float:fVec[3], Float:fFw[3], Float:fUp[3];
            GetClientEyeAngles(client, fVec);
            GetClientEyePosition(client, fPos);    
            
            fPos[0]+=fFw[0]*45.0;
            fPos[1]+=fFw[1]*45.0;
            fPos[2]+=fFw[2]*45.0;
            
            fPos[2] -= 30.0;
            
            GetAngleVectors(fVec, fFw, NULL_VECTOR, fUp);
            ScaleVector(fFw, 3000.0);
            AddVectors(fFw, fUp, fVec);
            
            TeleportEntity(ent, fPos, NULL_VECTOR, fVec);
        }
        else
        {
            AcceptEntityInput(ent, "Kill");
        }
    }
    return Plugin_Stop;
}
Could you please help me ? ;(


Thanks in advance.
__________________
Sorry for my bad English, I'm Belgian

Last edited by Razmo51; 05-14-2015 at 18:36.
Razmo51 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 05-15-2015 , 07:29   Re: [CSGO] Setting animation on prop_physics_override
Reply With Quote #2

SetAnimation is not an input on prop_physics_override
Source: https://developer.valvesoftware.com/...ysics_override
Mitchell is offline
Razmo51
Senior Member
Join Date: Aug 2011
Location: Event "player_death
Old 05-15-2015 , 11:16   Re: [CSGO] Setting animation on prop_physics_override
Reply With Quote #3

So any workaround?
A way to throw à prop dynamic override ?
__________________
Sorry for my bad English, I'm Belgian
Razmo51 is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 05-15-2015 , 16:59   Re: [CSGO] Setting animation on prop_physics_override
Reply With Quote #4

U can only animate I think prop_dynamic solid or not solid
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player
Michalplyoutube is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 05-22-2015 , 16:18   Re: [CSGO] Setting animation on prop_physics_override
Reply With Quote #5

create both dynamic and physics props, make the physics prop invisible and the dynamic prop non solid and parent it to the physics prop and align it.
blodia 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 05:46.


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