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

Power Up Shader?

HOT
broken avatar :(
Created 9 years ago
by MJPWGaming
0 Members and 1 Guest are viewing this topic.
6,221 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
If so, i need to see the functions for those power ups, they need to turn these to "true" and back to false at the end :


Code Snippet
Plaintext
level.zombie_vars[ "warp_on" ] = false;
level.zombie_vars[ "openfire_on" ] = false;
Last Edit: July 19, 2015, 08:30:48 am by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 26 March 2014
Last active: 3 years ago
Posts
200
Respect
Forum Rank
Mr. Elemental
Primary Group
Donator ♥
My Groups
More
×
MJPWGaming's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
MJPWGaming's Contact & Social Links
If so, i need to see the functions for those power ups, they need to turn these to "true" and back to false at the end :


Code Snippet
Plaintext
level.zombie_vars[ "warp_on" ] = false;
level.zombie_vars[ "openfire_on" ] = false;

Okay sooo that did something. I've added it into the functions:

Code Snippet
Plaintext
REMOVED: Due to secrets

And this time the shaders DID appear this time EXCEPT theres an issue, when active the shader doesnt blink toward the end and doesnt go away till another shader replaces it.
Last Edit: July 19, 2015, 10:59:53 pm by MJPWGaming
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
your not setting the timer

Code Snippet
Plaintext
level.zombie_vars[ "warp_on" ] = true;
level.zombie_vars[ "warp_time" ] = 30;
while( 1 )
{
    if ( level.zombie_vars[ "warp_time" ] <= 0 )
        break;

    level.zombie_vars[ "warp_time" ]--;
    wait 1;
}
level.zombie_vars[ "warp_on" ] = false;

I realise this looks silly, as we have to put the timer length in the function, rather than defined elsewhere, again this is treyarchs shoddy code lol

Ill be rewriting this whole script ( Already have, just needs a tweak ) and putting it up for people to use, instead of fighting with this piece of crap all the time lol

Adding a powerup with a shader in mine is just one line of code...
Last Edit: July 19, 2015, 09:18:41 am by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 26 March 2014
Last active: 3 years ago
Posts
200
Respect
Forum Rank
Mr. Elemental
Primary Group
Donator ♥
My Groups
More
×
MJPWGaming's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
MJPWGaming's Contact & Social Links
your not setting the timer

Would it look like this?

Code Snippet
Plaintext
REMOVED: Due to secrets
Last Edit: July 19, 2015, 11:00:55 pm by MJPWGaming
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
looks fine to me ;)
Last Edit: July 19, 2015, 07:34:52 pm by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 4 months ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
What would be better is to dynamically adjust the hud depending on how many powerups are active.
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
What would be better is to dynamically adjust the hud depending on how many powerups are active.
Ive said this a few times, I just threw it together as he asked
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 4 months ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Ive said this a few times, I just threw it together as he asked

Well I meant a way so you don't have to write an if/else if statement for every combination of powerups.
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 a way so you don't have to write an if/else if statement for every combination of powerups.
again.... ive said this multiple times :

Quote
I realise this looks silly, as we have to put the timer length in the function, rather than defined elsewhere, again this is treyarchs shoddy code lol

Ill be rewriting this whole script ( Already have, just needs a tweak ) and putting it up for people to use, instead of fighting with this piece of crap all the time lol

Adding a powerup with a shader in mine is just one line of code...

Quote
Try this, if you add anymore though id suggest just redoing this whole function to be more adaptable :
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 4 months ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
again.... ive said this multiple times :

Ahh, my apologies, I missed that. Forgive me. lol  :please:
Last Edit: July 19, 2015, 09:03:42 pm by ProGamerzFTW
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
lol its all good ;)
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 26 March 2014
Last active: 3 years ago
Posts
200
Respect
Forum Rank
Mr. Elemental
Primary Group
Donator ♥
My Groups
More
×
MJPWGaming's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
MJPWGaming's Contact & Social Links
looks fine to me ;)

Been tweaking at all last night till 4 AM and woke back up and have been doing the same all day today and Ive got them all working correctly :) BUT they seem to overlap with three active and Im betting four will be the same. Is there an easier way to test? Like to spawn them?
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 had a feeling my co-ords would be off, hence me leaving comments to tell you what was what

change the .x in these to adjust the "3 perks active"

Code Snippet
Plaintext
// ========================================================== 3 ON ==============================================================

else if ( level.zombie_vars[ "zombie_powerup_point_doubler_on" ] == true && level.zombie_vars[ "zombie_powerup_insta_kill_on" ] == true && level.zombie_vars[ "NEWPERKNAME_on" ] == true && level.zombie_vars[ "NEWPERKNAME_2_on" ] == false ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 0 ].x = -24;
level.powerup_hud[ 1 ].x = 0;
level.powerup_hud[ 2 ].x = 24;

level.powerup_hud[ 0 ] setshader(shader_2x, 32, 32);
level.powerup_hud[ 1 ] setshader(shader_insta, 32, 32);
level.powerup_hud[ 2 ] setshader(shader_NEWPERK, 32, 32); // CHANGE HERE ===================================================================

level.powerup_hud[ 0 ].alpha = 1;
level.powerup_hud[ 1 ].alpha = 1;
level.powerup_hud[ 2 ].alpha = 1;
level.powerup_hud[ 3 ].alpha = 0;
}
else if ( level.zombie_vars[ "zombie_powerup_point_doubler_on" ] == true && level.zombie_vars[ "zombie_powerup_insta_kill_on" ] == true && level.zombie_vars[ "NEWPERKNAME_on" ] == false && level.zombie_vars[ "NEWPERKNAME_2_on" ] == true ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 0 ].x = -24;
level.powerup_hud[ 1 ].x = 0;
level.powerup_hud[ 3 ].x = 24;

