Difference between revisions of "0605"

From GTAMods Wiki
Jump to navigation Jump to search
m
 
Line 1: Line 1:
 
{{OpCode
 
{{OpCode
| ini        = 0605=9,%1h% %2h% %3h% %4d% %5h% %6h% %7h% %8h% %9h%
+
| games      = {{Icon|SA}}
| description = Performs an [[animation]] on a character
+
| command    = TASK_PLAY_ANIM
| p1          = Existing actor handle
+
| description = Performs the [[animation]] on the character
| p2          = Animation sequence
+
| syntax1    = 0605: actor [''char handle''] perform_animation "[''string1'']" IFP "[''string2'']" framedelta [''flt''] loop [''int1''] lockX [''int2''] lockY [''int3''] lockF [''int4''] time [''int5'']
| p3          = Animation file
+
| p1t        = [''char handle'']
| p4          = Float (speed)
+
| p1d        = The handle of the character
| p5          = Integer (loop)
+
| p2t        = [''string1'']
| p6          = Integer (lockX)
+
| p2d        = Animation sequence
| p7          = Integer (lockY)
+
| p3t        = [''string2'']
| p8          = Integer (lockF)
+
| p3d        = Animation file
| p9          = Time
+
| p4t        = [''flt'']
| game        = San Andreas
+
| p4d        = Rate of speed of animation (default 4.0)
| native      = [[TASK_PLAY_ANIM]]
+
| p5t        = [''int1'']
 +
| p5d        = Allows animation to loop
 +
| p6t        = [''int2'']
 +
| p6d        = Allows character to remain at x-coordinate when animation ends
 +
| p7t        = [''int3'']
 +
| p7d        = Allows character to remain at y-coordinate when animation ends
 +
| p8t        = [''int4'']
 +
| p8d        = Locks character into last frame of animation
 +
| p9t        = [''int5'']
 +
| p9d        = Duration in milliseconds, ''-1'' to allow animation to end by itself
 
}}
 
}}
This opcode make the character perform the specified animation. Using this opcode requires [[04ED]] or else the game might crash. Animations from the "PED" file does not need to be loaded.
 
  
Parameter 4 is the rate of speed of the animation. 4.0 is the default speed.<br>
+
This opcode makes the character perform the specified animation. With the exception of the "PED" animation file, using this opcode requires [[04ED]] or else the game may crash.
Parameter 5 makes the an8imation loop.<br>
 
Parameter 6 and 7 places the character at the end of the animation instead of returning to the start when the animation finishes.<br>
 
Parameter 8 locks the character into the last frame of animation.<br>
 
Parameter 9 is the time in milliseconds before ending the animation. Use -1 to allow the animation to end by itself.
 
  
 
==Example==
 
==Example==
This will show an example on how to make your character perform an animation. This will be only shown as an example and should not be copied verbatim. There are many ways of doing this. The following code uses the [[Sanny Builder]].
+
The following example using [[Sanny Builder]] allows a character to perform an animation.
<source lang="scm">
+
<syntaxhighlight lang="scm">
:LoadAnim
+
0247: load_model #BFORI
0247: load_model #BFORI
+
04ED: load_animation "MISC"
04ED: load_animation "MISC"
+
038B: load_requested_models
+
009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0
:CheckAnim
+
0605: actor 0@ perform_animation_sequence "BMX_COMEON" IFP_file "MISC" 4.0 loop 0 lockX 0 lockY 0 lockF 0 time -1
0001: wait 0 ms
+
0249: release_model #BFORI
00D6: if and
+
04EF: release_animation "MISC"
0248:  model #BFORI available
+
</syntaxhighlight>
04EE:  animation "MISC" loaded
 
004D: jump_if_false @CheckAnim
 
009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0
 
0605: actor 0@ perform_animation_sequence "BMX_COMEON" IFP_file "MISC" 4.0 loop 0 lockX 0 lockY 0 lockF 0 time -1
 
0249: release_model #BFORI
 
04EF: release_animation "MISC"
 
004E: end_thread
 
</source>
 
  
 
==Keywords==
 
==Keywords==

Latest revision as of 11:44, 10 November 2016

San Andreas TASK_PLAY_ANIM


Description
Performs the animation on the character
Syntax
0605: actor [char handle] perform_animation "[string1]" IFP "[string2]" framedelta [flt] loop [int1] lockX [int2] lockY [int3] lockF [int4] time [int5]
Parameter
[char handle]
The handle of the character
[string1]
Animation sequence
[string2]
Animation file
[flt]
Rate of speed of animation (default 4.0)
[int1]
Allows animation to loop
[int2]
Allows character to remain at x-coordinate when animation ends
[int3]
Allows character to remain at y-coordinate when animation ends
[int4]
Locks character into last frame of animation
[int5]
Duration in milliseconds, -1 to allow animation to end by itself

This opcode makes the character perform the specified animation. With the exception of the "PED" animation file, using this opcode requires 04ED or else the game may crash.

Example

The following example using Sanny Builder allows a character to perform an animation.

0247: load_model #BFORI
04ED: load_animation "MISC"
038B: load_requested_models
009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0
0605: actor 0@ perform_animation_sequence "BMX_COMEON" IFP_file "MISC" 4.0 loop 0 lockX 0 lockY 0 lockF 0 time -1
0249: release_model #BFORI
04EF: release_animation "MISC"

Keywords

perform, animation, actor, character

Source