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

[User Tutorial] Mule Kick fix for Bamskater33's BO Perks

broken avatar :(
Created 10 years ago
by JR-Imagine
0 Members and 1 Guest are viewing this topic.
5,840 views
broken avatar :(
×
broken avatar :(
Location: be
Date Registered: 17 August 2013
Last active: 2 years ago
Posts
369
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
Web & Software Developer and Designer
Signature
"Deleted code is debugged code." - Jeff Sickel
"Mathematicians stand on each others' shoulders and computer scientists stand on each others' toes." - Richard Hamming
×
JR-Imagine's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Here is a script I wrote for the GCZ Script Placer that gives you a fully functional Mule Kick! Just like in BO and BO2 it won't give you any dumb extra weapons but just increase your inventory size to 3.

This tutorial assumes you already have bam's perks installed! If you don't: http://www.zombiemodding.com/index.php?topic=10345.0
This is for stock maps only! If you want your Mule Kick fixed with a UGX Mod map: http://ugx-mods.com/forum/index.php?topic=1146.0

Ok so first off, you're gonna need the following files:
  • _laststand.gsc
  • _zombiemode_perks_black_ops.gsc
  • _zombiemode_weapons.gsc
If any of the above mentioned files is not in your "root/mods/mapname/maps" folder then copy it from "root/raw/maps".

Now onto the fun part, scripting. :)

The first file we are going to edit is _laststand.gsc, open it with any text editor and search for this:
Code Snippet
Plaintext
PlayerLastStand( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration )
{
if( sMeansOfDeath == "MOD_CRUSH" ) // if getting run over by a tank then kill the guy even if in laststand
{
if( self player_is_in_laststand() )
{
self mission_failed_during_laststand( self );
}
return;
}

if( self player_is_in_laststand() )
{
return;
}

//CODER_MOD: TOMMYK 06/26/2008 - For coop scoreboards
self.downs++;
//stat tracking
self.stats["downs"] = self.downs;
dvarName = "player" + self GetEntityNumber() + "downs";
setdvar( dvarName, self.downs );

//PI CHANGE: player shouldn't be able to jump while in last stand mode (only was a problem in water) - specifically disallow this
if (IsDefined(level.script) && level.script == "nazi_zombie_sumpf")
self AllowJump(false);
//END PI CHANGE

if( IsDefined( level.playerlaststand_func ) )
{
[[level.playerlaststand_func]]();
}

//CODER_MOD: Jay (6/18/2008): callback to challenge system
maps\_challenges_coop::doMissionCallback( "playerDied", self );

if ( !laststand_allowed( sWeapon, sMeansOfDeath, sHitLoc ) )
{
self mission_failed_during_laststand( self );
return;
}

// check for all players being in last stand
if ( player_all_players_in_laststand() )
{
self mission_failed_during_laststand( self );
return;
}

// vision set
self VisionSetLastStand( "laststand", 1 );

self.health = 1;

self thread maps\_arcademode::arcadeMode_player_laststand();

// revive trigger
self revive_trigger_spawn();

// laststand weapons
self laststand_take_player_weapons();
self laststand_give_pistol();
self thread laststand_give_grenade();

// AI
self.ignoreme = true;

// bleed out timer
self thread laststand_bleedout( GetDvarFloat( "player_lastStandBleedoutTime" ) );

self notify( "player_downed" );
}

Replace the whole function with this:
Code Snippet
Plaintext
PlayerLastStand( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration )
{
primaryWeapons = self GetWeaponsListPrimaries();
    if(primaryWeapons.size == 3) // he has three weapons
    {
current_weapon = self getCurrentWeapon(); // get his current weapon
player_load = self GetWeaponsListPrimaries();
if (current_weapon == primaryWeapons[2])
{
self.take_weapon = player_load[1];
self takeweapon(self.take_weapon);
}
else
{
self.take_weapon = player_load[2];
self takeweapon(self.take_weapon);
}
    }

if( sMeansOfDeath == "MOD_CRUSH" ) // if getting run over by a tank then kill the guy even if in laststand
{
if( self player_is_in_laststand() )
{
self mission_failed_during_laststand( self );
}
return;
}

if( self player_is_in_laststand() )
{
return;
}

//CODER_MOD: TOMMYK 06/26/2008 - For coop scoreboards
self.downs++;
//stat tracking
self.stats["downs"] = self.downs;
dvarName = "player" + self GetEntityNumber() + "downs";
setdvar( dvarName, self.downs );

//PI CHANGE: player shouldn't be able to jump while in last stand mode (only was a problem in water) - specifically disallow this
if (IsDefined(level.script) && level.script == "nazi_zombie_sumpf")
self AllowJump(false);
//END PI CHANGE

if( IsDefined( level.playerlaststand_func ) )
{
[[level.playerlaststand_func]]();
}

//CODER_MOD: Jay (6/18/2008): callback to challenge system
maps\_challenges_coop::doMissionCallback( "playerDied", self );

if ( !laststand_allowed( sWeapon, sMeansOfDeath, sHitLoc ) )
{
self mission_failed_during_laststand( self );
return;
}

// check for all players being in last stand
if ( player_all_players_in_laststand() )
{
self mission_failed_during_laststand( self );
return;
}

// vision set
self VisionSetLastStand( "laststand", 1 );

self.health = 1;

self thread maps\_arcademode::arcadeMode_player_laststand();

// revive trigger
self revive_trigger_spawn();

// laststand weapons
self laststand_take_player_weapons();
self laststand_give_pistol();
self thread laststand_give_grenade();

// AI
self.ignoreme = true;

// bleed out timer
self thread laststand_bleedout( GetDvarFloat( "player_lastStandBleedoutTime" ) );

self notify( "player_downed" );
}

That's it for _laststand.gsc, now open up _zombiemode_perks_black_ops.gsc. Add this to the bottom of the file:
Code Snippet
Plaintext
bo_perks_thread()
{
players = getplayers();
for(i=0;i<players.size;i++)
{
players[i] thread staminup();
players[i] thread deadshot();
players[i] thread mulekick();
}
}

staminup()
{
while(1)
{
if(self hasperk("specialty_longersprint"))
self setmovespeedscale(1.15);
else
self setmovespeedscale(1);
wait .5;
}
}

deadshot()
{
while(1)
{
if(self hasperk("specialty_bulletaccuracy"))
self setClientDvar( "cg_laserForceOn", 1 );
else
self setClientDvar( "cg_laserForceOn", 0 );
wait .1;
}
}

mulekick()
{
while(1)
{
if(self hasperk("specialty_extraammo"))
self.inventorySize = 3;
else
self.inventorySize = 2;
wait .1;
}
}

In _zombiemode_weapons.gsc, look for this:
Code Snippet
Plaintext
treasure_chest_give_weapon( weapon_string )
{
primaryWeapons = self GetWeaponsListPrimaries();
current_weapon = undefined;

if( self HasWeapon( weapon_string ) )
{
self GiveMaxAmmo( weapon_string );
self SwitchToWeapon( weapon_string );
return;
}

// This should never be true for the first time.
if( primaryWeapons.size >= 2 ) // he has two weapons
{
current_weapon = self getCurrentWeapon(); // get hiss current weapon

if ( current_weapon == "mine_bouncing_betty" )
{
current_weapon = undefined;
}

if( isdefined( current_weapon ) )
{
if( !( weapon_string == "fraggrenade" || weapon_string == "stielhandgranate" || weapon_string == "molotov" || weapon_string == "zombie_cymbal_monkey" ) )
{
// PI_CHANGE_BEGIN
// JMA - player dropped the tesla gun
if( isDefined(level.script) && (level.script == "nazi_zombie_sumpf" || level.script == "nazi_zombie_factory") )
{
if( current_weapon == "tesla_gun" )
{
level.player_drops_tesla_gun = true;
}
}
// PI_CHANGE_END

self TakeWeapon( current_weapon );
}
}
}

if( IsDefined( primaryWeapons ) && !isDefined( current_weapon ) )
{
for( i = 0; i < primaryWeapons.size; i++ )
{
if( primaryWeapons[i] == "zombie_colt" )
{
continue;
}

if( weapon_string != "fraggrenade" && weapon_string != "stielhandgranate" && weapon_string != "molotov" && weapon_string != "zombie_cymbal_monkey" )
{
// PI_CHANGE_BEGIN
// JMA - player dropped the tesla gun
if( isDefined(level.script) && (level.script == "nazi_zombie_sumpf" || level.script == "nazi_zombie_factory") )
{
if( primaryWeapons[i] == "tesla_gun" )
{
level.player_drops_tesla_gun = true;
}
}
// PI_CHANGE_END

self TakeWeapon( primaryWeapons[i] );
}
}
}

self play_sound_on_ent( "purchase" );

if( weapon_string == "molotov" || weapon_string == "molotov_zombie" )
{
// PI_CHANGE_BEGIN
// JMA 051409 sanity check to see if we have the weapon before we remove it
has_weapon = self HasWeapon( "zombie_cymbal_monkey" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "zombie_cymbal_monkey" );
}
// PI_CHANGE_END
}
if( weapon_string == "zombie_cymbal_monkey" )
{
// PI_CHANGE_BEGIN
// JMA 051409 sanity check to see if we have the weapon before we remove it
has_weapon = self HasWeapon( "molotov" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "molotov" );
}

if( isDefined(level.zombie_weapons) && isDefined(level.zombie_weapons["molotov_zombie"]) )
{
has_weapon = self HasWeapon( "molotov_zombie" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "molotov_zombie" );
}
}
// PI_CHANGE_END

self maps\_zombiemode_cymbal_monkey::player_give_cymbal_monkey();
play_weapon_vo(weapon_string);
return;
}

self GiveWeapon( weapon_string, 0 );
self GiveMaxAmmo( weapon_string );
self SwitchToWeapon( weapon_string );

play_weapon_vo(weapon_string);

// self playsound (level.zombie_weapons[weapon_string].sound);
}

And replace the whole function with:
Code Snippet
Plaintext
treasure_chest_give_weapon( weapon_string )
{
primaryWeapons = self GetWeaponsListPrimaries();
current_weapon = undefined;

if( self HasWeapon( weapon_string ) )
{
self GiveMaxAmmo( weapon_string );
self SwitchToWeapon( weapon_string );
return;
}

// This should never be true for the first time.
if( (self.inventorySize == 2) && (primaryWeapons.size == 2) ) // he has two weapons
{
current_weapon = self getCurrentWeapon(); // get his current weapon

if ( current_weapon == "mine_bouncing_betty" )
{
current_weapon = undefined;
}

if( isdefined( current_weapon ) )
{
if( !( weapon_string == "fraggrenade" || weapon_string == "stielhandgranate" || weapon_string == "molotov" || weapon_string == "zombie_cymbal_monkey" ) )
{
// PI_CHANGE_BEGIN
// JMA - player dropped the tesla gun
if( isDefined(level.script) && (level.script == "nazi_zombie_sumpf" || level.script == "nazi_zombie_factory") )
{
if( current_weapon == "tesla_gun" )
{
level.player_drops_tesla_gun = true;
}
}
// PI_CHANGE_END

self TakeWeapon( current_weapon );
}
}
}

if( (self.inventorySize == 3) && (primaryWeapons.size == 3) ) // he has three weapons
{
current_weapon = self getCurrentWeapon(); // get his current weapon

if ( current_weapon == "mine_bouncing_betty" )
{
current_weapon = undefined;
}

if( isdefined( current_weapon ) )
{
if( !( weapon_string == "fraggrenade" || weapon_string == "stielhandgranate" || weapon_string == "molotov" || weapon_string == "zombie_cymbal_monkey" ) )
{
// PI_CHANGE_BEGIN
// JMA - player dropped the tesla gun
if( isDefined(level.script) && (level.script == "nazi_zombie_sumpf" || level.script == "nazi_zombie_factory") )
{
if( current_weapon == "tesla_gun" )
{
level.player_drops_tesla_gun = true;
}
}
// PI_CHANGE_END

self TakeWeapon( current_weapon );
}
}
}

self play_sound_on_ent( "purchase" );

if( weapon_string == "molotov" || weapon_string == "molotov_zombie" )
{
// PI_CHANGE_BEGIN
// JMA 051409 sanity check to see if we have the weapon before we remove it
has_weapon = self HasWeapon( "zombie_cymbal_monkey" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "zombie_cymbal_monkey" );
}
// PI_CHANGE_END
}
if( weapon_string == "zombie_cymbal_monkey" )
{
// PI_CHANGE_BEGIN
// JMA 051409 sanity check to see if we have the weapon before we remove it
has_weapon = self HasWeapon( "molotov" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "molotov" );
}

if( isDefined(level.zombie_weapons) && isDefined(level.zombie_weapons["molotov_zombie"]) )
{
has_weapon = self HasWeapon( "molotov_zombie" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "molotov_zombie" );
}
}
// PI_CHANGE_END

self maps\_zombiemode_cymbal_monkey::player_give_cymbal_monkey();
play_weapon_vo(weapon_string);
return;
}

self GiveWeapon( weapon_string, 0 );
self GiveMaxAmmo( weapon_string );
self SwitchToWeapon( weapon_string );

play_weapon_vo(weapon_string);

// self playsound (level.zombie_weapons[weapon_string].sound);
}

In that same file, look for:
Code Snippet
Plaintext
weapon_give( weapon, is_upgrade )
{
primaryWeapons = self GetWeaponsListPrimaries();
current_weapon = undefined;

//if is not an upgraded perk purchase
if( !IsDefined( is_upgrade ) )
{
is_upgrade = false;
}

// This should never be true for the first time.
if( primaryWeapons.size >= 2 ) // he has two weapons
{
current_weapon = self getCurrentWeapon(); // get his current weapon

if ( current_weapon == "mine_bouncing_betty" )
{
current_weapon = undefined;
}

if( isdefined( current_weapon ) )
{
if( !( weapon == "fraggrenade" || weapon == "stielhandgranate" || weapon == "molotov" || weapon == "zombie_cymbal_monkey" ) )
{
self TakeWeapon( current_weapon );
}
}
}

if( weapon == "zombie_cymbal_monkey" )
{
// PI_CHANGE_BEGIN
// JMA 051409 sanity check to see if we have the weapon before we remove it
has_weapon = self HasWeapon( "molotov" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "molotov" );
}

if( isDefined(level.zombie_weapons) && isDefined(level.zombie_weapons["molotov_zombie"]) )
{
has_weapon = self HasWeapon( "molotov_zombie" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "molotov_zombie" );
}
}
// PI_CHANGE_END

self maps\_zombiemode_cymbal_monkey::player_give_cymbal_monkey();
play_weapon_vo( weapon );
return;
}
if( (weapon == "molotov" || weapon == "molotov_zombie") )
{
self TakeWeapon( "zombie_cymbal_monkey" );
}

self play_sound_on_ent( "purchase" );
self GiveWeapon( weapon, 0 );
self GiveMaxAmmo( weapon );
self SwitchToWeapon( weapon );

play_weapon_vo(weapon);
}

And replace it with:
Code Snippet
Plaintext
weapon_give( weapon, is_upgrade )
{
primaryWeapons = self GetWeaponsListPrimaries();
current_weapon = undefined;

//if is not an upgraded perk purchase
if( !IsDefined( is_upgrade ) )
{
is_upgrade = false;
}

// This should never be true for the first time.
if( (self.inventorySize == 2) && (primaryWeapons.size == 2) ) // he has two weapons
{
current_weapon = self getCurrentWeapon(); // get his current weapon

if ( current_weapon == "mine_bouncing_betty" )
{
current_weapon = undefined;
}

if( isdefined( current_weapon ) )
{
if( !( weapon == "fraggrenade" || weapon == "stielhandgranate" || weapon == "molotov" || weapon == "zombie_cymbal_monkey" ) )
{
self TakeWeapon( current_weapon );
}
}
}

if( (self.inventorySize == 3) && (primaryWeapons.size == 3) ) // he has three weapons
{
current_weapon = self getCurrentWeapon(); // get his current weapon

if ( current_weapon == "mine_bouncing_betty" )
{
current_weapon = undefined;
}

if( isdefined( current_weapon ) )
{
if( !( weapon == "fraggrenade" || weapon == "stielhandgranate" || weapon == "molotov" || weapon == "zombie_cymbal_monkey" ) )
{
self TakeWeapon( current_weapon );
}
}
}

if( weapon == "zombie_cymbal_monkey" )
{
// PI_CHANGE_BEGIN
// JMA 051409 sanity check to see if we have the weapon before we remove it
has_weapon = self HasWeapon( "molotov" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "molotov" );
}

if( isDefined(level.zombie_weapons) && isDefined(level.zombie_weapons["molotov_zombie"]) )
{
has_weapon = self HasWeapon( "molotov_zombie" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "molotov_zombie" );
}
}
// PI_CHANGE_END

