Using Animations | Tutorial for noobsThe GuideFirst, lets learn how to load, check if available, use, and release anims
Before you can use an anim, you must first load the file its in
{See this fantastic list by Seemann:
http://public.sannybuilder.com/anim/SAAnims.txt }
For example, If I wanted to use CAR_HOOKERTALK , I would load the file called PED
Now lets look at how we load an anim file:
| CODE |
04ED: load_animation "PED"
|
Like models, we must check if it is available:
| CODE |
04EE: animation "PED" loaded
|
Now were ready to use the anim with anim opcodes:
| CODE |
0605: actor $PLAYER_ACTOR perform_animation_sequence "CAR_HOOKERTALK" IFP_file "PED" 4.0 loop 1 0 0 0 time -1 // versionA
|
With the values in the opcode above, the actor will perform the anim forever, as its on a loop
So what about If you dont want the actor to perform it for ever? Simply:
| CODE |
0605: actor $PLAYER_ACTOR perform_animation_sequence "CAR_HOOKERTALK" IFP_file "PED" 4.0 loop 0 0 0 0 time 10000 // versionA
|
Now, the actor will perform the anim for ten seconds then stop
Now, lets say you finished, we must now release it:
| CODE |
04EF: release_animation "PED"
|
Notes/Trivia- Like models, multiple anim files can be loaded at the same time
- Anims are .ifp files. The .ifp extension is irrelevant to using the anims
This post has been edited by james227uk on Friday, Jul 24 2009, 13:24