DCurrent / openbor

OpenBOR is the ultimate 2D side scrolling engine for beat em' ups, shooters, and more!
http://www.chronocrash.com
BSD 3-Clause "New" or "Revised" License
901 stars 121 forks source link

endanim / endtime #227

Closed dbaldan closed 7 months ago

dbaldan commented 3 years ago

Is your feature request related to a problem? Please describe. I'm always frustrated when I have to use script to handle a time-based change and I think it could be more user friendly.

Describe the solution you'd like We could have an animation header command, on the same way we have "followanim / followcond" (the concept is almost the same), but it would work as an easy way to use time based animation changes without using scripts.

endtime (int) The amount of time, in centiseconds, that the current animation should last. After that time is over, the entity would go to...

_endanim (animation_nameconstant) the desired animation, but instead of using only follow animations (like followanim), we could let it use any animation, using the openborconstant format.

Examples:

endtime 60
endanim ANI_JUMP

Describe alternatives you've considered I've tried using script for that and, while I managed it to work, it's a basic thing the engine could have a native solution. Sure, we need to think about if it would work like "changeentityproperty" or a "performattack" or even "take_action", in some cases.

Solutions for this: a) have an extra value, after the _animation_nameconstant which would tell if its a changeentity or performattack b) have the code decided it internally, based on the _animation_nameconstant name. • Is a common animation, like walk, jump, idle? -> take_action • Is a attack animation (attack or freespecial)? -> performattack • Is anything else? -> changeentityproperty

Additional context endtime would get the "elapsed_time" from the start of the current animation and use it as a timer.

DCurrent commented 7 months ago

I am looking into this as part of an enhanced follow/cancel command.