YesNoOk
avatar

Anim VS AnimElem VS AnimElemNo VS AnimElemTime VS AnimTime (Read 8143 times)

Started by Odb718, September 11, 2015, 09:29:34 am
Share this topic:
Anim VS AnimElem VS AnimElemNo VS AnimElemTime VS AnimTime
New #1  September 11, 2015, 09:29:34 am
  • *****
  • Shame on you!
    • USA
This thread is to help shine a light on when and why to use:
Anim VS AnimElem VS AnimElemNo VS AnimElemTime
Basically think of it as dissecting the animation down further and further.

Anim returns what number in the air file the Animation is actually playing. It's pretty basic. Are you showing the animation I want? Yes or No?

AnimElem looks a little deeper into that animation and says what sprite is displaying. Are you at that special pose/position I want the explod at??

AnimElemNo and AnimElemTime work sort of the same, but kinda opposite from each other.
ElemNo and ElemTime both need the (x) = y at the end of them. But they use them almost backwards from eachother.
AnimElemNo is comparing your time to the Number of the frame displayed.
AnimElemTime knows what frame is displayed and is waiting for the actual tic, or split second, to activate something.

So here's the tricky part Animelem = 2, AnimElemNo(0) = 2, and AnimElemTime(2) = 0 are almost exactly the same thing. The three will activate all at the same tic. Why have so many options??
Well, lets say we're using Anim 191 and it's an intro. It's 340 tics long, and Frame 2, the one we activated 3x above, is 70 tics long. During our character's pose we want a couple effects going. One should be the ground is kicking up dust. We could use Animelem=2 because we have our dust animated for all 70 tics.
And we have a helper we've made that flies out and moves around our character. But it takes 5 tics to get to it's location. AnimElemNo(5) = 2 would be perfect to activate it. The 5 is for the 5 tics and the two is the frame we're after. (Note: Frame 1 of the animation would have to be over 5 tics)
AnimElemTime(2) = 35 would be perfect to use to set something to activate half way through Frame 2.

Anim is the basic, "Is it showing?"
AnimElem is "Ok, Is it the perfect sprite I need?"
AnimElemNo is looking forward, or counting down to the frame we want
AnimElemTime is, we're in the pose, but we want EXACT timing!

AnimTime Is most often used 1 way; Ending the Statedef. As a trigger for changestate or destroyself. You'll see it at the end of the states 99% of the time. But it can be pretty useful in certain situations. Like say you're doing that power charge intro and it loops. Well if you used the four above it'd activate each time it looped. If you only want that helper or explod to activate 1 time, you'd need to use AnimTime. (And probably one of Elem, ElemNo, or ElemTime). Otherwise you'd have to make a duplicate animation, switch to that animation and use Anim != 191 and on and on with a million other things, when all you needed was AnimTime. What trips up most people is it counts backwards. The very last tic is 0, the tic before that is -1, and the first tic of the first replay is 1. 

If you still dont get the differences, feel free to post questions in here.
vVv N00bSaibot & Muramasa RoofTop vVv
Last Edit: September 22, 2015, 12:18:12 pm by Odb718
Re: Anim VS AnimElem VS AnimElemNo VS AnimElemTime VS AnimTime
#2  September 12, 2015, 02:15:35 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Umm, your example is a bit dishy.

Animelem = 2 is true for a single tick, right at the start of frame 2. So unless your explod is timed FOR animelem 2, it will not respawn once finished or keep spawning over and over or do anything. It will spawn once, and that's pretty much it.

Animelem and animelemtime can be used in the exact same way. Your 2 examples can work for both

animelem = 2, = 35 is the same as saying animelemtime(2) = 35 And animelem = 2 is the same as animelemtime(2)  = 0

Animtime is frequently used during the change of animation during states as well.

trigger1 = anim = 200 && animtime = 0
Confirm current anim is complete before changing to another one.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Anim VS AnimElem VS AnimElemNo VS AnimElemTime VS AnimTime
New #3  September 13, 2015, 01:22:55 am
  • ******
  • [E]
    • Mexico
there is no reason to use animelem at all, use one of the other two; while we know that deprecated stuff in mugen is very unlikely to break on updates, it's still possible in any update for it just to get abandoned, and in reality it'sa  relic from the times when mugen was so broken/incomplete that it did not support any kind of arithmetical expression so that weird trigger got created instead.


Last Edit: September 14, 2015, 05:55:13 am by Bastard Mami