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

Entity animation bugged frames.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 12-16-2021 , 18:00   Entity animation bugged frames.
Reply With Quote #1

I am trying to spawn an entity and play its animation to the end right when it spawns. What happens is that upon spawning, the animations starts playing up to certain frames, resets to the first frame then continues after a few moments. This could be best shown with a video example: https://youtu.be/XiXJi3-640o. You can clearly see how it is bugged out.

PHP Code:
public CmdCorpse(iPlayer) {
    
    new 
iOrigin[3], Float:fOrigin[3];
    
get_user_origin(iPlayeriOrigin2);
    
    
IVecFVec(iOriginfOrigin);
    
    new 
entCorpse create_entity("info_target");
    
    if (!
entCorpse) {
        
        
log_amx("Could not create custom corpse entity.");
        return 
FMRES_IGNORED;
    }
    
    
entity_set_string(entCorpseEV_SZ_classname"custom_corpse");
    
    
entity_set_model(entCorpse"models/player/terror/terror.mdl");
    
    
entity_set_int(entCorpseEV_INT_solidSOLID_TRIGGER);
    
entity_set_int(entCorpseEV_INT_movetypeMOVETYPE_TOSS);
    
    
fOrigin[2] += 50.0;
    
entity_set_origin(entCorpsefOrigin);
    new 
Float:maxs[3] = {16.016.036.0};
    new 
Float:mins[3] = {-16.0, -16.0, -36.0};
    
entity_set_size(entCorpseminsmaxs);
    
    
entity_set_int(entCorpseEV_INT_sequence107);
    
entity_set_float(entCorpseEV_FL_frame1.0);
    
entity_set_float(entCorpseEV_FL_animtimeget_gametime());
    
entity_set_float(entCorpseEV_FL_framerate1.0);

    return 
FMRES_IGNORED;

This code is how I managed to spawn an entity and set its animation. Suggestions for better methods (that work, obviously) are open!

I don't know what animtime does actually, but setting it to 100.0 like seen in many threads related to animations delays the animation for a few seconds. Clueless.
redivcram is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-16-2021 , 18:44   Re: Entity animation bugged frames.
Reply With Quote #2

Monster_scientist_dead_(GoldSource_Engine)
These appear as hostages sitting on the ground on CS/CZ and can be spawned via Amxx. There are no bugged frames. Lots of potential.
__________________
DJEarthQuake is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 12-16-2021 , 19:43   Re: Entity animation bugged frames.
Reply With Quote #3

I'm getting an [ENGINE] Invalid entity 42 error. Specifically, here:
PHP Code:
entity_set_string(entCorpseEV_SZ_classname"brutalcs_corpse");
// And anywhere entCorpse is being used as a pointer to the entity within the engine funcs. 
My goal is spawning an entity and playing an animation to the end upon spawn. The corpse was an example. Did you mean that monster_scientist_dead is supposed to be used instead of info_target for the animations to properly work?

Last edited by redivcram; 12-16-2021 at 19:44.
redivcram is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 12-17-2021 , 06:56   Re: Entity animation bugged frames.
Reply With Quote #4

Quote:
Originally Posted by redivcram View Post

My goal is spawning an entity and playing an animation to the end upon spawn.
Isn't that what is actually happening?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 12-17-2021 , 08:01   Re: Entity animation bugged frames.
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
Isn't that what is actually happening?
Have you checked the video and even read the thread?
redivcram is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-17-2021 , 09:04   Re: Entity animation bugged frames.
Reply With Quote #6

Try setting pev_frame to 0.0, not 1.0
__________________
HamletEagle is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 12-17-2021 , 15:19   Re: Entity animation bugged frames.
Reply With Quote #7

Quote:
Originally Posted by redivcram View Post
Have you checked the video and even read the thread?
You want to remove the idle animation from death sequence?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 12-17-2021 at 15:20.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Old 12-17-2021, 15:30
redivcram
This message has been deleted by redivcram. Reason: double post
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 12-17-2021 , 15:38   Re: Entity animation bugged frames.
Reply With Quote #8

Quote:
Originally Posted by HamletEagle View Post
Try setting pev_frame to 0.0, not 1.0
No difference. Tried that one already.


Quote:
Originally Posted by Natsheh View Post
You want to remove the idle animation from death sequence?

Quote:
Originally Posted by redivcram View Post
I am trying to spawn an entity and play its animation to the end right when it spawns. What happens is that upon spawning, the animations starts playing up to certain frames, resets to the first frame then continues after a few moments. This could be best shown with a video example: https://youtu.be/XiXJi3-640o. You can clearly see how it is bugged out.

Quote:
Originally Posted by redivcram View Post
My goal is spawning an entity and playing an animation to the end upon spawn.
---------------------------------------------------------------------------

Summary: I am spawning an entity with set model (player/terror.mdl), sequence 107, normal framerate of value 1.0. The 107th sequence is the death animation. This animation is not set to loop like the idle animation for instance, which is why I chose that one particular. (To mimic a corpse, but my goal here is not getting a corpse exclusively, my goal is to successfully play the animation from start to end on my own custom entity). The problem is the "twitch" it does as seen in the video. I want to get rid of it and play the animation normally, from start to end and leave the model lying down.

Last edited by redivcram; 12-17-2021 at 15:39.
redivcram is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 12-18-2021 , 09:29   Re: Entity animation bugged frames.
Reply With Quote #9

Try reordering you entity creation code properly?

this might work?

PHP Code:
public CmdCorpse(iPlayer) {
    
    new 
iOrigin[3], Float:fOrigin[3];
    
get_user_origin(iPlayeriOrigin2);
    
    
IVecFVec(iOriginfOrigin);
    
    new 
entCorpse create_entity("info_target");
    
    if (!
entCorpse) {
        
        
log_amx("Could not create custom corpse entity.");
        return 
FMRES_IGNORED;
    }
    
    
entity_set_string(entCorpseEV_SZ_classname"custom_corpse");
    
    
entity_set_int(entCorpseEV_INT_solidSOLID_TRIGGER);
    
entity_set_int(entCorpseEV_INT_movetypeMOVETYPE_TOSS);
    
    
fOrigin[2] += 50.0;
    
entity_set_origin(entCorpsefOrigin);

    
entity_set_model(entCorpse"models/player/terror/terror.mdl");
    new 
Float:maxs[3] = {16.016.036.0};
    new 
Float:mins[3] = {-16.0, -16.0, -36.0};
    
entity_set_size(entCorpseminsmaxs);

    
entity_set_float(entCorpseEV_FL_frame1.0);
    
entity_set_float(entCorpseEV_FL_framerate1.0);
    
entity_set_int(entCorpseEV_INT_sequence107);
    
//entity_set_float(entCorpse, EV_FL_animtime, get_gametime()); maybe the anime time is glitching the thing?

    
return FMRES_IGNORED;

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 12-18-2021 at 09:31.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Reply


Thread Tools
Display Modes

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 00:40.


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