Difference between revisions of "Animation Code"
From FreeSpace Wiki
(Small details) |
m (Added category and minor fixes) |
||
Line 3: | Line 3: | ||
==Animation Class== | ==Animation Class== | ||
*Animation classes are defined in submodels description | *Animation classes are defined in submodels description | ||
− | *Syntax: $animation=''Class'' | + | *Syntax: '''$animation=''' ''Class'' |
*'''Triggered''' | *'''Triggered''' | ||
**Currently only supported animation class | **Currently only supported animation class | ||
Line 22: | Line 22: | ||
**'''"door"''' | **'''"door"''' | ||
***Animation code starts when something happens??? | ***Animation code starts when something happens??? | ||
− | *Syntax: $type=''Type'' | + | *Syntax: '''$type=''' ''Type'' |
===Animation Sub-Type=== | ===Animation Sub-Type=== | ||
*Optional more accurate descriptor for the animation type | *Optional more accurate descriptor for the animation type | ||
*For example used when defined primary bank is fired | *For example used when defined primary bank is fired | ||
− | *Syntax: +sub_type:''Value'', (0 = 1st weapon bank, 1 = 2nd weapon bank, etc.) | + | *Syntax: '''+sub_type:''' ''Value'', (0 = 1st weapon bank, 1 = 2nd weapon bank, etc.) |
===Animation Code=== | ===Animation Code=== | ||
Line 89: | Line 89: | ||
**As we want the barrels to align themselves at the beginning of the mission | **As we want the barrels to align themselves at the beginning of the mission | ||
*'''Animation Code''' | *'''Animation Code''' | ||
− | **+relative_angle: is good for this purpose | + | **'''+relative_angle:''' is good for this purpose |
− | **Notes | + | **Notes about angles: |
***First value is used to determine the turret's barrels deviation from the turrets normal. So barrel elevation in degrees is ( 90 - the first value ). | ***First value is used to determine the turret's barrels deviation from the turrets normal. So barrel elevation in degrees is ( 90 - the first value ). | ||
− | ***Second value is used to determine the turret facing. With ''0'' the turret facing is in the normal setting and with ''180'' turn the turret completely around. Do note that turrets on the underside of the model normally face | + | ***Second value is used to determine the turret facing. With ''0'' the turret facing is in the normal setting and with ''180'' turn the turret completely around. Do note that turrets on the underside of the model normally face backwards so to get these turrets pointing to forward directin the second value has to be set to 180. |
====Example==== | ====Example==== | ||
Line 100: | Line 100: | ||
$type="inital" | $type="inital" | ||
+relative_angle: 90,180,0 | +relative_angle: 90,180,0 | ||
+ | |||
+ | |||
+ | [[Category:Tables]] |
Revision as of 22:16, 13 November 2005
Known commonly as Bob's animation code as the code was written by Bobboau. Enables submodels defined in ships.tbl or in any related modular table to be animated in game. Animation code is included to the subsystem entry in similar manner as with multipart turrets
Contents
Animation Class
- Animation classes are defined in submodels description
- Syntax: $animation= Class
- Triggered
- Currently only supported animation class
Animation Type
- Animation type defines when the animation is used
- Currently supported animation types:
- "initial"
- Animation code is started when the mission begins
- "docking"
- Animation code is started when ship starts docking
- "docked"
- Animation code is started when ship is docked
- "primary bank"
- Animation code is started when a primary bank is fired
- "secondary bank"
- Animation code is started when a secondary bank is fired
- "door"
- Animation code starts when something happens???
- "initial"
- Syntax: $type= Type
Animation Sub-Type
- Optional more accurate descriptor for the animation type
- For example used when defined primary bank is fired
- Syntax: +sub_type: Value, (0 = 1st weapon bank, 1 = 2nd weapon bank, etc.)
Animation Code
If Animation Type Is Initial
- +delay:
- Defines how long til the trigger starts
- Syntax: Value, (seconds)
- +absolute_angle: OR +relative_angle:
- Defines the rotation degrees with three floats that give the x, y, and z. Absolute means in world terms; relative means relative to the ship. So a 90 degree angle on the ship would always be straight up in relative degrees; it would vary depending how the ship was rotated in absolute degrees.
- Syntax: Value,Value,Value
- +velocity:
- Defines subobject rotation speed, in relative terms. Defined with x, y and z floats.
- Syntax: Value,Value,Value
- +acceleration:
- Defeines acceleration speed of subobject rotation. Defined with three floats, x, y and z
- Syntax: Value,Value,Value
- +time:
- Defines time for object to rotate, move, whatever.
- Syntax: Value, (seconds)
If Animation Type Is Not Initial
- +delay:
- Defines how long til the trigger starts
- Syntax: Value, (seconds)
- +reverse delay:
- Syntax: Value, (seconds)
- +absolute angle: OR +relative angle:
- Defines the rotation degrees with three floats that give the x, y, and z. Absolute means in world terms; relative means relative to the ship. So a 90 degree angle on the ship would always be straight up in relative degrees; it would vary depending how the ship was rotated in absolute degrees.
- Syntax: Value,Value,Value, (degrees)
- +velocity:
- Defines subobject rotation speed, in relative terms. Defined with x, y and z floats.
- Syntax: Value,Value,Value, (meters)
- +acceleration:
- Defeines acceleration speed of subobject rotation. Defined with three floats, x, y and z
- Syntax: Value,Value,Value
- +time:
- Defines time for object to rotate, move, whatever.
- Syntax: Value, (seconds)
- $Sound:
- Defines sounds that are played with the animation
- +Start:
- Defines the sound that is played when animation starts
- Syntax: ????
- +Loop:
- Defines the sound that is played when animation is going on
- Syntax: ????
- +End:
- Defines the sound that is played when animation stops
- Syntax: ????
- +Radius:
- Defines the distance from the submodel where the sound is audible
- Syntax: Value, (meters)
Animation Examples
Setting Turret Angle
- Animation code can be used to set multipart turrets barrel angle at the beginning of the mission
- Animation Class = triggered
- The only one available
- Animation Type = initial
- As we want the barrels to align themselves at the beginning of the mission
- Animation Code
- +relative_angle: is good for this purpose
- Notes about angles:
- First value is used to determine the turret's barrels deviation from the turrets normal. So barrel elevation in degrees is ( 90 - the first value ).
- Second value is used to determine the turret facing. With 0 the turret facing is in the normal setting and with 180 turn the turret completely around. Do note that turrets on the underside of the model normally face backwards so to get these turrets pointing to forward directin the second value has to be set to 180.
Example
$Subsystem: turret02,0.833,1.0 $Default PBanks: ( "Terran Turret" ) $animation=triggered $type="inital" +relative_angle: 90,180,0