Script:playanim: Difference between revisions

From Arx Libertatis Wiki
Jump to navigation Jump to search
(Created page with "{{Stub}} This page describes the <code>playanim</code> script command. Usage: playanim none playanim [-123lnp] <animslot> playanim -e[123lnp] <animslot> <command...> Fl...")
 
mNo edit summary
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Stub}}
{{ScriptCommandPage
|description=play an animation
|context=any
|special=
[-123p] none
|flags=
1 Set the animation for the first animation layer - this is the default
2 Set the animation for the second animation layer
3 Set the animation for the third animation layer
l Loop the animation
n Do not interpolate from the current animation
p Set an animation on the player instead of the calling entity
e Execute a command after the animation completes
|parameters=
animslot string The animation slot to kill
e?command command A command to execute after the animation completes
|intro=


This page describes the <code>playanim</code> script command.
{{Warning|Save files store the byte offset of the command that is to be run when the animation finishes and the same byte position will be used even if the script is changed. Mods need to take care never to change the position of any animation -e commands if they want to stay compatible with old save files.}}
}}


Usage:
{{Notice|The delayed command specified using the <code>-e</code> flag is added as a hidden which can be cancelled using {{Command|timer|kill_local}} if {{Command|playanim}} was called from the entity instance script. If the animation is cancelled the command will still be executed at the time the animation would have finished.}}


playanim none
== Animation slots ==
playanim [-123lnp] <animslot>
playanim -e[123lnp] <animslot> <command...>


Flags:
The animation for each slot is set using {{Command|loadanim}}.
* <code>-1</code>: Set the animation for the first animation layer
* <code>-2</code>: Set the animation for the second animation layer
* <code>-3</code>: Set the animation for the third animation layer
* <code>-l</code>: Loop the animation
* <code>-n</code>: Do not interpolate from the current animation
* <code>-p</code>: Set an animation on the player instead of the current entity
* <code>-e</code>: Execute a command after the animation completes. If the animation is changed this command is still executed at the time the animation would have completed.


Parameters:
The following animation slots are supported:
{| class="wikitable sortable"
! Parameter
! Type
! Description
|-
| <code><animslot></code>
| {{text}}
| Name of the [[Script:Animation Slot|animation slot]] to use
|-
| <code><command></code>
| <code>code</code>
| One or more script commands to execute after the animation
|}


