UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

forcing AI to play an anim

broken avatar :(
Created 9 years ago
by Harry Bo21
0 Members and 1 Guest are viewing this topic.
2,107 views
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Ok, so I was lucky enough to get hold of the Thunderguns knockdown anims

i set them up in zombiemode with this ( found this in the BO1 scripts ) :

Code Snippet
Plaintext
// ====================== THUNDERGUN ============================================
if( !isDefined( level._zombie_knockdowns ) )
{
level._zombie_knockdowns = [];
}
level._zombie_knockdowns["zombie"] = [];
level._zombie_knockdowns["zombie"]["front"] = [];
level._zombie_knockdowns["zombie"]["front"]["no_legs"] = [];
level._zombie_knockdowns["zombie"]["front"]["no_legs"][0] = %ai_zombie_thundergun_hit_armslegsforward;
level._zombie_knockdowns["zombie"]["front"]["no_legs"][1] = %ai_zombie_thundergun_hit_doublebounce;
level._zombie_knockdowns["zombie"]["front"]["no_legs"][2] = %ai_zombie_thundergun_hit_forwardtoface;
level._zombie_knockdowns["zombie"]["front"]["has_legs"] = [];
level._zombie_knockdowns["zombie"]["front"]["has_legs"][0] = %ai_zombie_thundergun_hit_armslegsforward;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][1] = %ai_zombie_thundergun_hit_doublebounce;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][2] = %ai_zombie_thundergun_hit_upontoback;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][3] = %ai_zombie_thundergun_hit_forwardtoface;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][4] = %ai_zombie_thundergun_hit_armslegsforward;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][5] = %ai_zombie_thundergun_hit_forwardtoface;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][6] = %ai_zombie_thundergun_hit_stumblefall;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][7] = %ai_zombie_thundergun_hit_armslegsforward;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][8] = %ai_zombie_thundergun_hit_doublebounce;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][9] = %ai_zombie_thundergun_hit_upontoback;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][10] = %ai_zombie_thundergun_hit_forwardtoface;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][11] = %ai_zombie_thundergun_hit_armslegsforward;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][12] = %ai_zombie_thundergun_hit_forwardtoface;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][13] = %ai_zombie_thundergun_hit_deadfallknee;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][14] = %ai_zombie_thundergun_hit_armslegsforward;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][15] = %ai_zombie_thundergun_hit_doublebounce;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][16] = %ai_zombie_thundergun_hit_upontoback;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][17] = %ai_zombie_thundergun_hit_forwardtoface;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][18] = %ai_zombie_thundergun_hit_armslegsforward;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][19] = %ai_zombie_thundergun_hit_forwardtoface;
level._zombie_knockdowns["zombie"]["front"]["has_legs"][20] = %ai_zombie_thundergun_hit_flatonback;
level._zombie_knockdowns["zombie"]["left"] = [];
level._zombie_knockdowns["zombie"]["left"][0] = %ai_zombie_thundergun_hit_legsout_right;
level._zombie_knockdowns["zombie"]["right"] = [];
level._zombie_knockdowns["zombie"]["right"][0] = %ai_zombie_thundergun_hit_legsout_left;
level._zombie_knockdowns["zombie"]["back"] = [];
level._zombie_knockdowns["zombie"]["back"][0] = %ai_zombie_thundergun_hit_faceplant;
if( !isDefined( level._zombie_getups ) )
{
level._zombie_getups = [];
}
level._zombie_getups["zombie"] = [];
level._zombie_getups["zombie"]["back"] = [];
level._zombie_getups["zombie"]["back"]["early"] = [];
level._zombie_getups["zombie"]["back"]["early"][0] = %ai_zombie_thundergun_getup_b;
level._zombie_getups["zombie"]["back"]["early"][1] = %ai_zombie_thundergun_getup_c;
level._zombie_getups["zombie"]["back"]["late"] = [];
level._zombie_getups["zombie"]["back"]["late"][0] = %ai_zombie_thundergun_getup_b;
level._zombie_getups["zombie"]["back"]["late"][1] = %ai_zombie_thundergun_getup_c;
level._zombie_getups["zombie"]["back"]["late"][2] = %ai_zombie_thundergun_getup_quick_b;
level._zombie_getups["zombie"]["back"]["late"][3] = %ai_zombie_thundergun_getup_quick_c;
level._zombie_getups["zombie"]["belly"] = [];
level._zombie_getups["zombie"]["belly"]["early"] = [];
level._zombie_getups["zombie"]["belly"]["early"][0] = %ai_zombie_thundergun_getup_a;
level._zombie_getups["zombie"]["belly"]["late"] = [];
level._zombie_getups["zombie"]["belly"]["late"][0] = %ai_zombie_thundergun_getup_a;
level._zombie_getups["zombie"]["belly"]["late"][1] = %ai_zombie_thundergun_getup_quick_a;
// ====================== THUNDERGUN ============================================

