You are viewing our Forum Archives. To view or take place in current topics click here.
[Crippler] Basics of AnimatingModels
Posted:

[Crippler] Basics of AnimatingModelsPosted:

coolbunny1234
  • TTG Commander
Status: Offline
Joined: Aug 09, 200915Year Member
Posts: 6,493
Reputation Power: 8063
Motto: The Original Bunny
Motto: The Original Bunny
Status: Offline
Joined: Aug 09, 200915Year Member
Posts: 6,493
Reputation Power: 8063
Motto: The Original Bunny
THIS B CRIPPLERZ WORK

This is a brief tutorial on how to animate models using the "defaultactor".


#animtree's

*Each "class" of model has its own #animtree i.e. "generic_human", "player", "script_model".

*The most common is "generic_human", I'm sure you've noticed it looking through the .ff's. That's the one I'll be using in the example.

Here is a list of the #animtree's that I've come across so far. There are a ton more and I'll update as I get further into animating.

"player"
"generic_human"
"dog"
"script_model"
"zombie_cymbal_monkey"


#using_animtree ("animtree goes here");


This is the animtree that the ent you spawn in the following function will use. It goes directly above the function.

So lets begin the script.

self thread testie();

#using_animtree ("generic_human");
testie()
{
   level.test = spawn( "script_model", self.origin+(0,100,0));
   level.test SetModel( "defaultactor" );
}


Now we want to tell the ent to use the #animtree we added above. To do that we use:

level.test UseAnimTree( #animtree );


So with it added it looks like this:

#using_animtree ("generic_human");
testie()
{
   level.test = spawn( "script_model", self.origin+(0,100,0));
   level.test SetModel( "defaultactor" );
   level.test UseAnimTree( #animtree );
}


Animations

There are literally a ton of them. Not only can you use all the zombie anim's, you can also use all of the anim's found in the common as well.

For that reason I'm only going to post the zombie ones for now.

Zombie anim's:
   // deaths
   level.scr_anim["zombie"]["death1"]    = %ai_zombie_death_v1;
   level.scr_anim["zombie"]["death2"]    = %ai_zombie_death_v2;
   level.scr_anim["zombie"]["death3"]    = %ai_zombie_crawl_death_v1;
   level.scr_anim["zombie"]["death4"]    = %ai_zombie_crawl_death_v2;
   // run cycles
   level.scr_anim["zombie"]["walk1"]    = %ai_zombie_walk_v1;
   level.scr_anim["zombie"]["walk2"]    = %ai_zombie_walk_v2;
   level.scr_anim["zombie"]["walk3"]    = %ai_zombie_walk_v3;
   level.scr_anim["zombie"]["walk4"]    = %ai_zombie_walk_v4;
   level.scr_anim["zombie"]["run1"]    = %ai_zombie_walk_fast_v1;
   level.scr_anim["zombie"]["run2"]    = %ai_zombie_walk_fast_v2;
   level.scr_anim["zombie"]["run3"]    = %ai_zombie_walk_fast_v3;
   level.scr_anim["zombie"]["run4"]    = %ai_zombie_run_v2;
   level.scr_anim["zombie"]["run5"]    = %ai_zombie_run_v4;
   level.scr_anim["zombie"]["run6"]    = %ai_zombie_run_v3;
   level.scr_anim["zombie"]["sprint1"] = %ai_zombie_sprint_v1;
   level.scr_anim["zombie"]["sprint2"] = %ai_zombie_sprint_v2;
   level.scr_anim["zombie"]["sprint3"] = %ai_zombie_sprint_v1;
   level.scr_anim["zombie"]["sprint4"] = %ai_zombie_sprint_v2;
   // run cycles in prone
   level.scr_anim["zombie"]["crawl1"]    = %ai_zombie_crawl;
   level.scr_anim["zombie"]["crawl2"]    = %ai_zombie_crawl_v1;
   level.scr_anim["zombie"]["crawl3"]    = %ai_zombie_crawl_v2;
   level.scr_anim["zombie"]["crawl4"]    = %ai_zombie_crawl_v3;
   level.scr_anim["zombie"]["crawl5"]    = %ai_zombie_crawl_v4;
   level.scr_anim["zombie"]["crawl6"]    = %ai_zombie_crawl_v5;
   level.scr_anim["zombie"]["crawl_hand_1"] = %ai_zombie_walk_on_hands_a;
   level.scr_anim["zombie"]["crawl_hand_2"] = %ai_zombie_walk_on_hands_b;
   level.scr_anim["zombie"]["crawl_sprint1"]    = %ai_zombie_crawl_sprint;
   level.scr_anim["zombie"]["crawl_sprint2"]    = %ai_zombie_crawl_sprint_1;
   level.scr_anim["zombie"]["crawl_sprint3"]    = %ai_zombie_crawl_sprint_2;
   level._zombie_melee[0]             = %ai_zombie_attack_forward_v1;
   level._zombie_melee[1]             = %ai_zombie_attack_forward_v2;
   level._zombie_melee[2]             = %ai_zombie_attack_v1;
   level._zombie_melee[3]             = %ai_zombie_attack_v2;   
   level._zombie_melee[4]            = %ai_zombie_attack_v1;
   level._zombie_melee[5]            = %ai_zombie_attack_v4;
   level._zombie_melee[6]            = %ai_zombie_attack_v6;   
   level._zombie_run_melee[0]            =   %ai_zombie_run_attack_v1;
   level._zombie_run_melee[1]            =   %ai_zombie_run_attack_v2;
   level._zombie_run_melee[2]            =   %ai_zombie_run_attack_v3;
   level.scr_anim["zombie"]["run4"]    = %ai_zombie_run_v2;
   level.scr_anim["zombie"]["run5"]    = %ai_zombie_run_v4;
   level.scr_anim["zombie"]["run6"]    = %ai_zombie_run_v3;
   level.scr_anim["zombie"]["walk5"]    = %ai_zombie_walk_v6;
   level.scr_anim["zombie"]["walk6"]    = %ai_zombie_walk_v7;
   level.scr_anim["zombie"]["walk7"]    = %ai_zombie_walk_v8;
   level.scr_anim["zombie"]["walk8"]    = %ai_zombie_walk_v9;


So lets tell the actor to walk like in my video.

To do that we'll add:
level.test SetAnim( %ai_zombie_walk_v1 );


The function should now look like this:

#using_animtree ("generic_human");
testie()
{
   level.test = spawn( "script_model", self.origin+(0,100,0));
   level.test SetModel( "defaultactor" );
   level.test UseAnimTree( #animtree );
   level.test SetAnim( %ai_zombie_walk_v1 );
}


We have now spawned an animated model, but what if you want it to do more than one anim?

For that well use:

level.test ClearAnim( animation to clear, time to clear it );


Updated function:

#using_animtree ("generic_human");
testie()
{
   level.test = spawn( "script_model", self.origin+(0,100,0));
   level.test SetModel( "defaultactor" );
   level.test UseAnimTree( #animtree );
   level.test SetAnim( %ai_zombie_walk_v1 );
   wait 5;//walks for 5 seconds
   level.test ClearAnim( %ai_zombie_walk_v1, .1 );//clears the anim
}


Now we'll make it so she takes a swing at you by adding a swing anim from the list.

#using_animtree ("generic_human");
testie()
{
   level.test = spawn( "script_model", self.origin+(0,100,0));
   level.test SetModel( "defaultactor" );
   level.test UseAnimTree( #animtree );
   level.test SetAnim( %ai_zombie_walk_v1 );
   wait 5;//walks for 5 seconds
   level.test ClearAnim( %ai_zombie_walk_v1, .1 );//clears the anim
        level.test SetAnim( %ai_zombie_attack_forward_v2 );//swing
}


Now we'll wait a couple seconds for the animation to complete, clear the swing anim, and then set her back to walking.

#using_animtree ("generic_human");
testie()
{
   level.test = spawn( "script_model", self.origin+(0,100,0));
   level.test SetModel( "defaultactor" );
   level.test UseAnimTree( #animtree );
   level.test SetAnim( %ai_zombie_walk_v1 );
   wait 5;//walks for 5 seconds
   level.test ClearAnim( %ai_zombie_walk_v1, .1 );//clears the anim
   level.test SetAnim( %ai_zombie_attack_forward_v2 );//swing
   wait 2;//wait for swing anim to finish
   level.test ClearAnim( %ai_zombie_attack_forward_v2, .1 );//clear swing
   level.test SetAnim( %ai_zombie_walk_v1 );//walk again
}


Note: This model will not move around the map unless you make it. It will simply walk in place.

Well there you have it. A simple brief tut on how to animate models. I'll update this thread as I learn more about it.

I'll try to answer any questions the best I can, as long as they're intelligent ones..


End result minus it following you.



Last edited by coolbunny1234 ; edited 1 time in total

The following 3 users thanked coolbunny1234 for this useful post:

FlamesUK (09-04-2011), epaR (09-04-2011), Jonneh (09-04-2011)
#2. Posted:
epaR
  • TTG Fanatic
Status: Offline
Joined: Jan 30, 201113Year Member
Posts: 4,351
Reputation Power: 195
Status: Offline
Joined: Jan 30, 201113Year Member
Posts: 4,351
Reputation Power: 195
lol , another sticky..




that video is epic.

i dont understand how you do all this coding for WaW and JTAG Shi*...
#3. Posted:
I_R_T9X
  • TTG Senior
Status: Offline
Joined: Jun 13, 200915Year Member
Posts: 1,676
Reputation Power: 84
Status: Offline
Joined: Jun 13, 200915Year Member
Posts: 1,676
Reputation Power: 84
You wanna own this section huh? lol
keep it up
#4. Posted:
coolbunny1234
  • Rigged Luck
Status: Offline
Joined: Aug 09, 200915Year Member
Posts: 6,493
Reputation Power: 8063
Motto: The Original Bunny
Motto: The Original Bunny
Status: Offline
Joined: Aug 09, 200915Year Member
Posts: 6,493
Reputation Power: 8063
Motto: The Original Bunny
Manipulation wrote
lol , another sticky..




that video is epic.

i dont understand how you do all this coding for WaW and JTAG Shi*...


Nah the only thing that should be stickied is what is currently stickied.

I learned from here Forums/t=2150030/cod-complete-scr...orial.html
#5. Posted:
coolbunny1234
  • Summer 2019
Status: Offline
Joined: Aug 09, 200915Year Member
Posts: 6,493
Reputation Power: 8063
Motto: The Original Bunny
Motto: The Original Bunny
Status: Offline
Joined: Aug 09, 200915Year Member
Posts: 6,493
Reputation Power: 8063
Motto: The Original Bunny
Orb wrote You wanna own this section huh? lol
keep it up


Thanks lol

I already do own the section though 8)
#6. Posted:
john3321
  • New Member
Status: Offline
Joined: May 06, 201113Year Member
Posts: 19
Reputation Power: 0
Status: Offline
Joined: May 06, 201113Year Member
Posts: 19
Reputation Power: 0
Nice post man always helping

P.S You DO own this section
#7. Posted:
coolbunny1234
  • Spooky Poster
Status: Offline
Joined: Aug 09, 200915Year Member
Posts: 6,493
Reputation Power: 8063
Motto: The Original Bunny
Motto: The Original Bunny
Status: Offline
Joined: Aug 09, 200915Year Member
Posts: 6,493
Reputation Power: 8063
Motto: The Original Bunny
john3321 wrote Nice post man always helping

P.S You DO own this section


lol thanks. 8) 8) 8) 8)
#8. Posted:
Mikeeeey
  • Ladder Climber
Status: Offline
Joined: May 15, 201113Year Member
Posts: 350
Reputation Power: 26
Status: Offline
Joined: May 15, 201113Year Member
Posts: 350
Reputation Power: 26
Most of the people don't know who the **** Crippler is... You need to give proper credit...
#9. Posted:
Crippler_7s
  • Resident Elite
Status: Offline
Joined: Dec 20, 201014Year Member
Posts: 262
Reputation Power: 20
Status: Offline
Joined: Dec 20, 201014Year Member
Posts: 262
Reputation Power: 20
Wow, seems like you're taking credit for all my work here bunny.... WTF?

You may want to add copied and pasted from Cripplers topic on 7s to the header......

[ Register or Signin to view external links. ]
#10. Posted:
x703xBabyface
  • Junior Member
Status: Offline
Joined: Aug 23, 201014Year Member
Posts: 97
Reputation Power: 3
Status: Offline
Joined: Aug 23, 201014Year Member
Posts: 97
Reputation Power: 3
This hasn't been the first bunny Nor the last...
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.