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
Fixing this crap.
E1 Elite (talk | contribs)
Corrected. The example was wrong on the usage of End, so the example section is removed.
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.


* {{f|Start|link}} defines a ''0-based'' index of the first frame to play on the first iteration.
* {{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.
* {{f|End|link}} defines the ''0-based'' index of the last frame to play on the first iteration.
* {{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).
* {{f|LoopStart|link}} defines a ''0-based'' index of the first frame for all following iterations.
* {{f|LoopStart|link}} defines a ''0-based'' index of the first frame for loop iterations.
* {{f|LoopEnd|link}} 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.
* {{f|LoopEnd|link}} defines a '''''1'''-based'' index of the last frame when total number of iterations is more than one.
* {{f|LoopCount|link}} defines the total amount of iterations to play.
* {{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.


==== Example ====
If you imagine two animations with code like this: [[Image:Loop_control.png|thumb|250px|Looping control example schematics]]
[ANIMA]
Start=1
End=9
LoopStart=2
LoopEnd=10
LoopCount=-1
[{{Co|ANIMB|#00c}}]
Start=3
End=7
LoopStart=3
LoopEnd=9
LoopCount=-1
, 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]]

Revision as of 13:07, 8 March 2019

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.

  • 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.