whcih i placed just under the tesla stuff

then in zombie spawner, in the zombie_spawn_init( animname_set ) i added :

Code Snippet
Plaintext
self.thundergun_knockdown_func = ::zombie_knockdown;

and at the bottom i added :

Code Snippet
Plaintext
// ======================= THUNDERGUN ===========================================
zombie_knockdown( player, gib )
{
if ( gib && !self.gibbed )
{
self.a.gib_ref = random( level.thundergun_gib_refs );
self thread animscripts\death::do_gib();
}
self.thundergun_handle_pain_notetracks = maps\_zombiemode_weap_thundergun::handle_thundergun_pain_notetracks;
self DoDamage( level.zombie_vars["thundergun_knockdown_damage"], player.origin, player );
}
// ======================= THUNDERGUN ===========================================

now, ive set the thundergun to literally only knock them down, im seeing the prints, but its making no difference to what anim they are playing

but i did noticed it "can" knock them over, just only when they are attacking a window and then they freeze?

Code Snippet
Plaintext
thundergun_knockdown_zombie( player, gib )
{
self endon( "death" );
playsoundatposition ("vox_thundergun_forcehit", self.origin);
playsoundatposition ("wpn_thundergun_proj_impact", self.origin);


if( !IsDefined( self ) || !IsAlive( self ) )
{
// guy died on us
return;
}

if ( IsDefined( self.thundergun_knockdown_func ) )
{
self [[ self.thundergun_knockdown_func ]]( player, gib );
}
else
{

self DoDamage( level.zombie_vars["thundergun_knockdown_damage"], player.origin, player );



}

if ( gib )
{
self.a.gib_ref = random( level.thundergun_gib_refs );
self thread animscripts\zombie_death::do_gib();
}

// self playsound( "thundergun_impact" );
self.thundergun_handle_pain_notetracks = ::handle_thundergun_pain_notetracks;
self DoDamage( level.zombie_vars["thundergun_knockdown_damage"], player.origin, player );
self playsound( "fly_thundergun_forcehit" );

}

handle_thundergun_pain_notetracks( note )
{
if ( note == "zombie_knockdown_ground_impact" )
{
playfx( level._effect["thundergun_knockdown_ground"], self.origin, AnglesToForward( self.angles ), AnglesToUp( self.angles ) );
self playsound( "fly_thundergun_forcehit" );
}
}

This is my first time adding animations for AI, could some one help a dude out ;)
Last Edit: July 16, 2015, 06:49:14 am by Harry Bo21
Marked as best answer by Harry Bo21 9 years ago
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
You arent playing the anims anywhere, the Original anims in BO are handled in animscripts\pain. You can have a look in the BO one, i pretty much just copied that over to WaW.
The animscripts\pain.gsc for WaW wasn't in my raw by default, i had to extract it from zone\english\common.ff
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
i have that and have been looking through it, but i have no idea how to use it? lol

