| Author |
Topic: how to make an actor execute an anim |
| HyBr!d |
General Member Since: Sep 26, 2004 Posts: 560 Last: Sep 25, 2015 [view latest posts] |
|
|
|
Category: CoD4 SP Mapping Posted: Monday, Feb. 2, 2009 03:25 pm |
 |
now i got my loadout issues fixed i wanted to let my enemy actors use a idle patrol animation. But i don't know how exactly its done. The way i tried it is: add an node_scripted with animscript "patrol" connect it to a script_origin. Then connect the actor to the node. When i compile i get an error that i didn't define the anim.
Error
So can anyone explain me how to let an actor execute a certain animation?
thanks in advance!
|
 |
|
|
| scillman |
 |
General Member Since: Nov 23, 2006 Posts: 360 Last: Sep 1, 2012 [view latest posts] |
|
|
|
|
| HyBr!d |
General Member Since: Sep 26, 2004 Posts: 560 Last: Sep 25, 2015 [view latest posts] |
|
|
|
Category: CoD4 SP Mapping Posted: Monday, Feb. 2, 2009 09:32 pm |
 |
i have an anim.gsc:
Code: #include maps\_utility;
#include common_scripts\utility;
#include maps\_anim;
#using_animtree("generic_human");
anim_main()
{
level.scr_anim[ "generic" ][ "bored" ] = %patrolstand_twitch;
level.scr_anim[ "generic" ][ "bored1" ] = %patrolstand_idle;
level.scr_anim[ "generic" ][ "bored2" ] = %patrol_bored_walk_2_bored;
animated_model_setup();
}
#using_animtree( "animated_props" );
animated_model_setup()
{
level.anim_prop_models["foliage_tree_palm_tall_3"]["still"] = %palmtree_tall3_still;
level.anim_prop_models["foliage_tree_palm_tall_3"]["strong"] = %palmtree_tall3_sway;
level.anim_prop_models["foliage_tree_palm_med_2"]["still"] = %palmtree_med2_still;
level.anim_prop_models["foliage_tree_palm_med_2"]["strong"] = %palmtree_med2_sway;
level.anim_prop_models["foliage_tree_palm_bushy_1"]["still"] = %palmtree_bushy1_still;
level.anim_prop_models["foliage_tree_palm_bushy_1"]["strong"] = %palmtree_bushy1_sway;
level.anim_prop_models["foliage_tree_palm_bushy_2"]["still"] = %palmtree_bushy2_still;
level.anim_prop_models["foliage_tree_palm_bushy_2"]["strong"] = %palmtree_bushy2_sway;
level.anim_prop_models["foliage_tree_palm_tall_2"]["still"] = %palmtree_tall2_still;
level.anim_prop_models["foliage_tree_palm_tall_2"]["strong"] = %palmtree_tall2_sway;
level.anim_prop_models["foliage_tree_palm_bushy_3"]["still"] = %palmtree_bushy3_still;
level.anim_prop_models["foliage_tree_palm_bushy_3"]["strong"] = %palmtree_bushy3_sway;
level.anim_prop_models["foliage_tree_palm_med_1"]["still"] = %palmtree_med1_still;
level.anim_prop_models["foliage_tree_palm_med_1"]["strong"] = %palmtree_med1_sway;
level.anim_prop_models["foliage_tree_palm_tall_1"]["still"] = %palmtree_tall1_still;
level.anim_prop_models["foliage_tree_palm_tall_1"]["strong"] = %palmtree_tall1_sway;
}
when i try to load my map i get an error that "generic" isnt specified.
my guess is that i need to enter some keys in radiant on the actor or nodes to let the engine know when to use the animation. |
 |
|
|
| tomalla |
 |
General Member Since: Jan 16, 2007 Posts: 393 Last: Jun 10, 2012 [view latest posts] |
|
|
 |
|
|
| HyBr!d |
General Member Since: Sep 26, 2004 Posts: 560 Last: Sep 25, 2015 [view latest posts] |
|
|
|
Category: CoD4 SP Mapping Posted: Monday, Feb. 2, 2009 10:13 pm |
 |
nope i didn't define anything yet, either in my main script or in editor.
but here is my main .gsc:
Code:
#include maps\_utility;
#include common_scripts\utility;
#include maps\_anim;
main()
{
level.weaponClipModels = [];
level.weaponClipModels[0] = "weapon_m16_clip";
level.weaponClipModels[1] = "weapon_dragunov_clip";
level.weaponClipModels[2] = "weapon_ak47_clip";
level.weaponClipModels[3] = "weapon_g36_clip";
level.weaponClipModels[4] = "weapon_ak74u_clip";
level.weaponClipModels[5] = "weapon_mp5_clip";
maps\_load::main();
maps\sp_intrusion_anim::anim_main();
//GIVE PLAYER WEAPONS
level.player takeallweapons(); // this is so you dont get the mp5 in your loadout
level.player giveWeapon( "m14_scoped_silencer" ); // put weapon class in the commas
level.player giveMaxAmmo( "m14_scoped_silencer" ); // gives max ammo
level.player giveWeapon( "usp_silencer" );
level.player switchtoWeapon( "usp_silencer" ); //pull out this weapn hen level starts
level.player giveWeapon( "fraggrenade" ); // obviously gives grenades
level.player giveWeapon( "flash_grenade" ); // use for flas/stun, smoke
level.player setOffhandSecondaryClass( "flash" );
level.player setViewmodel( "viewhands_black_kit" ); //hands model
battlechatter_off( "allies" );
battlechatter_off( "axis" );
}
|
 |
