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 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: SP Unarmed AI
raymens
General Member
Since: Jul 3, 2005
Posts: 198
Last: Aug 22, 2008
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Saturday, Aug. 2, 2008 02:56 pm
I am trying to make Zakhaev unarmed, i removed the gun from his hands but i don't know how to let him use an unarmed_ animation that are located in the xanim folder. Can someone help me with that?

I removed the gun from his hand by using this small line:
Code:
animscripts\shared::placeWeaponOn( self.weapon, "none" )
Share |
Mystic
General Member
Since: Apr 10, 2004
Posts: 6147
Last: Apr 15, 2018
[view latest posts]
Level 10
Forum Moderator
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Saturday, Aug. 2, 2008 02:59 pm
Try;

ai_entity gun_remove();
Share |
raymens
General Member
Since: Jul 3, 2005
Posts: 198
Last: Aug 22, 2008
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Saturday, Aug. 2, 2008 03:10 pm
thanks for the fast reply, it has the same effect as what i had first (alot simpler though). But zakhaev still thinks he is holding his AK74u.
so how can i change his default idle, walk and run animations into the unarmed animations located in xanim
[angryalien]
Share |
raymens
General Member
Since: Jul 3, 2005
Posts: 198
Last: Aug 22, 2008
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Saturday, Aug. 2, 2008 05:18 pm
when i tried to change the animtree of zakhaev ( i'm just messing around [crazy] )
by using this:
Code:

#using_animtree( "civilian" );
zakhaev()
{
level.scr_animtree["zakhaev"] = #animtree;

}

-----------------------

self UseAnimTree( level.scr_animtree["zakhaev"] );




i got an Error:
Code:
cannot change the animtree of classname 'actor_enemy_villian_zakhaev': (file 'maps/test.gsc', line 52)
 self UseAnimTree( level.scr_animtree["zakhaev"] );


edited on Aug. 2, 2008 01:20 pm by raymens
Share |
raymens
General Member
Since: Jul 3, 2005
Posts: 198
Last: Aug 22, 2008
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Friday, Aug. 8, 2008 08:19 am
bump :(
Share |
RollinHard
General Member
Since: Jun 7, 2006
Posts: 24
Last: Feb 22, 2010
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Friday, Aug. 8, 2008 10:34 am
raymens writes...
Quote:

by using this:
Code:

#using_animtree( "civilian" );
zakhaev()
{
level.scr_animtree["zakhaev"] = #animtree;

}
-----------------------
self UseAnimTree( level.scr_animtree["zakhaev"] );


I m not sure but i think these animtrees are used for script_models like doors,chairs or the single arm-model from zakhaev...not for the actor.
other questions..on which entity do you try to play the unarmed animation? script_origin,node,actor? is zakhaev a spawner?
Share |
raymens
General Member
Since: Jul 3, 2005
Posts: 198
Last: Aug 22, 2008
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Friday, Aug. 8, 2008 11:00 am
ok thanks for the reply, i'm trying to play the unarmed animation on one actor, a hostage/vip. which basically is the zakhaev actor but by using a targetname and changing his .team to allies i try to let him look like a vip.
Share |
RollinHard
General Member
Since: Jun 7, 2006
Posts: 24
Last: Feb 22, 2010
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Friday, Aug. 8, 2008 09:55 pm
i dont know if this will work for you because u dont explained the scene around zakhaev...so i would try it in this way with a trigger for the player and a node which play the zakhaev animation if zakhaev trigger this node...there are other ways but i think this one is easier for you

-place the actor in the map
-add a targetname for the actor (e.g. "zakhaev" )
-place a simple "pathnode" on the same position as the actor
-connect the actor to the pathnode(select actor,select node + press W)
-build a "trigger_multiple" or a "trigger_radius" somewhere near the actor and add a targetname like "zak_trig" (this trigger is for the player)


as for scripting(mymap.gsc example only!):


#include maps\_anim;
#include maps\_utility;

#using_animtree( "generic_human" );

main()
{
maps\_load::main();

prepare_zakhaev();
play_zakhaev_anim();
}
prepare_zakhaev()
{
level.zakhaev = getent( "zakhaev", "targetname" ); //define the actor
level.zakhaev.animname = "zak"; //define the animname of the actor
level.zakhaev putGunAway(); //put the gun away(not sure if this will work / called from _utility.gsc)
}
play_zakhaev_anim()
{
level.scr_anim[ "zak" ][ "zakhaev_anim1" ] = %unarmed_cowerstand_react; //should be moved to your mymap_anim.gsc (define the animname,animscene & animfile)

zak_player_trig = getent( "zak_trig", "targetname" ); //define the trigger for the player to start the animation
zak_node = getnode( self.target, "targetname" ); //define the node

zak_player_trig waittill( "trigger" ); //wait till the player hit the trigger
zak_node thread anim_single_solo( level.zakhaev, "zakhaev_anim1" ); //play a single anim on zakhaev
}


If you still have no luck and you are better in scripting take a deeper look into the sniperescape map gsc's.

Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting

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

»