i found and took this from it and have been calling this :

Code Snippet
Plaintext
playThundergunPainAnim()
{
iPrintLnBold( "Called Anim" );
self notify( "end_play_thundergun_pain_anim" );
self endon( "killanimscript" );
self endon( "death" );
self endon( "end_play_thundergun_pain_anim" );

if( isDefined( self.marked_for_death ) && self.marked_for_death )
{
return;
}

if ( self.damageYaw <= -135 || self.damageYaw >= 135 )
{
if ( !self.has_legs )
{
fallAnim = random( level._zombie_knockdowns[self.animname]["front"]["no_legs"] );

if ( isdefined( level.thundergun_last_knockdown_anim ) && level.thundergun_last_knockdown_anim == fallAnim )
{
fallAnim = random( level._zombie_knockdowns[self.animname]["front"]["no_legs"] );
}
}
else
{
fallAnim = random( level._zombie_knockdowns[self.animname]["front"]["has_legs"] );

if ( isdefined( level.thundergun_last_knockdown_anim ) && level.thundergun_last_knockdown_anim == fallAnim )
{
fallAnim = random( level._zombie_knockdowns[self.animname]["front"]["has_legs"] );
}
}

level.thundergun_last_knockdown_anim = fallAnim;
if ( fallAnim == %ai_zombie_thundergun_hit_deadfallknee || fallAnim == %ai_zombie_thundergun_hit_forwardtoface )
{
getupAnim = random( level._zombie_getups[self.animname]["belly"]["early"] );
}
else
{
getupAnim = random( level._zombie_getups[self.animname]["back"]["early"] );
}
}
else if ( self.damageYaw > -135 && self.damageYaw < -45 )
{
fallAnim = random( level._zombie_knockdowns[self.animname]["left"] );
getupAnim = random( level._zombie_getups[self.animname]["belly"]["early"] );
}
else if ( self.damageYaw > 45 && self.damageYaw < 135 )
{
fallAnim = random( level._zombie_knockdowns[self.animname]["right"] );
getupAnim = random( level._zombie_getups[self.animname]["belly"]["early"] );
}
else
{
fallAnim = random( level._zombie_knockdowns[self.animname]["back"] );
getupAnim = random( level._zombie_getups[self.animname]["belly"]["early"] );
}

self SetFlaggedAnimKnobAllRestart( "painanim", fallAnim, %body, 1, .2, 1 );
self animscripts\shared::DoNoteTracks( "painanim", self.thundergun_handle_pain_notetracks );

if( !IsDefined( self ) || !IsAlive( self ) || !self.has_legs || (isDefined( self.marked_for_death ) && self.marked_for_death) )
{
// guy died on us
return;
}
if ( getupAnim == %ai_zombie_thundergun_getup_quick_a && (self.a.gib_ref == "left_arm" || self.a.gib_ref == "right_arm") )
{
return;
}

self SetFlaggedAnimKnobAllRestart( "painanim", getupAnim, %body, 1, .2, 1 );
self animscripts\shared::DoNoteTracks( "painanim" );
}
Last Edit: July 16, 2015, 06:51:00 am by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
That should be threaded from the top of the pain.gsc somewhere when pain dealt by the thundergun is detected. Just search for the call to that function, may need to adjust that a bit for it to work
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
wheres the pain.gsc? i have been looking for it all day
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie

The animscripts\pain.gsc for WaW wasn't in my raw by default, i had to extract it from zone\english\common.ff

 ::)
Last Edit: July 16, 2015, 10:56:38 am by BluntStuffy
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 25 June 2013
Last active: 9 months ago
Posts
3,997
Respect
1,024Add +1
Forum Rank
Eviscerator
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
×
HitmanVere's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
I thought you meant thats where you got the Black Ops 1 version which i had been given already

I realize now you mean the cod 5 ff file, all done now, thanks stuffy!

 
Loading ...