-
Notifications
You must be signed in to change notification settings - Fork 368
Playing animations
There are 2 ways to play anim:
-
using it's ifp file name and anim name
-
using it's anim group and index
PedModel.PlayAnim (fileName, animName);
For example:
PedModel.PlayAnim ("ped", "roadcross");
this will play anim which is located in ped.ifp, and which is called roadcross
Anims can be placed in groups. The idea is that peds' anims can be grouped, so that using the same index, you can play different anims for different ped groups.
For example, if you use AnimGroup.WalkCycle
as anim group, and AnimIndex.Walk
as index, then when ped is a man, 'walk_civi' will be played, and when ped is a woman, 'woman_walknorm' will be played.
Anim groups are defined inside /Data/auxanimgrp.dat
file. You can read more about file structure in that file.
If you want to add new anims, you can add them to existing group, or create new group. After you added them to a file, you will need to update AnimGroup
and AnimIndex
enumerations, so that you can play those anims.
Example for playing walk anim:
PedModel.PlayAnim (AnimGroup.WalkCycle, AnimIndex.Walk)
You can preview anims in game, from Animations window. Make sure "override player anims" is checked, and click on anim to play it.