ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Animation Looping: Difference between revisions

From ModEnc
Jump to navigation Jump to search
Nighthawk200 (talk | contribs)
mNo edit summary
Crimsonum (talk | contribs)
Added projectile anim loop flags
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The animation looping control code is pretty confusing. The loop control allows to set start/end frames for the first iteration of the loop, and start/end frames for all other iterations together.
Here is the animation looping control flag descriptions. The loop control allows to set start/end frames for the first iteration of the loop and start/end frames for all other iterations in the loop.


* {{TTL|Start}} defines a ''0-based'' index of the first frame to play on the first iteration.
== Animations ==
* {{TTL|End}} defines the amount of frames to play on the first iteration.
* {{TTL|LoopStart}} defines a ''0-based'' index of the first frame for all following iterations.
* {{TTL|LoopEnd}} defines a '''''1'''-based'' index of the last frame for all but the first iterations. The first iteration will never play frames beyond this one, even if {{Tt|End}} is set to do so.
* {{TTL|LoopCount}} defines the total amount of iterations to play.


==== Example ====
The following apply to any [[animation]]:


If you imagine two animations with code like this: [[Image:Loop_control.png|thumb|250px|Looping control example schematics]]
* {{f|Start|link}} defines a ''0-based'' index of the first frame to play on the first iteration. Start is used for first iteration irrespective of the number of total iterations defined for this animation. Start defaults to 0 if not defined.
[ANIMA]
* {{f|End|link}} defines the number of frames to play for the first iteration. End is only used if the total number of iteration is 1, which happens when LoopCount is not defined or LoopCount=1. If the total number of iterations is more than 1, then End value is disregarded and instead LoopEnd is used. If End is not given or if it has a larger number than existing frames, the first iteration will end anyway with the last frame of the SHP (it could be the shadow frames as well unless Shadow=yes is set in RA2/YR making it to end with the last normal frame).
Start=1
* {{f|LoopStart|link}} defines a ''0-based'' index of the first frame for loop iterations.
End=9
* {{f|LoopEnd|link}} defines a '''''1'''-based'' index of the last frame when total number of iterations is more than one.
LoopStart=2
* {{f|LoopCount|link}} defines the total amount of iterations to play. Value 1 is for a single iteration where the Start and End values are used instead of LoopStart and LoopEnd. Value -1 is used for infinite loop.
LoopEnd=10
 
LoopCount=-1
== Projectiles ==
 
[{{Co|ANIMB|#00c}}]
Animated [[projectiles]] have their own set of flags which achieve the same effect as the loop flags above, albeit with somewhat less control.
Start=3
 
End=5
* {{f|AnimLow|link}} defines a ''0-based'' index of the first frame.
LoopStart=3
* {{f|AnimHigh|link}} defines a ''0-based'' index of the last frame.
LoopEnd=9
 
LoopCount=-1
The animation will loop indefinitely until the projectile expires in one way or another.


, then the scheme on the right depicts the frames that will be played for ANIMA (upper/black scheme) and ANIMB (lower/blue scheme). Upper scale shows 0-based indices, lower scale shows 1-based indices.
[[Category:General_Editing_Information]]
[[Category:General_Editing_Information]]

Latest revision as of 06:56, 30 April 2021

Here is the animation looping control flag descriptions. The loop control allows to set start/end frames for the first iteration of the loop and start/end frames for all other iterations in the loop.

Animations

The following apply to any animation:

  • Start defines a 0-based index of the first frame to play on the first iteration. Start is used for first iteration irrespective of the number of total iterations defined for this animation. Start defaults to 0 if not defined.
  • End defines the number of frames to play for the first iteration. End is only used if the total number of iteration is 1, which happens when LoopCount is not defined or LoopCount=1. If the total number of iterations is more than 1, then End value is disregarded and instead LoopEnd is used. If End is not given or if it has a larger number than existing frames, the first iteration will end anyway with the last frame of the SHP (it could be the shadow frames as well unless Shadow=yes is set in RA2/YR making it to end with the last normal frame).
  • LoopStart defines a 0-based index of the first frame for loop iterations.
  • LoopEnd defines a 1-based index of the last frame when total number of iterations is more than one.
  • LoopCount defines the total amount of iterations to play. Value 1 is for a single iteration where the Start and End values are used instead of LoopStart and LoopEnd. Value -1 is used for infinite loop.

Projectiles

Animated projectiles have their own set of flags which achieve the same effect as the loop flags above, albeit with somewhat less control.

  • AnimLow defines a 0-based index of the first frame.
  • AnimHigh defines a 0-based index of the last frame.

The animation will loop indefinitely until the projectile expires in one way or another.