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

[TUT] Stacking perk shaders with Harry's Perks

broken avatar :(
Created 8 years ago
by Scobalula
0 Members and 1 Guest are viewing this topic.
4,932 views
broken avatar :(
×
broken avatar :(
OnionmanVere Bo21
Location: ieu dnt wnt 2 no
Date Registered: 27 September 2013
Last active: 1 year ago
Posts
1,864
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Mapper
My Groups
More
Personal Quote
ok
Signature
Aye mate you don't know me so y don't you shut tf up ok buddy :)

×
Scobalula's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Scobalula's Contact & Social Links

This tutorial is only intended to be used with Harry Bo21's perks.

If you're like me and like to make it possible for players to get all or more than 4 perks sometimes you'll find it can get really cluttered at the bottom with all the perk icons spread across the screen or if you use vertical it can get hard to see them at the side.

My solution was to stack them as seen in the above screenshot, they look really nice and neatly tucked away in the corner and don't hinder the players view or look messy. Go to root\mods\maps and open _zombiemode_perks.gsc in a text editor of some sorts.

Find the function harrybo21_perks_hud_set(), it should look like this:

Code Snippet
Plaintext
harrybo21_perks_hud_set( perk )
{
if ( !isDefined( self.perk_hud ) )
self.perk_hud = [];

hud = NewClientHudElem( self );
hud.perk = perk;
hud.foreground = true;
hud.sort = 1;
hud.hidewheninmenu = false;
hud.alignX = "left";
hud.alignY = "bottom";
hud.horzAlign = "left";
hud.vertAlign = "bottom";
hud.x = self.perk_hud.size * 30;
hud.y = hud.y - 70;
// hud.x = 0; // For vertical shaders
// hud.y = 0 - 70 - ( self.perk_hud.size * 30 ); // For vertical shaders
hud.alpha = 0;
hud SetShader( level.zombie_perks[ perk ].perk_shader , 48, 48 );
hud scaleOverTime( .5, 24, 24 );
hud fadeOverTime( .5 );
hud.alpha = 1;
self.perk_hud[ self.perk_hud.size ] = hud;
}

Change the entire function to this:

Code Snippet
Plaintext
harrybo21_perks_hud_set( perk )
{
if ( !isDefined( self.perk_hud ) )
self.perk_hud = [];

hud = NewClientHudElem( self );
hud.perk = perk;
hud.foreground = true;
hud.sort = 1;
hud.hidewheninmenu = false;
hud.alignX = "left";
hud.alignY = "bottom";
hud.horzAlign = "left";
hud.vertAlign = "bottom";
        hud.x = ( self.perk_hud.size % 4 ) * 30;
        hud.y = hud.y - 70 - ( int( self.perk_hud.size / 4 ) * 30 );
hud.alpha = 0;
hud SetShader( level.zombie_perks[ perk ].perk_shader , 48, 48 );
hud scaleOverTime( .5, 24, 24 );
hud fadeOverTime( .5 );
hud.alpha = 1;
self.perk_hud[ self.perk_hud.size ] = hud;
}

Now find the function harrybo21_perks_mule_kick_hud_effect(), it should look like this:

Code Snippet
Plaintext

harrybo21_perks_mule_kick_hud_effect()
{
perk_index = self harrybo21_perks_get_hud_index( "specialty_extraammo" );
if ( !isDefined( perk_index ) )
return;

self endon( "disconnect" );
self endon( "lost_specialty_extraammo" );
self endon( "death" );
self.mule_glow_hud = NewClientHudElem( self );
self.mule_glow_hud.foreground = true;
self.mule_glow_hud.sort = 1;
self.mule_glow_hud.hidewheninmenu = false;
self.mule_glow_hud.alignX = "left";
self.mule_glow_hud.alignY = "bottom";
self.mule_glow_hud.horzAlign = "left";
self.mule_glow_hud.vertAlign = "bottom";
self.mule_glow_hud.x = ( perk_index * 30 ) - 12;
self.mule_glow_hud.y = self.mule_glow_hud.y - 70 + 12;
self.mule_glow_hud SetShader( "vending_vulture_glow_shader" , 48, 48 );
self.mule_glow_hud.alpha = 0;

self.mule_glow_hud harry_blink_hud( .5 );
}

Change the entire function to this:

Code Snippet
Plaintext
harrybo21_perks_mule_kick_hud_effect()
{
perk_index = self harrybo21_perks_get_hud_index( "specialty_extraammo" );
if ( !isDefined( perk_index ) )
return;

self endon( "disconnect" );
self endon( "lost_specialty_extraammo" );
self endon( "death" );
self.mule_glow_hud = NewClientHudElem( self );
self.mule_glow_hud.foreground = true;
self.mule_glow_hud.sort = 1;
self.mule_glow_hud.hidewheninmenu = false;
self.mule_glow_hud.alignX = "left";
self.mule_glow_hud.alignY = "bottom";
self.mule_glow_hud.horzAlign = "left";
self.mule_glow_hud.vertAlign = "bottom";
self.mule_glow_hud.x = self.perk_hud[ perk_index ].x - 12;
self.mule_glow_hud.y = self.perk_hud[ perk_index ].y + 12;
self.mule_glow_hud SetShader( "vending_vulture_glow_shader" , 48, 48 );
self.mule_glow_hud.alpha = 0;

self.mule_glow_hud harry_blink_hud( .5 );
}

And that's it! Vulture Aid for whatever method Harry done with it from testing will show up at the position the shader is in regardless. If there are any issues please let me know.

FAQ:
Spoiler: click to open...
Q: Bad Syntax.
A: Do it again.

Q: Can be done better.
A: I don't care.

Q: You stole this.
A: Piss off. :please:

Q: Shader doesn't show up correctly.
A: Do it again.

Credits:
DUKIP
Soy-Yo
Last Edit: June 01, 2016, 10:25:43 pm by Scobalula
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
Good stuff dude
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
Check out modulo to help you with this.

num % 4 == 0, is the 4th perk
how modulo works is it returns the remainder of what's leftover from the division.
1 % 4 = 1,
3 % 4 = 3,
8 % 4 = 0
12 % 4 = 0,
etc.

you can then use a multiplier inside of it to increase the base height.
Last Edit: June 01, 2016, 09:38:29 pm by DidUknowiPwn
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 3 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
Signature
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
Good one, if anybody wants the one I use in Cube (two columns):
Code Snippet
Plaintext
harrybo21_perks_hud_set( perk )
{
if ( !isDefined( self.perk_hud ) )
self.perk_hud = [];

hud = NewClientHudElem( self );
hud.perk = perk;
hud.foreground = true;
hud.sort = 1;
hud.hidewheninmenu = false;
hud.alignX = "left";
hud.alignY = "bottom";
hud.horzAlign = "left";
hud.vertAlign = "bottom";
        hud.x = ( self.perk_hud.size % 2 ) * 30;
        hud.y = hud.y - 70 - ( int( self.perk_hud.size / 2 ) * 30 );
hud.alpha = 0;
hud SetShader( level.zombie_perks[ perk ].perk_shader , 48, 48 );
hud scaleOverTime( .5, 24, 24 );
hud fadeOverTime( .5 );
hud.alpha = 1;
self.perk_hud[ self.perk_hud.size ] = hud;
}
Maybe needs some adjusts.
Add it to the OP if you want. :)
Last Edit: June 01, 2016, 10:05:08 pm by Soy-Yo
broken avatar :(
×
broken avatar :(
OnionmanVere Bo21
Location: ieu dnt wnt 2 no
Date Registered: 27 September 2013
Last active: 1 year ago
Posts
1,864
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Mapper
My Groups
More
Personal Quote
ok
×
Scobalula's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Scobalula's Contact & Social Links
Good one, if anybody wants the one I use in Cube (two columns):
Code Snippet
Plaintext
harrybo21_perks_hud_set( perk )
{
if ( !isDefined( self.perk_hud ) )
self.perk_hud = [];

hud = NewClientHudElem( self );
hud.perk = perk;
hud.foreground = true;
hud.sort = 1;
hud.hidewheninmenu = false;
hud.alignX = "left";
hud.alignY = "bottom";
hud.horzAlign = "left";
hud.vertAlign = "bottom";
        hud.x = ( self.perk_hud.size % 2 ) * 30;
        hud.y = hud.y - 70 - ( int( self.perk_hud.size / 2 ) * 30 );
hud.alpha = 0;
hud SetShader( level.zombie_perks[ perk ].perk_shader , 48, 48 );
hud scaleOverTime( .5, 24, 24 );
hud fadeOverTime( .5 );
hud.alpha = 1;
self.perk_hud[ self.perk_hud.size ] = hud;
}
Maybe needs some adjusts.
Add it to the OP if you want. :)

Nice, got the X bit, but you saved me the hassle of figuring out the Y val. While I know I said to DUKIP in chat I wasn't going to update this, his suggestion and Soy-Yo's is much more efficient, so updated script.
broken avatar :(
×
broken avatar :(
Location: gbNewport
Date Registered: 2 November 2014
Last active: 2 years ago
Posts
1,265
Respect
Forum Rank
Zombie Colossus
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Embrace the Darkness
×
Tim Smith's Groups
Tim Smith's Contact & Social Linkstimsmith90THEREALBaDBoY17TimSmithMy clan Website
Great work man!

 
Loading ...