[[Category:Script commands]] [[Category:Script delayed execution]]
* <code>wait</code>
* <code>wait2</code>
* <code>walk</code>
* <code>walk1</code>
* <code>walk2</code>
* <code>walk3</code>
* <code>walk_backward</code>
* <code>walk_ministep</code>
* <code>wait_short</code>
* <code>walk_sneak</code>
* <code>action</code>
* <code>action1</code>
* <code>action2</code>
* <code>action3</code>
* <code>action4</code>
* <code>action5</code>
* <code>action6</code>
* <code>action7</code>
* <code>action8</code>
* <code>action9</code>
* <code>action10</code>
* <code>hit1</code>
* <code>hit</code>
* <code>hold_torch</code>
* <code>hit_short</code>
* <code>strike1</code>
* <code>strike</code>
* <code>shield_start</code>
* <code>shield_cycle</code>
* <code>shield_hit</code>
* <code>shield_end</code>
* <code>strafe_right</code>
* <code>strafe_left</code>
* <code>strafe_run_left</code>
* <code>strafe_run_right</code>
* <code>die</code>
* <code>dagger_ready_part_1</code>
* <code>dagger_ready_part_2</code>
* <code>dagger_unready_part_1</code>
* <code>dagger_unready_part_2</code>
* <code>dagger_wait</code>
* <code>dagger_strike_left_start</code>
* <code>dagger_strike_left_cycle</code>
* <code>dagger_strike_left</code>
* <code>dagger_strike_right_start</code>
* <code>dagger_strike_right_cycle</code>
* <code>dagger_strike_right</code>
* <code>dagger_strike_top_start</code>
* <code>dagger_strike_top_cycle</code>
* <code>dagger_strike_top</code>
* <code>dagger_strike_bottom_start</code>
* <code>dagger_strike_bottom_cycle</code>
* <code>dagger_strike_bottom</code>
* <code>death_critical</code>
* <code>run</code>
* <code>run1</code>
* <code>run2</code>
* <code>run3</code>
* <code>run_backward</code>
* <code>talk_neutral</code>
* <code>talk_angry</code>
* <code>talk_happy</code>
* <code>talk_neutral_head</code>
* <code>talk_angry_head</code>
* <code>talk_happy_head</code>
* <code>bare_ready</code>
* <code>bare_unready</code>
* <code>bare_wait</code>
* <code>bare_strike_left_start</code>
* <code>bare_strike_left_cycle</code>
* <code>bare_strike_left</code>
* <code>bare_strike_right_start</code>
* <code>bare_strike_right_cycle</code>
* <code>bare_strike_right</code>
* <code>bare_strike_top_start</code>
* <code>bare_strike_top_cycle</code>
* <code>bare_strike_top</code>
* <code>bare_strike_bottom_start</code>
* <code>bare_strike_bottom_cycle</code>
* <code>bare_strike_bottom</code>
* <code>1h_ready_part_1</code>
* <code>1h_ready_part_2</code>
* <code>1h_unready_part_1</code>
* <code>1h_unready_part_2</code>
* <code>1h_wait</code>
* <code>1h_strike_left_start</code>
* <code>1h_strike_left_cycle</code>
* <code>1h_strike_left</code>
* <code>1h_strike_right_start</code>
* <code>1h_strike_right_cycle</code>
* <code>1h_strike_right</code>
* <code>1h_strike_top_start</code>
* <code>1h_strike_top_cycle</code>
* <code>1h_strike_top</code>
* <code>1h_strike_bottom_start</code>
* <code>1h_strike_bottom_cycle</code>
* <code>1h_strike_bottom</code>
* <code>2h_ready_part_1</code>
* <code>2h_ready_part_2</code>
* <code>2h_unready_part_1</code>
* <code>2h_unready_part_2</code>
* <code>2h_wait</code>
* <code>2h_strike_left_start</code>
* <code>2h_strike_left_cycle</code>
* <code>2h_strike_left</code>
* <code>2h_strike_right_start</code>
* <code>2h_strike_right_cycle</code>
* <code>2h_strike_right</code>
* <code>2h_strike_top_start</code>
* <code>2h_strike_top_cycle</code>
* <code>2h_strike_top</code>
* <code>2h_strike_bottom_start</code>
* <code>2h_strike_bottom_cycle</code>
* <code>2h_strike_bottom</code>
* <code>missile_ready_part_1</code>
* <code>missile_ready_part_2</code>
* <code>missile_unready_part_1</code>
* <code>missile_unready_part_2</code>
* <code>missile_wait</code>
* <code>missile_strike_part_1</code>
* <code>missile_strike_part_2</code>
* <code>missile_strike_cycle</code>
* <code>missile_strike</code>
* <code>meditation</code>
* <code>cast_start</code>
* <code>cast_cycle</code>
* <code>cast</code>
* <code>cast_end</code>
* <code>crouch</code>
* <code>crouch_walk</code>
* <code>crouch_walk_backward</code>
* <code>crouch_strafe_left</code>
* <code>crouch_strafe_right</code>
* <code>crouch_start</code>
* <code>crouch_wait</code>
* <code>crouch_end</code>
* <code>lean_right</code>
* <code>lean_left</code>
* <code>levitate</code>
* <code>jump</code>
* <code>jump_anticipation</code>
* <code>jump_up</code>
* <code>jump_cycle</code>
* <code>jump_end</code>
* <code>jump_end_part2</code>
* <code>fight_walk_forward</code>
* <code>fight_walk_backward</code>
* <code>fight_walk_ministep</code>
* <code>fight_strafe_right</code>
* <code>fight_strafe_left</code>
* <code>fight_wait</code>
* <code>grunt</code>
* <code>u_turn_left</code>
* <code>u_turn_right</code>
* <code>u_turn_left_fight</code>
* <code>u_turn_right_fight</code>

Latest revision as of 09:49, 24 July 2022

The playanim script command is used to play an animation for an entity.

⚠️
Save files store the byte offset of the command that is to be run when the animation finishes and the same byte position will be used even if the script is changed. Mods need to take care never to change the position of any animation -e commands if they want to stay compatible with old save files.

Usage

playanim [-123lnpe] <animslot> [e?command...]
playanim [-123p] none

Context: Any Entity

Flags:

 -1: Set the animation for the first animation layer - this is the default
 -2: Set the animation for the second animation layer
 -3: Set the animation for the third animation layer
 -l: Loop the animation
 -n: Do not interpolate from the current animation
 -p: Set an animation on the player instead of the calling entity
 -e: Execute a command after the animation completes