level.powerup_hud[ 0 ] setshader(shader_2x, 32, 32);
level.powerup_hud[ 1 ] setshader(shader_insta, 32, 32);
level.powerup_hud[ 3 ] setshader(shader_NEWPERK_2, 32, 32); // CHANGE HERE ===================================================================

level.powerup_hud[ 0 ].alpha = 1;
level.powerup_hud[ 1 ].alpha = 1;
level.powerup_hud[ 2 ].alpha = 0;
level.powerup_hud[ 3 ].alpha = 1;
}
else if ( level.zombie_vars[ "zombie_powerup_point_doubler_on" ] == true && level.zombie_vars[ "zombie_powerup_insta_kill_on" ] == false && level.zombie_vars[ "NEWPERKNAME_on" ] == true && level.zombie_vars[ "NEWPERKNAME_2_on" ] == true ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 0 ].x = -24;
level.powerup_hud[ 2 ].x = 0;
level.powerup_hud[ 3 ].x = 24;

level.powerup_hud[ 0 ] setshader(shader_2x, 32, 32);
level.powerup_hud[ 2 ] setshader(shader_NEWPERK, 32, 32); // CHANGE HERE ===================================================================
level.powerup_hud[ 3 ] setshader(shader_NEWPERK_2, 32, 32); // CHANGE HERE ===================================================================

level.powerup_hud[ 0 ].alpha = 1;
level.powerup_hud[ 1 ].alpha = 0;
level.powerup_hud[ 2 ].alpha = 1;
level.powerup_hud[ 3 ].alpha = 1;
}
else if ( level.zombie_vars[ "zombie_powerup_point_doubler_on" ] == false && level.zombie_vars[ "zombie_powerup_insta_kill_on" ] == true && level.zombie_vars[ "NEWPERKNAME_on" ] == true && level.zombie_vars[ "NEWPERKNAME_2_on" ] == true ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 1 ].x = -24;
level.powerup_hud[ 2 ].x = 0;
level.powerup_hud[ 3 ].x = 24;

level.powerup_hud[ 1 ] setshader(shader_insta, 32, 32);
level.powerup_hud[ 2 ] setshader(shader_NEWPERK, 32, 32); // CHANGE HERE ===================================================================
level.powerup_hud[ 3 ] setshader(shader_NEWPERK_2, 32, 32); // CHANGE HERE ===================================================================

level.powerup_hud[ 0 ].alpha = 0;
level.powerup_hud[ 1 ].alpha = 1;
level.powerup_hud[ 2 ].alpha = 1;
level.powerup_hud[ 3 ].alpha = 1;
}

Code Snippet
Plaintext
level.powerup_hud[ 0 ].x = -24; 
level.powerup_hud[ 1 ].x = 0;
level.powerup_hud[ 2 ].x = 24;

maybe try 32, or 48 instead of 24
Last Edit: July 19, 2015, 11:17:17 pm by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 26 March 2014
Last active: 3 years ago
Posts
200
Respect
Forum Rank
Mr. Elemental
Primary Group
Donator ♥
My Groups
More
×
MJPWGaming's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
MJPWGaming's Contact & Social Links
I had a feeling my co-ords would be off, hence me leaving comments to tell you what was what

change the .x in these to adjust the "3 perks active"

maybe try 32, or 48 instead of 24

Trying it now just fixed the problems I seen and face palming XD Is there a way to spawn them manually to test?
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
lol oh boy...

thread the function on a trigger or something

Code Snippet
Plaintext
insta_kill_on_hud( drop_item )
{
self endon ("disconnect");

// check to see if this is on or not
if ( level.zombie_vars["zombie_powerup_insta_kill_on"] )
{
// reset the time and keep going
level.zombie_vars["zombie_powerup_insta_kill_time"] = 30;
return;
}

level.zombie_vars["zombie_powerup_insta_kill_on"] = true;

// set up the hudelem
//hudelem = maps\_hud_util::createFontString( "objective", 2 );
//hudelem maps\_hud_util::setPoint( "TOP", undefined, 0, level.zombie_vars["zombie_timer_offset"] + level.zombie_vars["zombie_timer_offset_interval"]);
//hudelem.sort = 0.5;
//hudelem.alpha = 0;
//hudelem fadeovertime(0.5);
//hudelem.alpha = 1;
//hudelem.label = drop_item.hint;

// set time remaining for insta kill
level thread time_remaning_on_insta_kill_powerup();

// offset in case we get another powerup
//level.zombie_timer_offset -= level.zombie_timer_offset_interval;
}

the function to call ^ insta kill is - insta_kill_on_hud( drop_item ); ( drop_item is irrelevent )

so make a trigger use, targetname - "start_insta";

Code Snippet
Plaintext
// under zombiemode::main();
ent = getEnt( "insta_trigger", "targetname" );
ent thread insta_trigger();

// way at the bottom, not "inside" another function :
insta_trigger()
{
    self waittill( "trigger" );
    level thread insta_kill_on_hud();

    wait 1;
}

just do the same for the others, and give them different targetnames. Then go hit the triggers in game - untested again as im at work again
Last Edit: July 20, 2015, 02:28:44 am by Harry Bo21

 
Loading ...