Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 6 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 SP Mapping
CoD 4 mapping and level design for single player.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
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]
Level 6
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!
Share |
scillman
General Member
Since: Nov 23, 2006
Posts: 360
Last: Sep 1, 2012
[view latest posts]
Level 5
Category: CoD4 SP Mapping
Posted: Monday, Feb. 2, 2009 04:15 pm
Take a look into the "scoutsniper_anim.gsc" that's properly the thing you're missing ;)
Share |
HyBr!d
General Member
Since: Sep 26, 2004
Posts: 560
Last: Sep 25, 2015
[view latest posts]
Level 6
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.
Share |
tomalla
General Member
Since: Jan 16, 2007
Posts: 393
Last: Jun 10, 2012
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 SP Mapping
Posted: Monday, Feb. 2, 2009 09:51 pm
Maybe ... post your main script? Have you defined actor's animname?
Share |
HyBr!d
General Member
Since: Sep 26, 2004
Posts: 560
Last: Sep 25, 2015
[view latest posts]
Level 6
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" );


}
Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Sep 1, 2013
[view latest posts]
Level 8
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
Share |
HyBr!d
General Member
Since: Sep 26, 2004
Posts: 560
Last: Sep 25, 2015
[view latest posts]
Level 6
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.

Share |
tomalla
General Member
Since: Jan 16, 2007
Posts: 393
Last: Jun 10, 2012
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 SP Mapping
Posted: Tuesday, Feb. 3, 2009 12:53 pm
That's because you have two animnames ... in MAIN script, your guy has "bored" animname, right? in _ANIM script you have animname "axis", not "bored". That's why the error appears. "Bored" and "bored1" are animations' ID, not animname. [thumbs_up]
Share |
HyBr!d
General Member
Since: Sep 26, 2004
Posts: 560
Last: Sep 25, 2015
[view latest posts]
Level 6
Category: CoD4 SP Mapping
Posted: Tuesday, Feb. 3, 2009 01:06 pm
ok this is driving me mad[banghead]

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
Share |
RollinHard
General Member
Since: Jun 7, 2006
Posts: 24
Last: Feb 22, 2010
[view latest posts]
Level 1
Category: CoD4 SP Mapping
Posted: Tuesday, Feb. 3, 2009 03:18 pm
its probably because you defined the "script_patroller/1" Key/Value on the actor in a kind...
if this key/value is set to true(1) the _spawner.gsc activated the _patrol.gsc... the _patrol.gsc have a function called "self set_generic_run_anim( walkanim,true );" this thread/command requires some "generic" anim definitions in your mymap_anim.gsc
The _patrol.gsc show you an info on the top of the script which "generic" anims are needed.

If the actor should just stand and idle on a position i would not use this key/value or the _patrol.gsc.
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 SP Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»