Difference between revisions of "0605"

From GTAMods Wiki
Jump to navigation Jump to search
(New page: {{OpCode | ini = 0605=9,%1h% %2h% %3h% %4d% %5h% %6h% %7h% %8h% %9h% | description = Performs an animation on a character | p1 = Existing actor handle | p2 = ...)
 
Line 20: Line 20:
 
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 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 8 locks the character into the last frame of animation.<br>
Parameter 9 is the time in milliseconds.
+
Parameter 9 is the time in milliseconds before ending the animation. Use -1 to allow the animation to end by itself.
 +
 
 +
==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]].
 +
<source lang="scm">
 +
:LoadAnim
 +
0247: load_model #BFORI
 +
04ED: load_animation "MISC"
 +
 +
:CheckAnim
 +
0001: wait 0 ms
 +
00D6: if and
 +
0248:  model #BFORI available
 +
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
 +
004E: end_thread
 +
</source>
  
 
==Keywords==
 
==Keywords==

Revision as of 15:17, 2 January 2009

{{{games}}}


Description
Performs an animation on a character
Syntax
{{{syntax1}}}
Parameter
Native analog
TASK_PLAY_ANIM

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.
Parameter 5 makes the an8imation loop.
Parameter 6 and 7 places the character at the end of the animation instead of returning to the start when the animation finishes.
Parameter 8 locks the character into the last frame of animation.
Parameter 9 is the time in milliseconds before ending the animation. Use -1 to allow the animation to end by itself.

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.

 :LoadAnim
 0247: load_model #BFORI
 04ED: load_animation "MISC"
 
 :CheckAnim
 0001: wait 0 ms
 00D6: if and
 0248:   model #BFORI available
 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
 004E: end_thread

Keywords

perform, animation, actor, character

Source