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

[solved] make env_sprite entity able to have velocity or info_target animable


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 02-25-2016 , 07:20   [solved] make env_sprite entity able to have velocity or info_target animable
Reply With Quote #1

hi all.

i'm trying to make an entity with a sprite model play its animation and be able to have velocity at the same time, but i have a problem.

if i create an info_target entity, i can set its velocity but the sprite won't animate.
if i create an env_sprite entity, it animates but it won't receive any velocity.

can i do this without manually registering a think and setting the frame, or is it the only option?

code:
Code:
            static iAllocStringEnvSprite;                         if (!iAllocStringEnvSprite)                 iAllocStringEnvSprite = engfunc(EngFunc_AllocString, "info_target");//env_sprite                         new Float:fCvarFireFieldRadius = get_pcvar_float(g_pCvarFire_field_radius);                         new iEntID2;                         for (new iID = 0; iID < get_pcvar_num(g_pCvarFire_field_flames); iID++)             {                 iEntID2 = engfunc(EngFunc_CreateNamedEntity, iAllocStringEnvSprite);                                 if (!pev_valid(iEntID2))                     continue;                                 set_pev(iEntID2, pev_classname, g_szClassNameFireFieldFlame)                 set_pev(iEntID2, pev_owner, iEntID)                 set_pev(iEntID2, pev_solid, SOLID_NOT)                 set_pev(iEntID2, pev_flags, FL_ALWAYSTHINK)                                 ftEntSetSprite(iEntID2, g_iArrayID_SPMF, random_num(0, g_iArraySize_SPMF))                         //    set_pev(iEntID2, pev_scale, random_float(0.357, 0.577))                 set_pev(iEntID2, pev_rendermode, kRenderTransAdd)         //    set_pev(iEntID2, pev_rendercolor, Float:{ 255.0, 255.0, 255.0 })         //    set_pev(iEntID2, pev_renderfx, kRenderFxNone)                 set_pev(iEntID2, pev_renderamt, 255.0)                 set_pev(iEntID2, pev_sequence, 0)                 set_pev(iEntID2, pev_gaitsequence, 0)                 set_pev(iEntID2, pev_frame, 0.0)                 set_pev(iEntID2, pev_animtime, get_gametime())                 set_pev(iEntID2, pev_framerate, 1.0)//random_float(10.0, 15.0)                                 if (!iID)                 {                     fVecTemp[0] = 0.0;                     fVecTemp[1] = 0.0;                 }                 else                 {                     fVecTemp[0] = random_float(-fCvarFireFieldRadius, fCvarFireFieldRadius); //g_fFireFieldRadiusVisual 0.0, random_num(0, 1) ? fCvarFireFieldRadius : -fCvarFireFieldRadius                     fVecTemp[1] = random_float(-fCvarFireFieldRadius, fCvarFireFieldRadius);                 }                                 fVecTemp[2] = 25.0; //0.0; //5.0                                 // save our fire sprite position                 set_pev(iEntID2, pev_punchangle, fVecTemp)                                 fVecTemp[0] += fVecOrigin[0];                 fVecTemp[1] += fVecOrigin[1];                 fVecTemp[2] += fVecOrigin[2];                                 set_pev(iEntID2, pev_origin, fVecTemp)                                 set_pev(iEntID2, pev_movetype, MOVETYPE_NOCLIP)                                 fVecTemp[0] = 0.0;                 fVecTemp[1] = 0.0;                 fVecTemp[2] = random_float(150.0, 200.0);                                 set_pev(iEntID2, pev_velocity, fVecTemp)                                 set_pev(iEntID2, pev_spawnflags, SF_SPRITE_STARTON)                 //set_pev(iEntID2, pev_, )                                 dllfunc(DLLFunc_Spawn, iEntID2)             }

EDIT: solved. movetype change needs to be after the spawn function.
__________________

Last edited by georgik57; 02-25-2016 at 11:41.
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
LiZou Mapper
Member
Join Date: Oct 2018
Location: Morocco
Old 10-01-2021 , 11:20   Re: [solved] make env_sprite entity able to have velocity or info_target animable
Reply With Quote #2

I was having this problem with NPC Plugin, thank you!
__________________

-------------
My Maps !
Zombie Escape Mod !
-------------

LiZou Mapper is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 10-01-2021 , 13:30   Re: [solved] make env_sprite entity able to have velocity or info_target animable
Reply With Quote #3

have you try to set nextthink to it?
also [Solved] mean you already done and doesn't need help anymore btw
__________________
My plugin:

Last edited by Celena Luna; 10-01-2021 at 13:31.
Celena Luna 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 09:00.


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