ItsMods

Full Version: Animations
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

Another tutorial, this time is for animations, Smile . All of this is taken from _animatedmodels.gsc, _destructible_types.gsc and _load.gsc.

Lets begin, first you need to load a animtree, load it at the beggining of a gsc file(is not necesary to be at top, but I recomend):

Code:
#using_animtree( "animtree name" );

Here is a list of animtree names(only a few work on MP):

Code:
ac130
animated_props
chair
civilian
destructibles
dog
door
drones
fastrope
generic_human
mg42
multiplayer
player
player_3rd_person
script_model
vehicles

Find a anim you want on that animtree and now, is time to precache it, use this command on Init() in your mod:

Code:
PrecacheMpAnim("animation you want");

Now, you can play your animation with this commands, use first just to play it:

Code:
entity ScriptModelPlayAnim( "animation you precached" ); //play animation
Code:
entity willNeverChange(); //makes the animation never change, it will only play the anim you gave it before.
Code:
entity scriptModelClearAnim( "animation you were using" ); //stop the animation that is being played
Code:
destructible_anim( get_precached_anim( "generator_explode" ), #animtree, "setanimknob", undefined, undefined, "generator_explode" ); //This is what destructibles use for animations, first selects the anim, then load animtrees(the one that you loaded,destructibles use animtree destructibles), the it sets this different play anim command: setanimknob, then it allow you to play on different tags and then the animation you want.

This is basically all, Wink

Credits:

- Se7en, he was the first in finding this, but he never released, Sad
Stop Spamming Omg!!! Jokes, Nice tutorials keep it up Big Grin
Ty! Big Grin
Nice OMA boi.
OMA
You should have added the list of animations type without them in your tutorial it will be no use for those who don't know where to find the animations.
eg.

ScriptModelPlayAnim("pb_sprint");

also the "#using_animtree( "animtree name" );" is not that necessary
since it's already added in most of the includes files.
The animations works without this include file.

just a tip for everyone...
(12-02-2011, 06:50)ghilllie Wrote: [ -> ]You should have added the list of animations type without them in your tutorial it will be no use for those who don't know where to find the animations.
eg.

ScriptModelPlayAnim("pb_sprint");

also the "#using_animtree( "animtree name" );" is not that necessary
since it's already added in most of the includes files.
The animations works without this include file.

just a tip for everyone...

http://www.itsmods.com/forum/Thread-Rele...-List.html