|
|
| voidsource |
General Member Since: May 5, 2007 Posts: 1513 Last: Sep 1, 2013 [view latest posts] |
|
|
|
Category: CoD4 SP Mapping Posted: Tuesday, Feb. 3, 2009 04:45 am |
 |
i know that if you want some actor to play the xanim u have to get the actor something like
Code:
guy1 = getent("name_of_guy","targetname");//defines who the actor is in the radiant. guy1 is his nickname u can name it w/e u want.
guy1.animname = "bored";// the animname u want to give the actor. Could be anything u want.
node1 = getnode("name_of_node","targetname");// Define a single node on the radiant. node1 is the nickname which u can name it w/e u want.
guy1 setgoalnode(node1);//tells him his goal is node1
guy1 waittill("goal");// waits till he reaches node1
node1 anim_reach_solo(guy1,"standing_bored");
node1 anim_single_solo(guy1,"standing_bored");//plays the xanim at node1 location.
then in ur mapname_anim.gsc ur suppose to have something like
Code:
level.scr_anim[ "bored" ][ "standing_bored" ] = %patrolstand_twitch;
"guy1" could be any nickname u want to give him(the actor). The same for "node1" that could be any nickname u want to give(the node).
Code:
level.scr_anim["the_actors.animname_goes_here"]["the_nickname_of_the_actor_action"] = %The_actual_xanim;
node1 anim_single_solo(actor_nickname, "nickname_the_actor_action");
thats pretty much how it works.
hope it helps.
forgot to mention something quite important. If you want to see wat animation goes with wat animtree take a look at the "animtrees" folder inside the "raw" folder. The "generic_human" type is the one that is mostly used for the animations for all actors. if you open the "generic_human.atr" with notepad u can see the list of xanims that u can use for it. This comes in handy for when u want to know wat u can and cant use for ur animations.
edited on Feb. 2, 2009 11:49 pm by voidsource |
|
|
|
| HyBr!d |
General Member Since: Sep 26, 2004 Posts: 560 Last: Sep 25, 2015 [view latest posts] |
|
|
|
Category: CoD4 SP Mapping Posted: Tuesday, Feb. 3, 2009 12:50 pm |
 |
