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

[Powerup] Random Perk

broken avatar :(
Created 9 years ago
by DidUknowiPwn
0 Members and 1 Guest are viewing this topic.
10,916 views
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
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.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Hey guys another small script/powerup for you guys, this basically took like no effort at all. So, hope you guys will enjoy/use it and thanks for actually adding more content into your map.

Model: Below in the Attachment Section
Extract to WaW root in AssMan convert the material and then the model.

Next up the scripts
_zombiemode_powerups.gsc
init_powerups()
(Add after your last powerup.)
Code Snippet
Plaintext
add_zombie_powerup( "perk",  		"zombie_bottle",	&"ZOMBIE_POWERUP_MAX_AMMO");

special_drop_setup()
Code Snippet
Plaintext
	//MM test  Change this if you want the same thing to keep spawning
// powerup = "dog";
switch ( powerup )
{
// Don't need to do anything special
case "nuke":
case "insta_kill":
case "double_points":
case "carpenter":
//DUKIP - Added zombie perk.
case "perk":
break;

powerup_grab()
Code Snippet
Plaintext
					case "carpenter":
level thread start_carpenter( self.origin );
players[i] thread powerup_vo("carpenter");
break;
//DUKIP - Added zombie perk
case "perk":
players[i] thread zombie_perk_powerup();
break;

powerup_vo(type)
Code Snippet
Plaintext
	switch(type)
{
case "nuke":
if( vox_rand <= percentage )
{
//sound = "plr_" + index + "_vox_resp_dev_rare_" + rand;
//iprintlnbold( "Whoopdedoo, rare Devil Response line" );
}
else
{
sound = "plr_" + index + "_vox_powerup_nuke_" + rand;
}
break;
case "insta_kill":
if( vox_rand <= percentage )
{
//sound = "plr_" + index + "_vox_resp_dev_rare_" + rand;
//iprintlnbold( "Whoopdedoo, rare Devil Response line" );
}
else
{
sound = "plr_" + index + "_vox_powerup_insta_" + rand;
}
break;
case "full_ammo":
if( vox_rand <= percentage )
{
//sound = "plr_" + index + "_vox_resp_dev_rare_" + rand;
//iprintlnbold( "Whoopdedoo, rare Devil Response line" );
}
else
{
sound = "plr_" + index + "_vox_powerup_ammo_" + rand;
}
break;
case "double_points":
if( vox_rand <= percentage )
{
//sound = "plr_" + index + "_vox_resp_dev_rare_" + rand;
//iprintlnbold( "Whoopdedoo, rare Devil Response line" );
}
else
{
sound = "plr_" + index + "_vox_powerup_double_" + rand;
}
break;
case "carpenter":
if( vox_rand <= percentage )
{
//sound = "plr_" + index + "_vox_resp_dev_rare_" + rand;
//iprintlnbold( "Whoopdedoo, rare Devil Response line" );
}
else
{
sound = "plr_" + index + "_vox_powerup_carp_" + rand;
}
break;
//DUKIP - Add zombie perk, don't do any plr vox sounds.
case "perk":
break;
}

Somewhere at the bottom of the GSC paste this in.
Code Snippet
Plaintext
zombie_perk_powerup()
{
self endon("disconnect");

player = self;
perk = getRandomPerk(player);
//DUKIP - Make sure player doesn't have the perk and perk is defined.
if(player HasPerk(perk) || !IsDefined(perk))
{
//DUKIP - 50/50 chance of playing the sound.
if(cointoss())
player PlayLocalSound("sam_nospawn");
return;
}

//DUKIP - Moved this var to above the perk bottle give as there was a chance of getting "dual" perks.
player.is_drinking = 1;

// do the drink animation
gun = player maps\_zombiemode_perks::perk_give_bottle_begin( perk );

player waittill_any( "fake_death", "death", "player_downed", "weapon_change_complete" );

// restore player controls and movement
player maps\_zombiemode_perks::perk_give_bottle_end( gun, perk );
player.is_drinking = undefined;
// TODO: race condition?
if ( player maps\_laststand::player_is_in_laststand() )
return;

player SetPerk( perk );
player thread maps\_zombiemode_perks::perk_vo(perk);
player setblur( 4, 0.1 );
wait(0.1);
player setblur(0, 0.1);

if(perk == "specialty_armorvest")
{
player.maxhealth = level.zombie_vars["zombie_perk_juggernaut_health"];
player.health = level.zombie_vars["zombie_perk_juggernaut_health"];
}

player maps\_zombiemode_perks::perk_hud_create( perk );

//stat tracking
player.stats["perks"]++;

bbPrint( "zombie_uses: playername %s playerscore %d round %d cost %d name %s x %f y %f z %f type perk",
player.playername, player.score, level.round_number, 0, perk, self.origin );

player thread maps\_zombiemode_perks::perk_think( perk );
}

getRandomPerk(player)
{
//DUKIP - Make sure we're not drinking anything already.
if(IsSubStr(player getCurrentWeapon(), "bottle") || (IsDefined(player.is_drinking) && player.is_drinking))
return;

all_perks = [];
all_perks[0] = "specialty_armorvest";
all_perks[1] = "specialty_quickrevive";
all_perks[2] = "specialty_fastreload";
all_perks[3] = "specialty_rof";
//all_perks[NUM] = "specialty_XXXX";

all_perks = array_randomize(all_perks);

thePerk = random(all_perks);

return thePerk;
}

dlc3_code.gsc
include_powerups()
After last include_powerup() add this:
Code Snippet
Plaintext
include_powerup( "perk" );



That's it, enjoy!
Last Edit: February 28, 2015, 09:43:33 pm by DidUknowiPwn
broken avatar :(
×
broken avatar :(
Senpai
Location: us
Date Registered: 28 September 2013
Last active: 3 years ago
Posts
605
Respect
Forum Rank
Zombie Enslaver
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
arceus's Groups
Box Mappers Elite
Box Mappers Elite
arceus's Contact & Social LinksarceusNT
nice, but i would have made it choose out of perks the player doesnt have instead of if they have the perk it selects they get nothing, aswell i would have removed the drink animation.
Last Edit: February 28, 2015, 10:01:17 pm by arceus
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
×
DidUknowiPwn's Groups
UGX Team Member
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.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
nice, but i would have made it choose out of perks the player doesnt have instead of if they have the perk it selects they get nothing, aswell i would have removed the drink animation.
To me at least, you shouldn't be able to get a perk "all" the time and the drinking I thought should be done based on how you normally get a perk. Why shouldn't it be the same thing?
I mean like it's not even hard to remove both things

For removing current perks just get a list of all the perks you have then remove them using array_remove
For the weapon grabbing just remove the perk bottle/give end (or just make it do the setPerk and the perk_hud_create and increment the stats var on player oh and the perk_think)
Last Edit: February 28, 2015, 10:18:15 pm by DidUknowiPwn
broken avatar :(
×
broken avatar :(
Location: usindiana
Date Registered: 8 December 2013
Last active: 8 years ago
Posts
235
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
tannnnnaiirrr's Groups
what do I need to add if I have BO perks? I already added the "specialty list to the bottom of the GSC along with the stock perks, but once I get in game, the shaders are invisible. Some perks work, but one in specific like Mule Kick, instead of giving me 3 weapons, it takes my other gun, and disables my player to buy things, sprint, knife, etc

Also, I didn't really wanna fuck around with the xmodel you included, so I just made my own "golden powerup perk bottle" and gave it the same name that you made yours "zombie_bottle" but once I get in game it is invisible
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
×
DidUknowiPwn's Groups
UGX Team Member
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.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Well if they're using perks like a normal person would then it's just adding the perk to getRandomPerk(player) all_perk array.
And the model I don't know you have to match the model name to be the same.
broken avatar :(
×
broken avatar :(
Senpai
Location: us
Date Registered: 28 September 2013
Last active: 3 years ago
Posts
605
Respect
Forum Rank
Zombie Enslaver
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
arceus's Groups
Box Mappers Elite
Box Mappers Elite
arceus's Contact & Social LinksarceusNT
To me at least, you shouldn't be able to get a perk "all" the time and the drinking I thought should be done based on how you normally get a perk. Why shouldn't it be the same thing?
I mean like it's not even hard to remove both things

For removing current perks just get a list of all the perks you have then remove them using array_remove
For the weapon grabbing just remove the perk bottle/give end (or just make it do the setPerk and the perk_hud_create and increment the stats var on player oh and the perk_think)
yeah i know it is easy, i was just giving my opinion.
broken avatar :(
×
broken avatar :(
Face to Face
Location: chSomwhere
Date Registered: 6 October 2013
Last active: 11 months ago
Posts
949
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
Signature
Maya <3

Let's Play some osu!
×
MrDunlop4's Groups
MrDunlop4's Contact & Social LinksNelielexy0Nelielexy0CSMrDunlop4NelieleyNelielexy0Nelielexy0
Wow Thats Nice.

Thanks dude

MtDunlop4
broken avatar :(
×
broken avatar :(
Location: usindiana
Date Registered: 8 December 2013
Last active: 8 years ago
Posts
235
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
tannnnnaiirrr's Groups
Well if they're using perks like a normal person would then it's just adding the perk to getRandomPerk(player) all_perk array.
And the model I don't know you have to match the model name to be the same.
that is what I did
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
×
DidUknowiPwn's Groups
UGX Team Member
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.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
that is what I did
Paste in code tags your _zombiemode_perks.gsc _zombiemode_powerups.gsc and dlc3_code.gsc
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 7 March 2014
Last active: 2 months ago
Posts
1,191
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Site Moderator
My Groups
More
My Contact & Social Links
More
×
MZslayer11's Groups
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
MZslayer11's Contact & Social LinksMZslayer11Service_Code_30#2655
Would it be possible to have a powerup that gives you a perk slot when you pick it up? You start with 4 perk limit and every time you pick up the drop it adds a slot. Also have a perk limit counter in the top left corner.
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
×
DidUknowiPwn's Groups
UGX Team Member
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.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Would it be possible to have a powerup that gives you a perk slot when you pick it up? You start with 4 perk limit and every time you pick up the drop it adds a slot. Also have a perk limit counter in the top left corner.
That's an easy modification, just gut out the main function and just increase the "player variable" that you have on player for amount of perks you can set.

Counter in corner: Use setText for main text like "Perk Amount: " and then use setValue("player variable" for amount of perks), best way to do it.
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
^^

Ive actually already implemented this into my dig spots script, want me to share?
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
×
DidUknowiPwn's Groups
UGX Team Member
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.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
^^

Ive actually already implemented this into my dig spots script, want me to share?
Share with him in private I guess, it can differ between player's scripts. I'd make a global one but I'd have to modify a lot of files.
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
well, I meant I would taylor it to "be" generic.

TBH there really wasnt that much involved in doing it. I just added two properties to the players

perks_max
current_perks

and added to the perk machine triggers

Code Snippet
Plaintext
if (player.current_perk >= player.current_perks)
{
     continue;
}

and then added

Code Snippet
Plaintext
player.max_perks++

Into the grab function for the perk bottle

quite easy really, easy to adapt

EDIT

Oh and of course add into the player downed function in _laststand.gsc

Code Snippet
Plaintext
player.current_perks = 0;
Last Edit: March 05, 2015, 05:53:31 am by Harry Bo21

 
Loading ...