Difference between revisions of "SetAnimFrames (CMS)"
From The Official Visionaire Studio: Adventure Game Engine Wiki
m (Text replacement - "wikitable" to "ts") |
|||
Line 1: | Line 1: | ||
− | {| class=" | + | {| class="ts" style="width:100%" |
|- | |- | ||
! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left" | By | ! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left" | By | ||
Line 25: | Line 25: | ||
== Syntax Breakdown == | == Syntax Breakdown == | ||
− | {| class=" | + | {| class="ts" style="width:100%" |
|- | |- | ||
! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left;width:70%" | Description | ! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left;width:70%" | Description |
Revision as of 18:21, 19 August 2014
Name | Type | By |
---|---|---|
setAnimFrames("ani", n1, n2) | Definition | AFRLme |
This small function allows you to quickly set the first & last frame of an active animation.
Instructions
1. Add the main script to the Visionaire Studio Script Editor & set the script as a definition script.
2. To use this function you should create an execute a script action containing...
setAnimFrames("animation_name", 1, 1) -- set active animation animation_name's first frame to 1 & last frame to 1
Main Script
function setAnimFrames(ani, n1, n2)
getObject("ActiveAnimations[" .. ani .. "]"):setValue(VAnimationFirstFrame, n1)
getObject("ActiveAnimations[" .. ani .. "]"):setValue(VAnimationLastFrame, n2)
end
Syntax Breakdown
Name | Type | Description |
---|---|---|
ani | "string" | This should be a "string" value containing the name of the animation you want to affect. |
n1 | integer | This should be an integer (number) value which will determine which frame will be the initial (from) frame of the linked animation (ani). |
n2 | integer | This should be an integer (number) value which will determine which frame will be the final (to) frame of the linked animation (ani). |