Animation freeze bug related to seta?

Hi All,

This is something I've encountered in several different settings, but it manifests the same way. As an example, I have a flying enemy that spawns on the ground and has a spawn animation whereby it rises into the air and then should proceed normally at set 40. Here's an example.

anim Spawn
@script
void vSelf = getlocalvar("self");
if(frame==9){
int iTime = openborvariant("elapsed_time");
changeentityproperty(vSelf, "velocity", 0, 0 , 0); // This is to stop entity from moving forward
changeentityproperty(vSelf, "tosstime", iTime + 150);
}
@end_script
@script
void vSelf = getlocalvar("self");
if(frame==10){
performattack(vSelf, openborconstant("ANI_Attack3"));
}
@end_script
loop 0
delay 14
offset 47 91
bbox 38 41 16 52
@cmd degravity 1
@cmd dasher 0 0.4 0
frame data/chars/test/up_1.gif
frame data/chars/test/up_2.gif
frame data/chars/test/up_3.gif
frame data/chars/test/up_4.gif
frame data/chars/test/up_4.gif
frame data/chars/test/up_4.gif
frame data/chars/test/up_4.gif
frame data/chars/test/up_3.gif
frame data/chars/test/up_2.gif
frame data/chars/test/up_1.gif
@cmd dasher 0 0 0
frame data/chars/test/up_1.gif
@cmd degravity 0
@cmd dasher 0 0 0
seta 40

In this case, I have used both the "tosstime" and a "force attack animation" switch to try and remedy this, but the character reaches the end of this animation, and then just freezes on the last frame, or on the last frame of the forced attack (if I include it). Any idea why this is?
 
Hi All,

This is something I've encountered in several different settings, but it manifests the same way. As an example, I have a flying enemy that spawns on the ground and has a spawn animation whereby it rises into the air and then should proceed normally at set 40. Here's an example.
...

@wrenchman82,

Please put your text and code into code tags, otherwise they're very difficult to read and interpret. See SS:

1663039313814.png

You can even use [ code=c ] (no spaces) to get syntax highlighting.

Anyway, about your question, there's a ton of custom functions you've got running there, so honestly it's too many moving parts to tell at first glance. That dasher function was made by @Bloodbane IIRC, so he would have better insight to it.

I can tell you tosstime will hold an entity in the air until something else overrides it or it runs out, so you might want to try a slightly shorter time. Otherwise I would just walk backward, removing scripts and complexities one at a time until the bug is gone, then that's your horse. Maybe take a video of it and post that too? TBH, I'm having a derp moment and am not even 100% sure if I understand the problem from your description.

DC
 
Actually, I just solved it after some tinkering. Turns out there's an interaction I don't quite understand between setting dasher 0 0 0, which should stop the enemy, and the tosstime script above that causes things to freeze. I don't have an explanation, code wise. Commenting out the last 4 lines before seta 40 appears to fix it. Weird. Sorry to waste your time, DC.
 
Any idea why this is?

Aside of what DC posted, you should give number to frames to know number of frame.

Commenting out the last 4 lines before seta 40 appears to fix it. Weird

That's why I posted the above. The cause of the issue is simply because your enemy changes animation to ATTACK3 before its antigravity is resetted. So it's suspended in mid air and its AI doesn't allow moving when it's not touching the ground or altitude defined by seta.
 
Back
Top Bottom