Difference between revisions of "Animation.tbl"
(Add absolute translation) |
(Document "seamless with startup") |
||
Line 78: | Line 78: | ||
==="pause on reverse"=== | ==="pause on reverse"=== | ||
*The animation will pause instead of starting in reverse when triggered to play in reverse. This is ''only ever'' useful when using a looping animation with some sort of engine-trigger, like "afterburner" | *The animation will pause instead of starting in reverse when triggered to play in reverse. This is ''only ever'' useful when using a looping animation with some sort of engine-trigger, like "afterburner" | ||
+ | {{Table224| | ||
+ | ==="seamless with startup x"=== | ||
+ | *A flag for any animation that is a seamless animation which has a startup prepended. Replace x with the time from which the animation needs to be looped to be seamless. If the animation is started forwards, it'll play the startup animation, and from then on will repeat from the specified time, playing the animation seamlessly. If reversed, it will play until the point where the seamless animation starts and then repeat back to the animations end. When stop-looping-animation is used, the animation will play until the next time it reaches the point where the seamless part starts, and will then play the startup part in reverse to then stop in its initial state. | ||
+ | }} | ||
==Segment== | ==Segment== |
Revision as of 07:13, 26 September 2022
This feature requires FreeSpace Open |
List of Tables and related code files | |
---|---|
* Notes Modular Tables | |
** Notes tables which only use modular tables | |
Ai.tbl* | /ai/aicode.cpp |
Ai_profiles.tbl* | /ai/ai_profiles.cpp |
Animation.tbl** | /model/modelanimation.cpp |
Armor.tbl* | /ship/ship.cpp |
Asteroid.tbl* | /asteroid/asteroid.cpp |
Autopilot.tbl* | /autopilot/autopilot.cpp |
Cheats.tbl* | /cheats_table/cheats_table.cpp |
Colors.tbl* | /globalincs/alphacolors.cpp |
Curves.tbl* | /math/curves.cpp |
Controlconfigdefaults.tbl | /controlconfig/controlsconfigcommon.cpp |
Credits.tbl* | /menuui/credits.cpp |
Cutscenes.tbl* | /cutscene/cutscenes.cpp |
Decals.tbl** | /decals/decals.cpp |
Fireball.tbl* | /fireball/fireballs.cpp |
Fonts.tbl* | /graphics/font.cpp |
Game_settings.tbl* | /mod_table/mod_table.cpp |
Glowpoints.tbl* | /model/modelread.cpp |
Help.tbl* | /gamehelp/contexthelp.cpp |
Hud_gauges.tbl* | /hud/hudparse.cpp |
Icons.tbl* | /mission/missionbriefcommon.cpp |
Iff_defs.tbl* | /iff_defs/iff_defs.cpp |
Keywords.tbl* | Not In Codebase |
Lighting_Profiles.tbl* | /lighting/lighting_profiles.cpp |
Lightning.tbl* | /nebula/neblightning.cpp |
Mainhall.tbl* | /menuui/mainhallmenu.cpp |
Medals.tbl* | /stats/medals.cpp |
Messages.tbl* | /mission/missionmessage.cpp |
Mflash.tbl* | /weapon/muzzleflash.cpp |
Music.tbl* | /gamesnd/eventmusic.cpp |
Nebula.tbl* | /nebula/neb.cpp |
Objecttypes.tbl* | /ship/ship.cpp |
Options.tbl* | Not In Codebase |
Particle effects(-part.tbm)** | /particle/effects... |
Post_processing.tbl | /graphics/gropenglpostprocessing.cpp |
Rank.tbl* | /stats/scoring.cpp |
Scpui.tbl* | Not In Codebase |
Scripting.tbl* | /parse/scripting.cpp |
Ships.tbl* | /ship/ship.cpp |
Sexps.tbl** | /parse/sexp/sexp_lookup.cpp |
Sounds.tbl* | /gamesnd/gamesnd.cpp |
Species_defs.tbl* | /species_defs/species_defs.cpp |
Species.tbl* | /menuui/techmenu.cpp |
Ssm.tbl* | /hud/hudartillery.cpp |
Stars.tbl* | /starfield/starfield.cpp |
Strings.tbl* | /localization/localize.cpp |
Tips.tbl* | /menuui/playermenu.cpp |
Traitor.tbl* | /stats/scoring.cpp |
Tstrings.tbl* | /localization/localize.cpp |
Virtual_pofs.tbl* | /model/modelreplace.cpp |
Weapon_expl.tbl* | /weapon/weapons.cpp |
Weapons.tbl* | /weapon/weapons.cpp |
The new table format to specify subobject animations for models. Animations in this form are only added in modular table files which end with -anim.tbm.
Contents
- 1 #Animations
- 2 #Moveables
- 3 Example
#Animations
Animations defined here are a pre-defined sequence of movement and actions, that you can then trigger to play/reverse during a mission.
$Name:
- The name used to identify the animation when adding it to a model. Must be unique.
$Type:
- The type of trigger that will start this animation
- initial
- Animation is started (and completed) when the mission begins.
- on-spawn
- Animation is started once the ship or modelled weapon spawns.
- docking-stage-1
- Animation code is started when the ship follows the docking path.
- docking-stage-2
- Animation code is started when the ship moves to the second to last point in the docking path.
- docking-stage-3
- Animation code is started when the ship is moving onto the dockpoint itself.
- docked
- Animation code is started once the ship is docked.
- primary-bank
- Animation code is started when a primary bank is selected (armed).
- primary-fired
- Animation code is started when a primary bank has fired (Useful for recoil or similar things). Needs an auto-resetting flag (see below)
- secondary-bank
- Animation code is started when a secondary bank is selected (armed).
- secondary-fired
- Animation code is started when a secondary bank has fired (Useful for recoil or similar things). Needs an auto-resetting flag (see below)
- fighterbay
- Animation code starts when ship launches from or receives others through its fighterbay.
- afterburner
- Animation code is started when ships afterburner is engaged.
- turret-firing
- Animation code is started while a turret is firing. Gets triggered once a turret starts firing and ends once it has no more targets to shoot.
- turret-fired
- Animation code is started whenever a turret has fired (Useful for recoil or similar things). Triggers on each shot. Needs an auto-resetting flag (see below)
- scripted
- Animation code is started when it is triggered with scripts or SEXPs (see scripting.tbl)
- initial
+Triggered By:
- Optional more accurate specification of when the animation triggers. Form and value depends on the trigger type. No +Triggered By: usually means "in every applicable case".
- initial, on-spawn, afterburner
- No further specification is possible, +Triggered By: must not be specified
- docking-stage-1, docking-stage-2, docking-stage-3, docked
- The docking port number or name on the ship
- primary-bank, primary-fired, secondary-bank, secondary-fired
- The number of the weapon bank
- fighterbay
- The number or name of the fighterbay path to open. Can be prefixed with a NOT to trigger when any fighterbay path except for the specified is used.
- turret-firing, turret-fired
- The name of the turret subsystem that has fired
- scripted
- An arbitrary, user-defined name to specify in a triggering SEXP or Lua method
- initial, on-spawn, afterburner
$Flags:
- Syntax: ( "String" "String" ), names of the flags assigned to the ship
- Some flags are so-called "Auto-resetting" flags. These will cause an animation to not stay in their completed state, but in their untriggered state. This can happen by automatically reversing the animation, resetting it once it is complete, or else, depending on the flag used.
"auto reverse"
- Once the animation completes, automatically reverse it with no explicit trigger to do so
- Is an auto-resetting flag
"reset at completion"
- Once the animation ends, reset its state to the start of the animation. Only useful if the animation ends in the same position as it starts in.
- Is an auto-resetting flag
"loop"
- The animation will automatically reverse when complete, and then restart itself once it's back in it's original position, repeating infinitely
- If used together with the "reset at completion" flag, it will instantly snap back to the start and resume playing instead of reversing the animation at completion.
"random starting phase"
- The animation will start at a random point of its duration instead of at the beginning. Useful if you trigger multiple looping animations at once, but don't want the animations to synchronize to each other
"pause on reverse"
- The animation will pause instead of starting in reverse when triggered to play in reverse. This is only ever useful when using a looping animation with some sort of engine-trigger, like "afterburner"
"seamless with startup x"
- A flag for any animation that is a seamless animation which has a startup prepended. Replace x with the time from which the animation needs to be looped to be seamless. If the animation is started forwards, it'll play the startup animation, and from then on will repeat from the specified time, playing the animation seamlessly. If reversed, it will play until the point where the seamless animation starts and then repeat back to the animations end. When stop-looping-animation is used, the animation will play until the next time it reaches the point where the seamless part starts, and will then play the startup part in reverse to then stop in its initial state.
Segment
- Here, the actual animation is specified. The segment that is defined here, needs to be one of the following:
$Set Orientation:
- This segment instantly sets the orientation of a submodel. Especially useful for initial-type animations.
+Angle:
- Sets the angle this submodel should be at.
- Syntax: Vector, three floats, x, y, z respectively, in degrees (equal to pitch, heading, bank)
+Absolute
- Optional: If set, this angle is the target angle of this subobject. If not set, this angle is what the submodel is rotated by from its current orientation.
+Submodel:
- The name of the submodel this segment applies to.
- If the target submodel is part of a multipart turret, use +Turret Base: or +Turret Arm: respectively instead of +Submodel:, followed by the subsystem name of the turret.
- Note that multipart turrets may only be rotated along their axis. Any other rotation or translation is possible (for cutscenes, for example), but will cause undefined behaviour once the turret starts aiming on its own again. Use carefully.
- If the target submodel is part of a multipart turret, use +Turret Base: or +Turret Arm: respectively instead of +Submodel:, followed by the subsystem name of the turret.
$Set Angle:
- This segment instantly rotates a submodel on its rotation axis. Useful for initial-type animations, especially on multipart turrets.
+Angle:
- Sets the angle this submodel should be at.
- Syntax: float, angle in degrees
+Submodel:
$Rotation:
- This segment rotates a submodel. Out of +Angle:, +Velocity: and +Time:, exactly two must be defined. The third will be automatically calculated to match the two specified properties.
+Angle:
- Sets the angle this submodel should rotate by.
- Syntax: Vector, three floats, x, y, z respectively, in degrees (equal to pitch, heading, bank)
+Absolute
- Optional: If set, this angle is the target angle of this subobject. If not set, this angle is what the submodel is rotated by from its current orientation. Note, that this will almost certainly require acceleration values in all three axes to be non-zero and large enough for the movement, unless acceleration is omitted for pure linear motion.
+Velocity:
- Sets the velocity this submodel should rotate at. The sign is only relevant in Velocity+Time-mode, where it defines rotation direction. In the other cases, the sign is ignored.
- Syntax: Vector, three floats, x, y, z respectively, in degrees per second (equal to pitch, heading, bank)
+Time:
- Sets the time this submodel takes to complete the rotation.
- Syntax: float, seconds
+Acceleration:
- Optional: Sets the acceleration of this submodel rotation. The sign is irrelevant.
- Note: If the acceleration is too small, the rotation might not be fully completed. Depends on rotation mode:
- Angle+Time-mode: The acceleration is too small to reach the target angle within the rotation time.
- Angle+Velocity-mode: The acceleration is too small to reach the target velocity until the angle is reached.
- Velocity+Time-mode: The acceleration is too small to reach the target velocity within the rotation time.
- Syntax: Vector, three floats, x, y, z respectively, in degrees per second squared (equal to pitch, heading, bank)
- Note: If the acceleration is too small, the rotation might not be fully completed. Depends on rotation mode:
+Submodel:
$Axis Rotation:
- This segment rotates a submodel around a specified axis. Out of +Angle:, +Velocity: and +Time:, exactly two must be defined. The third will be automatically calculated to match the two specified properties.
+Axis:
- Specified the axis this submodel will rotate around. Does not need to be normalized
- Syntax: Vector, three floats, x, y, z respectively
+Angle:
- Sets the angle this submodel should rotate by.
- Syntax: float, in degrees
+Velocity:
- Sets the velocity this submodel should rotate at. The sign is only relevant in Velocity+Time-mode, where it defines rotation direction. In the other cases, the sign is ignored.
- Syntax: float, in degrees per second
+Time:
- Sets the time this submodel takes to complete the rotation.
- Syntax: float, seconds
+Acceleration:
- Optional: Sets the acceleration of this submodel rotation. The sign is irrelevant.
- Note: If the acceleration is too small, the rotation might not be fully completed. Depends on rotation mode:
- Angle+Time-mode: The acceleration is too small to reach the target angle within the rotation time.
- Angle+Velocity-mode: The acceleration is too small to reach the target velocity until the angle is reached.
- Velocity+Time-mode: The acceleration is too small to reach the target velocity within the rotation time.
- Syntax: float, in degrees per second squared
- Note: If the acceleration is too small, the rotation might not be fully completed. Depends on rotation mode:
+Submodel:
$Translation:
- This segment moves a submodel. Out of +Vector:, +Velocity: and +Time:, exactly two must be defined. The third will be automatically calculated to match the two specified properties.
+Vector:
- Sets the movement vector this submodel should move by.
- Syntax: Vector, three floats, x, y, z respectively, in meters
+Absolute
- Optional: If set, this position is the target position of this subobject within the defined reference frame. If not set, this position is what the submodel is moved by from its current position. Note, that this will almost certainly require acceleration values in all three axes to be non-zero and large enough for the movement, unless acceleration is omitted for pure linear motion.
+Velocity:
- Sets the velocity this submodel should move at. The sign is only relevant in Velocity+Time-mode, where it defines movement direction. In the other cases, the sign is ignored.
- Syntax: Vector, three floats, x, y, z respectively, in meters per second
+Time:
- Sets the time this submodel takes to complete the movement.
- Syntax: float, seconds
+Acceleration:
- Optional: Sets the acceleration of this translation. The sign is irrelevant.
- Note: If the acceleration is too small, the translation might not be fully completed. Depends on translation mode:
- Vector+Time-mode: The acceleration is too small to reach the target vector within the rotation time.
- Vector+Velocity-mode: The acceleration is too small to reach the target velocity until the movement is completed.
- Velocity+Time-mode: The acceleration is too small to reach the target velocity within the translation time.
- Syntax: Vector, three floats, x, y, z respectively, in meters per second squared
- Note: If the acceleration is too small, the translation might not be fully completed. Depends on translation mode:
+Coordinate System:
- Optional: Sets the coordinate system this translation operates in. One of:
- Parent - The translation is in the coordinate system of its parent submodel (so, unless the parent submodel is rotated, the same as the ship's local coordinates).
- Local at start - The translation is in the coordinate system of this submodel as it is once the translation starts, not considering other animations.
- Local current - The translation is in the coordinate system of this submodel as it is currently. This includes rotations parallel to the translation, even from other animations.
- Defaults to Parent when not set.
+Submodel:
$Inverse Kinematics:
- This segment performs inverse kinematics to position a submodel by rotating individual parts of a chain of submodels. It is highly recommended to not run any other animation in parallel to an inverse kinematic segment that operates on one of the chain's submodules.
+Target Position:
- Sets the position the last link in the submodule chain should be after the IK segment is complete. Relative to the first link in the chain.
- Syntax: Vector, three floats, x, y, z respectively, in meters
+Target Orientation:
- Optional: Sets the orientation the last link in the submodule chain should be after the IK segment is complete. If left out, it will be in the same orientation as the penultimate link. Relative to the first link in the chain.
- Syntax: Vector, three floats, x, y, z respectively, in meters
+Time:
- Sets the time the movement should take.
- Syntax: float, seconds
$Chain Link:
- Specifies the individual links. This and all following properties of this segment are repeated for each chain link. There need to be at least two chain links for the IK segment.
- Each new chain link's submodel must be a direct child of the preceding chain link's submodel in the pof it is applied to
+Submodel:
+Acceleration:
- Optional: Sets the acceleration of this submodel rotation. The sign is irrelevant.
- Note: Make absolutely sure that the acceleration is sufficient for the submodel to reach where it needs to go in the time specified, or the chain will not end up where you specified.
- Syntax: Vector, three floats, x, y, z respectively, in degrees per second squared (equal to pitch, heading, bank)
+Constraint
- Optional: Can be used to constrain the movement of the current chain link relative to its parent. Either of:
- Window, used to specify a maximum x, y, z rotation of this submodel
- +Window Size: Specifies this window, Vector, three floats, x, y, z respectively, in degrees
- Hinge, used to constrain the chain link to rotate on an axis (note, can cause problems, especially as the first link. If issues occur, report them please)
- +Axis: Specifies the rotation axis, Vector, three floats, x, y, z respectively
- Window, used to specify a maximum x, y, z rotation of this submodel
$Sound During:
- Plays a sound during another segment
+Start:
- Optional: A sound that should be played once the child segment starts
+Loop:
- Optional: A sound that should be looped while the child segment runs
+End:
- Optional: A sound that should be played once the child segment ends
+Radius:
- Currently not yet used, but required
- Syntax: float
+Flip When Reversed
- Optional: If set, when the animation is played in reverse, the start sound will play first (so technically at the end of the animation), and the end sound will play once the segment has completely reset.
Child Segment
Specify a child segment here by normal segment definition rules, during which the sound should play.
$Wait:
- A segment to wait for a specific time.
+Time:
- Wait for a specified time
- Syntax: float, seconds
$Segment Sequential:
- Perform different segments one after another. The length of this segment is the sum of the length of the child segments.
+Submodel:
- Optional: If a submodel is specified here, it is automatically applied to the child segments, which then don't need to specify a submodel themselves. Explicit definitions by child segments override this setting.
See above as for how to specify a submodel
Child Segments
Specify any number of child segments here by normal segment definition rules that should be played one after another.
+End Segment
Once the last child segment of this sequence is specified, +End Segment must follow.
$Segment Parallel:
- Perform different segments at the same time. The length of this segment is defined by the longest child segment.
+Submodel:
- Optional: If a submodel is specified here, it is automatically applied to the child segments, which then don't need to specify a submodel themselves. Explicit definitions by child segments override this setting.
See above as for how to specify a submodel
Child Segments
Specify any number of child segments here by normal segment definition rules that should be played at the same time.
+End Segment
Once the last child segment of this sequence is specified, +End Segment must follow.
#Moveables
Unlike normal Animations, moveables can only define one specific type of movement, but its movement targets can be set at runtime through SEXP.
$Name:
- The name used to identify the animation when adding it to a model. Must be unique.
$Type: Orientation
This can be used to set the orientation of a submodel during a mission. The update-moveable-animation SEXP expects three numbers after the moveable name: the pitch, heading and bank in degrees the submodels orientation should be set to.
+Angle:
- Sets the angle this submodel should point to at the start of the mission.
- Syntax: Vector, three floats, x, y, z respectively, in degrees (equal to pitch, heading, bank)
+Submodel:
$Type: Rotation
This can be used to slowly rotate a submodel to a new target orientation during a mission. The update-moveable-animation SEXP expects three numbers after the moveable name: the pitch, heading and bank in degrees the submodel should then rotate towards.
+Angle:
- Sets the angle this submodel should point to at the start of the mission.
- Syntax: Vector, three floats, x, y, z respectively, in degrees (equal to pitch, heading, bank)
+Velocity:
- Sets the velocity this submodel should rotate at. The sign is ignored. Must not be 0 in any axis.
- Syntax: Vector, three floats, x, y, z respectively, in degrees per second (equal to pitch, heading, bank)
+Acceleration:
- Optional: Sets the acceleration of this translation. The sign is irrelevant. Must not be 0 in any axis.
- Note: If the acceleration is too small, the defined velocity might not be reached until the target rotation is achieved.
+Submodel:
$Type: Axis Rotation
This can be used to slowly rotate a submodel around an axis during a mission. The update-moveable-animation SEXP expects one number after the moveable name: the new angle this submodule should rotate towards.
+Axis:
- Sets the axis that the moveable should rotate around
- Syntax: Vector, three floats, x, y, z respectively, does not need to be normalized
+Velocity:
- Sets the velocity this submodel should rotate at. The sign is ignored. Must not be 0.
- Syntax: float, in degrees per second (equal to pitch, heading, bank)
+Acceleration:
- Optional: Sets the acceleration of this translation. The sign is irrelevant. Must not be 0 if specified
- Note: If the acceleration is too small, the defined velocity might not be reached until the target rotation is achieved.
+Submodel:
$Type: Inverse Kinematics
This moveable performs inverse kinematics to position a submodel by rotating individual parts of a chain of submodels The update-moveable-animation SEXP expects three numbers after the moveable name: The x, y and z position of the target, in 0.01 meters. Optionally, add the pitch, heading and bank in degrees to specify the end effector orientation target.
+Time:
- Sets the time any movement should take.
- Syntax: float, seconds
$Chain Link:
- Specifies the individual links. This and all following properties of this segment are repeated for each chain link. There need to be at least two chain links for the IK segment.
- Each new chain link's submodel must be a direct child of the preceding chain link's submodel in the pof it is applied to
+Submodel:
+Acceleration:
- Optional: Sets the acceleration of this submodel rotation. The sign is irrelevant.
- Note: Make absolutely sure that the acceleration is sufficient for the submodel to reach where it needs to go in the time specified, or the chain will not end up where you specified.
- Syntax: Vector, three floats, x, y, z respectively, in degrees per second squared (equal to pitch, heading, bank)
+Constraint
- Optional: Can be used to constrain the movement of the current chain link relative to its parent. Either of:
- Window, used to specify a maximum x, y, z rotation of this submodel
- +Window Size: Specifies this window, Vector, three floats, x, y, z respectively, in degrees
- Hinge, used to constrain the chain link to rotate on an axis (note, can cause problems, especially as the first link. If issues occur, report them please)
- +Axis: Specifies the rotation axis, Vector, three floats, x, y, z respectively
- Window, used to specify a maximum x, y, z rotation of this submodel
Example
#Animations $Name: Lid $Type: scripted +Triggered By: openlid $Rotation: +Angle: 70,0,0 +Time: 5 +Acceleration: 17,0,0 +Submodel: lid $Name: Wings $Type: on-spawn $Flags: ( "Loop" ) $Segment Parallel: $Rotation: +Angle: 0,0,150 +Time: 1.5 +Acceleration: 0,0,50 +Submodel: wingleft $Rotation: +Angle: 0,0,-150 +Time: 1.5 +Acceleration: 0,0,50 +Submodel: wingright +End Segment $Name: HangarDoor3 $Type: scripted +Triggered By: HangarDoor3_Toggle $Sound During: +Loop: 175 +Radius: 100 $Axis Rotation: +Axis: -0.5, 0.0, -0.866 +Angle: -90 +Time: 5.0 +Submodel: HangarDoor03 #End #Moveables $Name: Canard $Type: Rotation +Angle: 0,0,0 +Velocity: 20,20,20 +Submodel: canard #End