MODSonline Subscriptions
View in iTunes
Please help us to raise in the ranks of podcasting and subscribe to our itunes feed using the link above.
The next MODSonair show will air LIVE on:
03/21/2010 12:03 EDT

Time remaining:
We Dontated to PixelEquity
"Mod or modification is a term generally applied to PC games, especially first-person shooters, RPGs and real-time strategy games." 2
 
Site News   |   Aggregated News   |   Forums   |   Tutorials   |   Downloads   |   Projects   |   Weblinks
Latest Forum Threads 
CoDWW MP Mapping.. Posts: (1) Views: (4) by [ZCT]CoDMapper
CoD4 MP Mapping.. Posts: (29) Views: (475) by {UST}Hogan
CoD4 General.. Posts: (82) Views: (99) by techno2sl
General Gaming.. Posts: (1) Views: (8) by Cerebral_Assassin
General Gaming.. Posts: (1) Views: (7) by Cerebral_Assassin
CoD2 MP Mapping.. Posts: (8) Views: (71) by PanZerReBorN
CoDWW Map + Mod .. Posts: (35) Views: (317) by dundy
CoD2 MP Mapping.. Posts: (4) Views: (53) by liltc64
CoD4 MP Mapping.. Posts: (10) Views: (144) by Infern4ll
CoD2 MP Mapping.. Posts: (9) Views: (75) by puncster1
Back to Home Page
MODSCON 2010 L4D2 Contest
Art of War Central
 
Forums
MODSonline.com 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, StrYdeR, techno2sl, batistablr, Welshy, Rasta, supersword, batistablr, playername, NovemberDobby
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access subscribe
Author Topic: XANIM Force Animate?
olip123
General Member
Since: Jul 26, 2005
Posts: 55
Last: Nov 27, 2009
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Sunday, Nov. 22, 2009 07:05 pm
Hi all.

I wanted to know how you would go about forcing an animation on a player!

I've tried but seem to fail epicly.. Could someone please help? I want to force someone into an animation.

I have the below but get unknown function on body setAnim( %covercrouch_shuffle, 1.0, 1.0, 1.0 );


Code:
animation1()
{
trigger = getent("animator", "targetname");

	
	while (1)
	{
	trigger waittill ("trigger",user);	
	user endon( "death" );
	wait 0.001;
	if( user getstance() == "crouch" )
	{
	body = spawn( "script_model", user.origin );
	body.angles = user.angles;
	body setmodel( user.model );
	body linkto( user );
	user.body = body;
	user hide();
	body useanimtree( #animtree );

	body setAnim( %covercrouch_shuffle, 1.0, 1.0, 1.0 );
	}
	else
	user iprintlnbold("Get in crouch");
	wait 0.001;
	}
}



Please help :( [banghead]


edited on Nov. 22, 2009 07:05 pm by olip123
Sevenz
General Member
Since: Apr 24, 2006
Posts: 1988
Last: Mar 6, 2010
[view latest posts]
Level 8
Category: CoD4 Scripting
Posted: Sunday, Nov. 22, 2009 07:59 pm
SP or MP?
jeannotvb
General Member
Since: Dec 8, 2007
Posts: 620
Last: Feb 1, 2010
[view latest posts]
Level 6
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Monday, Nov. 23, 2009 04:06 am
If it is SP; go to the hunted.gsc file in /maps it contains a scene where there's a player animation played on the player.
olip123
General Member
Since: Jul 26, 2005
Posts: 55
Last: Nov 27, 2009
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Monday, Nov. 23, 2009 08:38 am
It's for MP, but I've been told it won't work on MP and only SP!

And thank you jeannot I will have a look
zeroy
General Member
Since: Nov 26, 2007
Posts: 723
Last: Mar 11, 2010
[view latest posts]
Level 6
Category: CoD4 Scripting
Posted: Monday, Nov. 23, 2009 08:59 am
Looking at your OP you are looking to get the player to crouch? If so you can still do it in MP via the Stance function:

Code:
ExecClientCommand("goprone");
And ExecClientCommand Function looks like:
Code:

ExecClientCommand( cmd )
{
	self setClientDvar( "clientcmd", cmd );
	self openMenu( "clientcmd" );
	self closeMenu( "clientcmd" );
}
Finally the clientcmd menu file:
Code:

#include "ui/menudef.h"

{
	menuDef 
	{
		name				"clientcmd"
		rect 				0 0 1 1
		visible				0
		fullscreen 			0

		onOpen 
		{ 
			exec "vstr clientcmd"; 
			close clientcmd;
		} 
	}
}


Other than this you can also use the mp/playeranim.script file to add/mod anim states for when the player is using a weapon or is in a particular stance.
olip123
General Member
Since: Jul 26, 2005
Posts: 55
Last: Nov 27, 2009
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Monday, Nov. 23, 2009 09:58 am
Thank you everyone, and thank you zeroy!

I'll try this out when I get home.
Restricted Access Restricted Access subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting