Animation.tbl

From FreeSpace Wiki
Jump to: navigation, search
This feature requires SCP
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
Armor.tbl* /ship/ship.cpp
Asteroid.tbl /asteroid/asteroid.cpp
Autopilot.tbl /autopilot/autopilot.cpp
Colors.tbl* /globalincs/alphacolors.cpp
Controlconfigdefaults.tbl /controlconfig/controlsconfigcommon.cpp
Credits.tbl* /menuui/credits.cpp
Cutscenes.tbl /cutscene/cutscenes.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
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
Pixels.tbl /palman/palman.cpp
Post_processing.tbl /graphics/gropenglpostprocessing.cpp
Rank.tbl /stats/scoring.cpp
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 /missionui/missiondebrief.cpp
Tstrings.tbl* /localization/localize.cpp
Weapon_expl.tbl* /weapon/weapons.cpp
Weapons.tbl* /weapon/weapons.cpp


FS2 Open, 22.0:

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.

#Animations

$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 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)
    • weapon-launched
      • Animation code is started on a modelled weapon once it is fired.
    • scripted
      • Animation code is started when it is triggered with scripts or SEXPs (see scripting.tbl)

+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, weapon-launched
      • 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 to open. Can be prefixed with a NOT to trigger when any fighterbay 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

$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

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.

$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:

See above


$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)

+Submodel:

See above


$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.
  • CURRENTLY STILL DISABLED: Translation is not yet available to use, but will, once completed, follow this syntax.

+Vector:

  • Sets the movement vector this submodel should move by.
    • Syntax: Vector, three floats, x, y, z respectively, in meters

+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

+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:

See above


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

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: weapon-launched
$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

#End