self maps\_zombiemode_cymbal_monkey::player_give_cymbal_monkey();
play_weapon_vo( weapon );
return;
}
if( (weapon == "molotov" || weapon == "molotov_zombie") )
{
self TakeWeapon( "zombie_cymbal_monkey" );
}

self play_sound_on_ent( "purchase" );

self GiveWeapon( weapon, 0 );
self GiveMaxAmmo( weapon );
self SwitchToWeapon( weapon );

play_weapon_vo(weapon);
}

Now for the last step, remove anything related to bam's perks from your mapname.gsc and add this line:
Code Snippet
Plaintext
maps\_zombiemode_perks_black_ops::bo_perks_thread();
UNDER:
Code Snippet
Plaintext
maps\_zombiemode::main();
So it looks like:
Code Snippet
Plaintext
maps\_zombiemode::main();
maps\_zombiemode_perks_black_ops::bo_perks_thread();

That's it, have fun playing around with the working Mule Kick! :)
Last Edit: April 09, 2014, 10:30:22 am by JR-Imagine
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 1 year ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Signature
Hey if you had tons of fun on playing my maps please DONATE :)

play ESTATE now, and claim your mansion back from the undead!
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
jei9363's Contact & Social Linksjei9363jei9363jayingardia
awesome! after I finish my map ill release Black Ops Perks V2 tutorial, with fixed Phd as well
broken avatar :(
×
broken avatar :(
Location: es
Date Registered: 15 August 2013
Last active: 5 years ago
Posts
161
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Community Mapper
My Groups
More
Signature
Enjoy my work? Feel free to donate here to support me

Wanna become a Patron? Try my Patreon Page
×
sethnorris's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
sethnorris's Contact & Social Links
(EDITED) Nope! Works like charm! You're a genius. Me... well... I was messing too much with the scripts. Now work just fine. To complete the fix. Could you port the _on model of the machine and make it so that when power turns on so does the machine? Thanks a lot. I will try to find the original textures however, bamskater is a very good scripter, but he cares not about models, texture resolution and whatever related to... beauty?
Last Edit: January 02, 2014, 03:57:27 pm by sethnorris

 
Loading ...