thanks for the help! i did as you said, but i still get the same error:
Quote: undefined is not an array, string, or vector: (file 'maps/_utility.gsc', line 6328)
assertEx( isdefined( level.scr_anim[ "generic" ][ anime ] ), "Tried to set generic run anim but the anim was not defined in the maps _anim file" );
main.gsc:
Code:
#include maps\_utility;
#include common_scripts\utility;
#include maps\_anim;
main()
{
level.weaponClipModels = [];
level.weaponClipModels[0] = "weapon_m16_clip";
level.weaponClipModels[1] = "weapon_dragunov_clip";
level.weaponClipModels[2] = "weapon_ak47_clip";
level.weaponClipModels[3] = "weapon_g36_clip";
level.weaponClipModels[4] = "weapon_ak74u_clip";
level.weaponClipModels[5] = "weapon_mp5_clip";
maps\_load::main();
maps\sp_intrusion_anim::main();
//GIVE PLAYER WEAPONS
level.player takeallweapons(); // this is so you dont get the mp5 in your loadout
level.player giveWeapon( "m14_scoped_silencer" ); // put weapon class in the commas
level.player giveMaxAmmo( "m14_scoped_silencer" ); // gives max ammo
level.player giveWeapon( "usp_silencer" );
level.player switchtoWeapon( "usp_silencer" ); //pull out this weapn hen level starts
level.player giveWeapon( "fraggrenade" ); // obviously gives grenades
level.player giveWeapon( "flash_grenade" ); // use for flas/stun, smoke
level.player setOffhandSecondaryClass( "flash" );
level.player setViewmodel( "viewhands_black_kit" ); //hands model
battlechatter_off( "allies" );
battlechatter_off( "axis" );
guy1 = getent("guy1","script_noteworthy");//defines who the actor is in the radiant. guy1 is his nickname u can name it w/e u want.
guy1.animname = "bored";// the animname u want to give the actor. Could be anything u want.
node1 = getnode("bored","targetname");// Define a single node on the radiant. node1 is the nickname which u can name it w/e u want.
guy1 setgoalnode(node1);//tells him his goal is node1
guy1 waittill("goal");// waits till he reaches node1
node1 anim_reach_solo(guy1,"standing_bored");
node1 anim_single_solo(guy1,"standing_bored");//plays the xanim at node1 location.
guy2 = getent("guy2","script_noteworthy");
guy2.animname = "bored1";
node2 = getnode("bored1","targetname");
guy2 setgoalnode(node2);
guy2 waittill("goal");
node2 anim_reach_solo(guy2,"standing_bored1");
node2 anim_single_solo(guy2,"standing_bored1");
}
_anim.gsc:
Code: #include maps\_utility;
#include common_scripts\utility;
#include maps\_anim;
main()
{
anim_main();
animated_model_setup();
}
#using_animtree("generic_human");
anim_main()
{
level.scr_anim[ "axis" ][ "bored" ] = %patrolstand_twitch;
level.scr_anim[ "axis" ][ "bored1" ] = %patrolstand_idle;
}
#using_animtree( "animated_props" );
animated_model_setup()
{
level.anim_prop_models["foliage_tree_palm_tall_3"]["still"] = %palmtree_tall3_still;
level.anim_prop_models["foliage_tree_palm_tall_3"]["strong"] = %palmtree_tall3_sway;
level.anim_prop_models["foliage_tree_palm_med_2"]["still"] = %palmtree_med2_still;
level.anim_prop_models["foliage_tree_palm_med_2"]["strong"] = %palmtree_med2_sway;
level.anim_prop_models["foliage_tree_palm_bushy_1"]["still"] = %palmtree_bushy1_still;
level.anim_prop_models["foliage_tree_palm_bushy_1"]["strong"] = %palmtree_bushy1_sway;
level.anim_prop_models["foliage_tree_palm_bushy_2"]["still"] = %palmtree_bushy2_still;
level.anim_prop_models["foliage_tree_palm_bushy_2"]["strong"] = %palmtree_bushy2_sway;
level.anim_prop_models["foliage_tree_palm_tall_2"]["still"] = %palmtree_tall2_still;
level.anim_prop_models["foliage_tree_palm_tall_2"]["strong"] = %palmtree_tall2_sway;
level.anim_prop_models["foliage_tree_palm_bushy_3"]["still"] = %palmtree_bushy3_still;
level.anim_prop_models["foliage_tree_palm_bushy_3"]["strong"] = %palmtree_bushy3_sway;
level.anim_prop_models["foliage_tree_palm_med_1"]["still"] = %palmtree_med1_still;
level.anim_prop_models["foliage_tree_palm_med_1"]["strong"] = %palmtree_med1_sway;
level.anim_prop_models["foliage_tree_palm_tall_1"]["still"] = %palmtree_tall1_still;
level.anim_prop_models["foliage_tree_palm_tall_1"]["strong"] = %palmtree_tall1_sway;
}
Couldn't use a targetname on the actors cause they already had one used by the spawner_trigger. I used script_noteworthy instead. Further i tried "axis" (used in defend_village_anim.gsc for the patrol_walk) and "generic" but both give the same error.
|
 |
|
|
| tomalla |
 |
General Member Since: Jan 16, 2007 Posts: 393 Last: Jun 10, 2012 [view latest posts] |
|
|
 |
|
|
| HyBr!d |
General Member Since: Sep 26, 2004 Posts: 560 Last: Sep 25, 2015 [view latest posts] |
|
|
|
Category: CoD4 SP Mapping Posted: Tuesday, Feb. 3, 2009 01:06 pm |
 |
ok this is driving me mad
i changed as you said:
i have now this in my anim:
Code: level.scr_anim[ "bored" ][ "bored_idle" ][ 0 ] = %patrol_bored_idle;
level.scr_anim[ "bored" ][ "bored_idle" ][ 1 ] = %patrol_bored_twitch_bug;
level.scr_anim[ "bored" ][ "bored_idle" ][ 2 ] = %patrol_bored_twitch_stretch;
changed "axis" to "bored", called it right in my main script:
Quote: guy1 = getent("guy1","script_noteworthy");//defines who the actor is in the radiant. guy1 is his nickname u can name it w/e u want.
guy1.animname = "bored";// the animname u want to give the actor. Could be anything u want.
node1 = getnode("bored","targetname");// Define a single node on the radiant. node1 is the nickname which u can name it w/e u want.
guy1 setgoalnode(node1);//tells him his goal is node1
guy1 waittill("goal");// waits till he reaches node1
node1 anim_reach_solo(guy1,"bored_idle");
node1 anim_single_solo(guy1,"bored_idle");//plays the xanim at node1 location.
and yet i still get the exact same error!
edited on Feb. 3, 2009 08:08 am by HyBr!d |
 |
|
|
| RollinHard |
General Member Since: Jun 7, 2006 Posts: 24 Last: Feb 22, 2010 [view latest posts] |
|
|
|
|
|
|
mp_TempleCall of Duty: Mods: Multiplayer (624.12Kb)
|