YesNoOk
avatar

AnimElem (Triggers) (Read 2150 times)

Started by Just No Point, September 08, 2015, 10:10:51 pm
Share this topic:
AnimElem (Triggers)
New #1  September 08, 2015, 10:10:51 pm
  • ******
    • www.justnopoint.com/
Gets the animation-time elapsed since the start of a specified element of the current animation action. Useful for synchronizing events to elements of an animation action. (reminder: first element of an action is element 1, not 0)

AnimElemTime has similar functionality to AnimElem, but can take expressions as its argument.

Format:
AnimElem = value1
AnimElem = value1, [oper] value2
Arguments:
[oper]
=, !=, <, >, <=, >=
value1 (int)
Element number to check.
value2 (int)
Value of animation-time to compare with.
Return type:
boolean int (1 or 0)
Error conditions:
Returns bottom if the specified element number is invalid for this action (e.g., it's too large or too small).
Details:
Trigger in Format 1 is true if the player's animation is at the start of the element number specified by value1. In other words, if value1 is equal to n, it is true on the first game-tick of the nth element of the animation.

Trigger in Format 2 compares the player's animation-time to t+value2, where t is time of the start of the element number specified by value1.
Notes:
AnimElem will not trigger on the first game-tick of the second or later loop of an animation with a finite looptime. For example, "AnimElem = 1" will trigger the first tick a player changes to an animation, but will not trigger on the tick that it loops. You may get it to trigger each time using "AnimElem = 1 || AnimTime = 0".
Examples:
Code:
trigger1 = AnimElem = 2
  True on the first game-tick that the player's animation
  is on element 2. Is equivalent to saying:
    trigger1 = AnimElem = 2, = 0

trigger1 = AnimElem = 2, = 4
  True 4 game-ticks after the start of the player's
  second animation element.

trigger1 = AnimElem = 2, >= 0
trigger1 = AnimElem = 3, < 0
  True for the whole of the second element of the player's
  animation, assuming there is a third element. If a
  third element does not exist, the second line should
  read,

    trigger1 = AnimTime <= 0

AnimElem = the element / frame of the animation.
Last Edit: September 18, 2015, 02:57:51 pm by Just No Point
Re: AnimElem (Triggers)
New #2  September 09, 2015, 08:06:22 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Animelem is also mostly deprecated and you SHOULD be using AnimElemTime instead. It is functionally better, and a more understandable piece of code which fits within the rest of mugens rather shoddy standards.


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.
Last Edit: August 01, 2016, 07:47:05 am by Odb718