
| 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 |
|
|
| Author |
Topic: XANIM Force Animate? |
| olip123 |
General Member Since: Jul 26, 2005 Posts: 55 Last: Nov 27, 2009 [view latest posts] |
|
|
|
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 :(
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] |
|
|
|
|
| jeannotvb |
 |
General Member Since: Dec 8, 2007 Posts: 620 Last: Feb 1, 2010 [view latest posts] |
|
|
 |
|
|
| olip123 |
General Member Since: Jul 26, 2005 Posts: 55 Last: Nov 27, 2009 [view latest posts] |
|
|
|
|
| zeroy |
 |
General Member Since: Nov 26, 2007 Posts: 723 Last: Mar 11, 2010 [view latest posts] |
|
|
|
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] |
|
|
|
|
|
|
|