ResetAnimFrames (CMS)

From The Official Visionaire Studio: Adventure Game Engine Wiki
Revision as of 20:19, 21 August 2022 by AFRLme (talk | contribs) (Created page with "{| class="ts" style="width:100%" |- ! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left" | By |- | resetAnimFrames("anim") || Definiti...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Name Type By
resetAnimFrames("anim") Definition AFRLme

This small function allows you to quickly reset the frame range of an animation back to default animation frame range.


Instructions

1. Add the main script to the Visionaire Studio Script Editor & set the script as a definition script.
2. Example: reset animation frame range back to the default animation frame range.

resetAnimFrames("example")


Main Script

function resetFrames(anim)
  ActiveAnimations[anim].FirstFrame = 1 -- update from animation frame range
  ActiveAnimations[anim].LastFrame = #Animations[anim].Sprites -- update to animation frame range
end


Syntax Breakdown

Name Type Description
anim "string" This should be a "string" value containing the name of the animation you want to reset the animation frame range of back to the default range.