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] Custom Perk-Dropping Powerup

broken avatar :(
Created 12 years ago
by ZMBS DON GOONY
0 Members and 1 Guest are viewing this topic.
6,349 views
broken avatar :(
×
broken avatar :(
Date Registered: 14 March 2012
Last active: 11 years ago
Posts
105
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
i love zombies
×
ZMBS DON GOONY's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
ZMBS DON GOONY's Contact & Social LinksZMBS_DON_GOONY
copy _zombiemode_perks from raw/maps to root/mods/mapname/maps

add this at the very bottom
Code Snippet
Plaintext

thegtlad()
{
vending_triggers = GetEntArray( "zombie_vending", "targetname" );

perks = [];
for( i = 0; i < vending_triggers.size; i++ )
{
perk = vending_triggers[i].script_noteworthy;

if ( isdefined ( self.perk_purchased ) && self.perk_purchased == perk )
{
continue;
}

if ( !self HasPerk ( perk ) )
{
perks[ perks.size ] = perk;
}
}

if ( perks.size > 0 )
{
perks = array_randomize( perks );
self SetPerk( perks[0] );
self perk_hud_create( perks[0] );
}
}

copy _zombiemode_powerups from raw/maps to root/mods/mapname/maps
find this
Code Snippet
Plaintext
add_zombie_powerup( "carpenter",  	"zombie_carpenter",	&"ZOMBIE_POWERUP_MAX_AMMO");
and add this under it
Code Snippet
Plaintext
add_zombie_powerup( "gtlad",  	"static_berlin_bread_loaf",	"gtlad");

next find this
Code Snippet
Plaintext
powerup_grab()
and replace that whole function with this one
Code Snippet
Plaintext
powerup_grab()
{
self endon ("powerup_timedout");
self endon ("powerup_grabbed");

while (isdefined(self))
{
players = get_players();

for (i = 0; i < players.size; i++)
{
if (distance (players[i].origin, self.origin) < 64)
{
playfx (level._effect["powerup_grabbed"], self.origin);
playfx (level._effect["powerup_grabbed_wave"], self.origin);

if( IsDefined( level.zombie_powerup_grab_func ) )
{
level thread [[level.zombie_powerup_grab_func]]();
}
else
{
switch (self.powerup_name)
{
case "nuke":
level thread nuke_powerup( self );

/* chrisp - adding powerup VO sounds */
players[i] thread powerup_vo("nuke");
zombies = getaiarray("axis");
players[i].zombie_nuked = get_array_of_closest( self.origin, zombies );
players[i] notify("nuke_triggered");

break;
case "full_ammo":
level thread full_ammo_powerup( self );
players[i] thread powerup_vo("full_ammo");
break;
case "double_points":
level thread double_points_powerup( self );
players[i] thread powerup_vo("double_points");
break;
case "insta_kill":
level thread insta_kill_powerup( self );
players[i] thread powerup_vo("insta_kill");
break;
case "carpenter":
level thread start_carpenter( self.origin );
players[i] thread powerup_vo("carpenter");
break;
case "gtlad":
level thread gtlad_powerup( self );
break;
default:
println ("Unrecognized poweup.");
break;
}
}

wait( 0.1 );

playsoundatposition("powerup_grabbed", self.origin);
self stoploopsound();

self delete();
self notify ("powerup_grabbed");
}
}
wait 0.1;
}
}

next find this
Code Snippet
Plaintext
nuke_flash()
{
players = getplayers();
for(i=0; i<players.size; i ++)
{
players[i] play_sound_2d("nuke_flash");
}
level thread devil_dialog_delay();


fadetowhite = newhudelem();

fadetowhite.x = 0;
fadetowhite.y = 0;
fadetowhite.alpha = 0;

fadetowhite.horzAlign = "fullscreen";
fadetowhite.vertAlign = "fullscreen";
fadetowhite.foreground = true;
fadetowhite SetShader( "white", 640, 480 );

// Fade into white
fadetowhite FadeOverTime( 0.2 );
fadetowhite.alpha = 0.8;

wait 0.5;
fadetowhite FadeOverTime( 1.0 );
fadetowhite.alpha = 0;

wait 1.1;
fadetowhite destroy();
}
and put this under it (this will give whoever picks up the powerup perks when power is turned on)
Code Snippet
Plaintext
gtlad_powerup( drop_item )
{
    PlayFx( drop_item.fx, drop_item.origin );
players = getplayers();
for ( i = 0; i < players.size; i++ )
{
flag_wait( "electricity_on" );

players[i] maps\_zombiemode_perks::thegtlad();

}
}
NOTE: if you want to recieve perks before the power is on then use this one instead
Code Snippet
Plaintext
gtlad_powerup( drop_item )
{
    PlayFx( drop_item.fx, drop_item.origin );
players = getplayers();
for ( i = 0; i < players.size; i++ )
{

players[i] maps\_zombiemode_perks::thegtlad();

}
}

go to raw/maps mapname.gsc find this
Code Snippet
Plaintext
level.DLC3.powerUps =  maps\dlc3_code::include_powerups;

and put this under it
Code Snippet
Plaintext
include_powerup( "gtlad" );

so it looks like this
Code Snippet
Plaintext
level.DLC3.powerUps =  maps\dlc3_code::include_powerups;
include_powerup( "gtlad" );

go to root/zone source mapname.csv and add this at the bottom
Code Snippet
Plaintext
xmodel,static_berlin_bread_loaf

Fully compile map and make sure you select the following in mod builders
_zombiemode_powerups
_zombiemode_perks

THAT'S IT  dance1




CREDIT GOES TO ME AND RAMPAGE_619
broken avatar :(
×
broken avatar :(
Location: usThe North Pole
Date Registered: 12 September 2013
Last active: 10 years ago
Posts
123
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
I have come from the future
Signature
NaviLlicious
×
NaviLlusShore's Groups
NaviLlusShore's Contact & Social LinksTheHubbyNaviLlusShore
It works without It needing the power on but when you set It to wait til electricity Is on It doesn't give you the perks after you turn on the power
broken avatar :(
×
broken avatar :(
Location: usMissouri
Date Registered: 6 August 2013
Last active: 6 months ago
Posts
513
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
My Contact & Social Links
More
Signature
Projects:
Unnamed Project: 5%
Mutliple Downloadable Items for Mappers: (Released after map releases)
×
GerardS0406's Groups
GerardS0406's Contact & Social LinksGerardS0406Gerard0406GerardS0406MrGerard0406
It works without It needing the power on but when you set It to wait til electricity Is on It doesn't give you the perks after you turn on the power
Agreed!

Post Merge: March 25, 2014, 12:44:19 am
How do you add bamskater33's tutorial black ops perks to this
Last Edit: March 25, 2014, 12:44:19 am by GerardS0406
broken avatar :(
×
broken avatar :(
Location: gbsomerset
Date Registered: 2 March 2014
Last active: 11 months ago
Posts
169
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Now you see me, Now you don`t
×
FATKIDSLOV3CAK3's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
FATKIDSLOV3CAK3's Contact & Social LinksHypercaineHypercaineZombies_dieFATKIDSLOV3CAK3
how do you change the drop from a loaf of bread to a perk bottle? been trying for a while and cant work it out

 
Loading ...