Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP/DBC] Speedy animation function (monster, animation, play/playing)

Author
Message
Aralox
17
Years of Service
User Offline
Joined: 16th Jan 2007
Location: Melbourne
Posted: 28th Sep 2007 05:12 Edited at: 28th Sep 2007 05:13
This time saving function will loop a certain animation ( currently idle,die,hit,move,attack ) for any monster, and can also check if the animation is already playing, or check which animation is playing.

The animation rule it follows is idle, die, hit, move, attack. (ie the monsters are appended in that order)



How to use it

-ani(monster, animation, play/playing)

-to loop animation, ani(1,idle,play) < will loop the monster's idle animation

-to check if a certain animation is playing, ani(1,die,playing) < will return 1 if playing and 0 if playing.

- to find out what animation is playing, ani(1,0,playing) < will return what animation is playing

Notes
I have discovered that the DarkMatter models' (which i use for this example) movement animation does not loop properly because of an extra 5 frames at the beginning of the animation. if you look down through the ani() function, you will see that i have +5 to the looping of the movement animation.
As you can see, the function is very specified by my mon(monster).types monster system.
Feel free to change this if it does not suit you.

Give me a holler in the credits if you found this function useful!

Login to post a reply

Server time is: 2024-11-22 18:47:56
Your offset time is: 2024-11-22 18:47:56