Parameters:

ParameterTypeDescription
animslot string The animation slot to kill
command (requires -e) command A command to execute after the animation completes

ℹ️  The delayed command specified using the -e flag is added as a hidden which can be cancelled using timer kill_local if playanim was called from the entity instance script. If the animation is cancelled the command will still be executed at the time the animation would have finished.

Animation slots

The animation for each slot is set using loadanim.

The following animation slots are supported:

  • wait
  • wait2
  • walk
  • walk1
  • walk2
  • walk3
  • walk_backward
  • walk_ministep
  • wait_short
  • walk_sneak
  • action
  • action1
  • action2
  • action3
  • action4
  • action5
  • action6
  • action7
  • action8
  • action9
  • action10
  • hit1
  • hit
  • hold_torch
  • hit_short
  • strike1
  • strike
  • shield_start
  • shield_cycle
  • shield_hit
  • shield_end
  • strafe_right
  • strafe_left
  • strafe_run_left
  • strafe_run_right
  • die
  • dagger_ready_part_1
  • dagger_ready_part_2
  • dagger_unready_part_1
  • dagger_unready_part_2
  • dagger_wait
  • dagger_strike_left_start
  • dagger_strike_left_cycle
  • dagger_strike_left
  • dagger_strike_right_start
  • dagger_strike_right_cycle
  • dagger_strike_right
  • dagger_strike_top_start
  • dagger_strike_top_cycle
  • dagger_strike_top
  • dagger_strike_bottom_start
  • dagger_strike_bottom_cycle
  • dagger_strike_bottom
  • death_critical
  • run
  • run1
  • run2
  • run3
  • run_backward
  • talk_neutral
  • talk_angry
  • talk_happy
  • talk_neutral_head
  • talk_angry_head
  • talk_happy_head
  • bare_ready
  • bare_unready
  • bare_wait
  • bare_strike_left_start
  • bare_strike_left_cycle
  • bare_strike_left
  • bare_strike_right_start
  • bare_strike_right_cycle
  • bare_strike_right
  • bare_strike_top_start
  • bare_strike_top_cycle
  • bare_strike_top
  • bare_strike_bottom_start
  • bare_strike_bottom_cycle
  • bare_strike_bottom
  • 1h_ready_part_1
  • 1h_ready_part_2
  • 1h_unready_part_1
  • 1h_unready_part_2
  • 1h_wait
  • 1h_strike_left_start
  • 1h_strike_left_cycle
  • 1h_strike_left
  • 1h_strike_right_start
  • 1h_strike_right_cycle
  • 1h_strike_right
  • 1h_strike_top_start
  • 1h_strike_top_cycle
  • 1h_strike_top
  • 1h_strike_bottom_start
  • 1h_strike_bottom_cycle
  • 1h_strike_bottom
  • 2h_ready_part_1
  • 2h_ready_part_2
  • 2h_unready_part_1
  • 2h_unready_part_2
  • 2h_wait
  • 2h_strike_left_start
  • 2h_strike_left_cycle
  • 2h_strike_left
  • 2h_strike_right_start
  • 2h_strike_right_cycle
  • 2h_strike_right
  • 2h_strike_top_start
  • 2h_strike_top_cycle
  • 2h_strike_top
  • 2h_strike_bottom_start
  • 2h_strike_bottom_cycle
  • 2h_strike_bottom
  • missile_ready_part_1
  • missile_ready_part_2
  • missile_unready_part_1
  • missile_unready_part_2
  • missile_wait
  • missile_strike_part_1
  • missile_strike_part_2
  • missile_strike_cycle
  • missile_strike
  • meditation
  • cast_start
  • cast_cycle
  • cast
  • cast_end
  • crouch
  • crouch_walk
  • crouch_walk_backward
  • crouch_strafe_left
  • crouch_strafe_right
  • crouch_start
  • crouch_wait
  • crouch_end
  • lean_right
  • lean_left
  • levitate
  • jump
  • jump_anticipation
  • jump_up
  • jump_cycle
  • jump_end
  • jump_end_part2
  • fight_walk_forward
  • fight_walk_backward
  • fight_walk_ministep
  • fight_strafe_right
  • fight_strafe_left
  • fight_wait
  • grunt
  • u_turn_left
  • u_turn_right
  • u_turn_left_fight
  • u_turn_right_fight