UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: MJPWGaming on June 20, 2015, 04:35:25 am

Title: Power Up Shader?
Post by: MJPWGaming on June 20, 2015, 04:35:25 am
Hi so I did this tut on the unlimited ammo and I was wondering how to apply a shader? Also I cant have it overlap the X2 and insta kill. As a side not: how would I go about adding it in where it plays an announcer quote?

http://ugx-mods.com/forum/index.php?topic=296.0 (http://ugx-mods.com/forum/index.php?topic=296.0)
Title: Re: Power Up Shader?
Post by: liamsa669 on June 20, 2015, 01:29:39 pm
edit this function inside _zombiemode_powerups.gsc
Code Snippet
Plaintext
powerup_hud_overlay()
{

level.powerup_hud_array = [];
level.powerup_hud_array[0] = true;
level.powerup_hud_array[1] = true;

level.powerup_hud = [];
level.powerup_hud_cover = [];
level endon ("disconnect");


for(i = 0; i < 2; i++)
{
level.powerup_hud[i] = create_simple_hud();
level.powerup_hud[i].foreground = true;
level.powerup_hud[i].sort = 2;
level.powerup_hud[i].hidewheninmenu = false;
level.powerup_hud[i].alignX = "center";
level.powerup_hud[i].alignY = "bottom";
level.powerup_hud[i].horzAlign = "center";
level.powerup_hud[i].vertAlign = "bottom";
level.powerup_hud[i].x = -32 + (i * 15);
level.powerup_hud[i].y = level.powerup_hud[i].y - 35;
level.powerup_hud[i].alpha = 0.8;
//hud SetShader( shader_inst, 24, 24 );
}

shader_2x = "specialty_doublepoints_zombies";
shader_insta = "specialty_instakill_zombies";
// shader_white = "black";




//for(i = 0; i < 2; i++)
//{
// level.powerup_hud_cover[i] = create_simple_hud();
// level.powerup_hud_cover[i].foreground = true;
// level.powerup_hud_cover[i].sort = 1;
// level.powerup_hud_cover[i].hidewheninmenu = false;
// level.powerup_hud_cover[i].alignX = "center";
// level.powerup_hud_cover[i].alignY = "bottom";
// level.powerup_hud_cover[i].horzAlign = "center";
// level.powerup_hud_cover[i].vertAlign = "bottom";
// level.powerup_hud_cover[i].x = -32 + (i * 34);
// level.powerup_hud_cover[i].y = level.powerup_hud_cover[i].y - 30;
// level.powerup_hud_cover[i].alpha = 1;
// //hud SetShader( shader_inst, 24, 24 );
//}



//increment = 0;


while(true)
{
if(level.zombie_vars["zombie_powerup_insta_kill_time"] < 5)
{
wait(0.1);
level.powerup_hud[1].alpha = 0;
wait(0.1);


}
else if(level.zombie_vars["zombie_powerup_insta_kill_time"] < 10)
{
wait(0.2);
level.powerup_hud[1].alpha = 0;
wait(0.18);

}

if(level.zombie_vars["zombie_powerup_point_doubler_time"] < 5)
{
wait(0.1);
level.powerup_hud[0].alpha = 0;
wait(0.1);


}
else if(level.zombie_vars["zombie_powerup_point_doubler_time"] < 10)
{
wait(0.2);
level.powerup_hud[0].alpha = 0;
wait(0.18);
}


//if(level.zombie_vars["zombie_powerup_insta_kill_time"] != 0)
// iprintlnbold(level.zombie_vars["zombie_powerup_insta_kill_time"]);

//if(level.zombie_vars["zombie_powerup_point_doubler_time"] != 0)
// iprintlnbold(level.zombie_vars["zombie_powerup_point_doubler_time"]);


//wait(0.01);

if(level.zombie_vars["zombie_powerup_point_doubler_on"] == true && level.zombie_vars["zombie_powerup_insta_kill_on"] == true)
{

level.powerup_hud[0].x = -24;
level.powerup_hud[1].x = 24;
level.powerup_hud[0].alpha = 1;
level.powerup_hud[1].alpha = 1;
level.powerup_hud[0] setshader(shader_2x, 32, 32);
level.powerup_hud[1] setshader(shader_insta, 32, 32);
/*level.powerup_hud_cover[0].x = -36;
level.powerup_hud_cover[1].x = 36;
level.powerup_hud_cover[0] setshader(shader_white, 32, i);
level.powerup_hud_cover[1] setshader(shader_white, 32, j);
level.powerup_hud_cover[0].alpha = 1;
level.powerup_hud_cover[1].alpha = 1;*/

}
else if(level.zombie_vars["zombie_powerup_point_doubler_on"] == true && level.zombie_vars["zombie_powerup_insta_kill_on"] == false)
{
level.powerup_hud[0].x = 0;
//level.powerup_hud[0].y = level.powerup_hud[0].y - 70;
level.powerup_hud[0] setshader(shader_2x, 32, 32);
level.powerup_hud[1].alpha = 0;
level.powerup_hud[0].alpha = 1;

}
else if(level.zombie_vars["zombie_powerup_insta_kill_on"] == true && level.zombie_vars["zombie_powerup_point_doubler_on"] == false)
{

level.powerup_hud[1].x = 0;
//level.powerup_hud[1].y = level.powerup_hud[1].y - 70;
level.powerup_hud[1] setshader(shader_insta, 32, 32);
level.powerup_hud[0].alpha = 0;
level.powerup_hud[1].alpha = 1;
}
else
{

level.powerup_hud[1].alpha = 0;
level.powerup_hud[0].alpha = 0;

}

wait(0.01);



//increment += 1;

//if(increment >= 20)
//{
// level.powerup_hud[0].alpha = 0;
// level.powerup_hud[1].alpha = 0;
//// level.powerup_hud_cover[0].alpha = 0;
//// level.powerup_hud_cover[1].alpha = 0;
//}
//
//if(increment == 30)
//{

// level.powerup_hud_array[1] = false;
// level.powerup_hud_array[0] = false;

//}
//wait(0.5);






/* if(randomint(100) > 50)
level.powerup_hud_array[0] = false;
else
level.powerup_hud_array[0] = true;


if(randomint(100) > 50)
level.powerup_hud_array[1] = false;
else
level.powerup_hud_array[1] = true;*/

}




//for(i = 0; i < 2; i++)
//{
// level.powerup_hud_cover[i] = create_simple_hud();
// level.powerup_hud_cover[i].foreground = true;
// level.powerup_hud_cover[i].sort = 1;
// level.powerup_hud_cover[i].hidewheninmenu = false;
// level.powerup_hud_cover[i].alignX = "center";
// level.powerup_hud_cover[i].alignY = "bottom";
// level.powerup_hud_cover[i].horzAlign = "center";
// level.powerup_hud_cover[i].vertAlign = "bottom";
// level.powerup_hud_cover[i].x = -32 + (i * 34);
// level.powerup_hud_cover[i].y = level.powerup_hud_cover[i].y - 79;
// level.powerup_hud_cover[i].alpha = 0.5;
// //hud SetShader( shader_inst, 24, 24 );
//}


//while(true)
//{
// /* for(i = 0; i < 2; i++)
// {
// level.powerup_hud[i].y = level.powerup_hud[i].y - 5;

// }*/




// wait(1);
//}

}
by default theres only 2 shaders that are used, so all u have to do is add a new one
Title: Re: Power Up Shader?
Post by: MJPWGaming on June 20, 2015, 08:59:58 pm
edit this function inside _zombiemode_powerups.gsc
Code Snippet
Plaintext
powerup_hud_overlay()
{

level.powerup_hud_array = [];
level.powerup_hud_array[0] = true;
level.powerup_hud_array[1] = true;

level.powerup_hud = [];
level.powerup_hud_cover = [];
level endon ("disconnect");


for(i = 0; i < 2; i++)
{
level.powerup_hud[i] = create_simple_hud();
level.powerup_hud[i].foreground = true;
level.powerup_hud[i].sort = 2;
level.powerup_hud[i].hidewheninmenu = false;
level.powerup_hud[i].alignX = "center";
level.powerup_hud[i].alignY = "bottom";
level.powerup_hud[i].horzAlign = "center";
level.powerup_hud[i].vertAlign = "bottom";
level.powerup_hud[i].x = -32 + (i * 15);
level.powerup_hud[i].y = level.powerup_hud[i].y - 35;
level.powerup_hud[i].alpha = 0.8;
//hud SetShader( shader_inst, 24, 24 );
}

shader_2x = "specialty_doublepoints_zombies";
shader_insta = "specialty_instakill_zombies";
// shader_white = "black";




//for(i = 0; i < 2; i++)
//{
// level.powerup_hud_cover[i] = create_simple_hud();
// level.powerup_hud_cover[i].foreground = true;
// level.powerup_hud_cover[i].sort = 1;
// level.powerup_hud_cover[i].hidewheninmenu = false;
// level.powerup_hud_cover[i].alignX = "center";
// level.powerup_hud_cover[i].alignY = "bottom";
// level.powerup_hud_cover[i].horzAlign = "center";
// level.powerup_hud_cover[i].vertAlign = "bottom";
// level.powerup_hud_cover[i].x = -32 + (i * 34);
// level.powerup_hud_cover[i].y = level.powerup_hud_cover[i].y - 30;
// level.powerup_hud_cover[i].alpha = 1;
// //hud SetShader( shader_inst, 24, 24 );
//}



//increment = 0;


while(true)
{
if(level.zombie_vars["zombie_powerup_insta_kill_time"] < 5)
{
wait(0.1);
level.powerup_hud[1].alpha = 0;
wait(0.1);


}
else if(level.zombie_vars["zombie_powerup_insta_kill_time"] < 10)
{
wait(0.2);
level.powerup_hud[1].alpha = 0;
wait(0.18);

}

if(level.zombie_vars["zombie_powerup_point_doubler_time"] < 5)
{
wait(0.1);
level.powerup_hud[0].alpha = 0;
wait(0.1);


}
else if(level.zombie_vars["zombie_powerup_point_doubler_time"] < 10)
{
wait(0.2);
level.powerup_hud[0].alpha = 0;
wait(0.18);
}


//if(level.zombie_vars["zombie_powerup_insta_kill_time"] != 0)
// iprintlnbold(level.zombie_vars["zombie_powerup_insta_kill_time"]);

//if(level.zombie_vars["zombie_powerup_point_doubler_time"] != 0)
// iprintlnbold(level.zombie_vars["zombie_powerup_point_doubler_time"]);


//wait(0.01);

if(level.zombie_vars["zombie_powerup_point_doubler_on"] == true && level.zombie_vars["zombie_powerup_insta_kill_on"] == true)
{

level.powerup_hud[0].x = -24;
level.powerup_hud[1].x = 24;
level.powerup_hud[0].alpha = 1;
level.powerup_hud[1].alpha = 1;
level.powerup_hud[0] setshader(shader_2x, 32, 32);
level.powerup_hud[1] setshader(shader_insta, 32, 32);
/*level.powerup_hud_cover[0].x = -36;
level.powerup_hud_cover[1].x = 36;
level.powerup_hud_cover[0] setshader(shader_white, 32, i);
level.powerup_hud_cover[1] setshader(shader_white, 32, j);
level.powerup_hud_cover[0].alpha = 1;
level.powerup_hud_cover[1].alpha = 1;*/

}
else if(level.zombie_vars["zombie_powerup_point_doubler_on"] == true && level.zombie_vars["zombie_powerup_insta_kill_on"] == false)
{
level.powerup_hud[0].x = 0;
//level.powerup_hud[0].y = level.powerup_hud[0].y - 70;
level.powerup_hud[0] setshader(shader_2x, 32, 32);
level.powerup_hud[1].alpha = 0;
level.powerup_hud[0].alpha = 1;

}
else if(level.zombie_vars["zombie_powerup_insta_kill_on"] == true && level.zombie_vars["zombie_powerup_point_doubler_on"] == false)
{

level.powerup_hud[1].x = 0;
//level.powerup_hud[1].y = level.powerup_hud[1].y - 70;
level.powerup_hud[1] setshader(shader_insta, 32, 32);
level.powerup_hud[0].alpha = 0;
level.powerup_hud[1].alpha = 1;
}
else
{

level.powerup_hud[1].alpha = 0;
level.powerup_hud[0].alpha = 0;

}

wait(0.01);



//increment += 1;

//if(increment >= 20)
//{
// level.powerup_hud[0].alpha = 0;
// level.powerup_hud[1].alpha = 0;
//// level.powerup_hud_cover[0].alpha = 0;
//// level.powerup_hud_cover[1].alpha = 0;
//}
//
//if(increment == 30)
//{

// level.powerup_hud_array[1] = false;
// level.powerup_hud_array[0] = false;

//}
//wait(0.5);






/* if(randomint(100) > 50)
level.powerup_hud_array[0] = false;
else
level.powerup_hud_array[0] = true;


if(randomint(100) > 50)
level.powerup_hud_array[1] = false;
else
level.powerup_hud_array[1] = true;*/

}




//for(i = 0; i < 2; i++)
//{
// level.powerup_hud_cover[i] = create_simple_hud();
// level.powerup_hud_cover[i].foreground = true;
// level.powerup_hud_cover[i].sort = 1;
// level.powerup_hud_cover[i].hidewheninmenu = false;
// level.powerup_hud_cover[i].alignX = "center";
// level.powerup_hud_cover[i].alignY = "bottom";
// level.powerup_hud_cover[i].horzAlign = "center";
// level.powerup_hud_cover[i].vertAlign = "bottom";
// level.powerup_hud_cover[i].x = -32 + (i * 34);
// level.powerup_hud_cover[i].y = level.powerup_hud_cover[i].y - 79;
// level.powerup_hud_cover[i].alpha = 0.5;
// //hud SetShader( shader_inst, 24, 24 );
//}


//while(true)
//{
// /* for(i = 0; i < 2; i++)
// {
// level.powerup_hud[i].y = level.powerup_hud[i].y - 5;

// }*/




// wait(1);
//}

}
by default theres only 2 shaders that are used, so all u have to do is add a new one

When it comes to this section:

Code Snippet
Plaintext
	if(level.zombie_vars["zombie_powerup_point_doubler_on"] == true && level.zombie_vars["zombie_powerup_insta_kill_on"] == true)
{

level.powerup_hud[0].x = -24;
level.powerup_hud[1].x = 24;
level.powerup_hud[0].alpha = 1;
level.powerup_hud[1].alpha = 1;
level.powerup_hud[0] setshader(shader_2x, 32, 32);
level.powerup_hud[1] setshader(shader_insta, 32, 32);
/*level.powerup_hud_cover[0].x = -36;
level.powerup_hud_cover[1].x = 36;
level.powerup_hud_cover[0] setshader(shader_white, 32, i);
level.powerup_hud_cover[1] setshader(shader_white, 32, j);
level.powerup_hud_cover[0].alpha = 1;
level.powerup_hud_cover[1].alpha = 1;*/

}
else if(level.zombie_vars["zombie_powerup_point_doubler_on"] == true && level.zombie_vars["zombie_powerup_insta_kill_on"] == false)
{
level.powerup_hud[0].x = 0;
//level.powerup_hud[0].y = level.powerup_hud[0].y - 70;
level.powerup_hud[0] setshader(shader_2x, 32, 32);
level.powerup_hud[1].alpha = 0;
level.powerup_hud[0].alpha = 1;

}
else if(level.zombie_vars["zombie_powerup_insta_kill_on"] == true && level.zombie_vars["zombie_powerup_point_doubler_on"] == false)
{

level.powerup_hud[1].x = 0;
//level.powerup_hud[1].y = level.powerup_hud[1].y - 70;
level.powerup_hud[1] setshader(shader_insta, 32, 32);
level.powerup_hud[0].alpha = 0;
level.powerup_hud[1].alpha = 1;
}
else
{

level.powerup_hud[1].alpha = 0;
level.powerup_hud[0].alpha = 0;

}

wait(0.01);

What do I put in? Also need to know how to let it know to play the announcer audio.
Title: Re: Power Up Shader?
Post by: HitmanVere on July 19, 2015, 12:08:04 am
Code Snippet
Plaintext
level thread play_devil_dialog("carp_vox");

Change carp_vox to your soundalias entry and add in powerups function
Title: Re: Power Up Shader?
Post by: Harry Bo21 on July 19, 2015, 12:56:23 am
Untested a written on my PC at work ( no access to cod or mod tools ) - should work, no garuntees ( lol i spotted and changed 3 mistakes in my own code already, if you checked this once, check it again incase ive changed it )

Code Snippet
Plaintext
powerup_hud_overlay()
{
level.powerup_hud = [];
level.powerup_hud_cover = [];
level endon ("disconnect");

for(i = 0; i < 3; i++)
{
level.powerup_hud[ i ] = create_simple_hud();
level.powerup_hud[ i ].foreground = true;
level.powerup_hud[ i ].sort = 2;
level.powerup_hud[ i ].hidewheninmenu = false;
level.powerup_hud[ i ].alignX = "center";
level.powerup_hud[ i ].alignY = "bottom";
level.powerup_hud[ i ].horzAlign = "center";
level.powerup_hud[ i ].vertAlign = "bottom";
level.powerup_hud[ i ].x = -32 + (i * 15);
level.powerup_hud[ i ].y = level.powerup_hud[i].y - 35;
level.powerup_hud[ i ].alpha = 0.8;
}

shader_2x = "specialty_doublepoints_zombies";
shader_insta = "specialty_instakill_zombies";
shader_NEWPERK = "NEW PERK SHADER NAME"; // CHANGE HERE ===================================================================

while( true )
{
if ( level.zombie_vars[ "NEWPERKNAME_time" ] < 5 ) // CHANGE HERE ===================================================================
{
wait .1;
level.powerup_hud[ 2 ].alpha = 0;
wait .1;
}
else if( level.zombie_vars[ "NEWPERKNAME_time" ] < 10 ) // CHANGE HERE ===================================================================
{
wait .2;
level.powerup_hud[ 2 ].alpha = 0;
wait .18;
}
if( level.zombie_vars[ "zombie_powerup_insta_kill_time" ] < 5 )
{
wait .1;
level.powerup_hud[ 1 ].alpha = 0;
wait .1;
}
else if( level.zombie_vars[ "zombie_powerup_insta_kill_time" ] < 10 )
{
wait .2;
level.powerup_hud[ 1 ].alpha = 0;
wait .18;
}
if( level.zombie_vars[ "zombie_powerup_point_doubler_time" ] < 5 )
{
wait .1;
level.powerup_hud[ 0 ].alpha = 0;
wait .1;
}
else if( level.zombie_vars[ "zombie_powerup_point_doubler_time" ] < 10 )
{
wait .2;
level.powerup_hud[ 0 ].alpha = 0;
wait .18;
}

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 )  // CHANGE HERE ===================================================================
{

level.powerup_hud[ 0 ].x = -48;
level.powerup_hud[ 1 ].x = 0;
level.powerup_hud[ 2 ].x = 48;

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;
}
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 ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 0 ].x = -24;
level.powerup_hud[ 2 ].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[ 0 ].alpha = 1;
level.powerup_hud[ 1 ].alpha = 0;
level.powerup_hud[ 2 ].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 ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 1 ].x = -24;
level.powerup_hud[ 2 ].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[ 0 ].alpha = 0;
level.powerup_hud[ 1 ].alpha = 1;
level.powerup_hud[ 2 ].alpha = 1;
}
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 ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 0 ].x = -24;
level.powerup_hud[ 1 ].x = 24;

level.powerup_hud[ 0 ] setshader( shader_2x, 32, 32 );
level.powerup_hud[ 1 ] setshader( shader_insta, 32, 32 );

level.powerup_hud[ 0 ].alpha = 1;
level.powerup_hud[ 1 ].alpha = 1;
level.powerup_hud[ 2 ].alpha = 0;
}
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" ] == false ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 0 ].x = 0;

level.powerup_hud[ 0 ] setshader( shader_2x, 32, 32 );

level.powerup_hud[ 0 ].alpha = 1;
level.powerup_hud[ 1 ].alpha = 0;
level.powerup_hud[ 2 ].alpha = 0;
}
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" ] == false ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 1 ].x = 0;

level.powerup_hud[ 1 ] setshader(shader_insta, 32, 32);

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

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

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

}

Phew... I forgot how disgusting that script is ( really poor work, even for treyarch, could be much improved )

Non-the-less, you asked so nicely, here ya go

i marked "CHANGE HERE" everywhere you need to set your new perk name

also in the script youll see the insta kill and double points timer and on variable set somewhere, you need to do the same with yours

Code Snippet
Plaintext
level.zombie_vars[ "zombie_powerup_point_doubler_on" ] = false;
level.zombie_vars[ "zombie_powerup_insta_kill_on" ] = false;
// level.zombie_vars[ "YOURPERKNAME_on" ] = false; // need to add this

level.zombie_vars[ "zombie_powerup_point_doubler_time" ] = 30;
level.zombie_vars[ "zombie_powerup_insta_kill_time" ] = 30;
// level.zombie_vars[ "YOURPERKNAME_time" ] = 30; // need to add this
Title: Re: Power Up Shader?
Post by: MJPWGaming on July 19, 2015, 04:19:54 am
Untested a written on my PC at work ( no access to cod or mod tools ) - should work, no garuntees ( lol i spotted and changed 3 mistakes in my own code already, if you checked this once, check it again incase ive changed it )

Phew... I forgot how disgusting that script is ( really poor work, even for treyarch, could be much improved )

Non-the-less, you asked so nicely, here ya go

i marked "CHANGE HERE" everywhere you need to set your new perk name

also in the script youll see the insta kill and double points timer and on variable set somewhere, you need to do the same with yours

Thank you so much! Its actually two power ups that Im adding in but Im getting a bad syntax at line 159:

(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fi.gyazo.com%2Ffcd598ea7e8205ffeb7baab554f84124.png&hash=0c6dbeecc432d48ab4e0c64ce625a99bbaa7a371)

Here is my edited code from there down :)

Code Snippet
Plaintext
		If ( level.zombie_vars[ "zombie_powerup_point_doubler_on" ] == true && level.zombie_vars[ "zombie_powerup_insta_kill_on" ] == true && level.zombie_vars[ "warp_on" ] == true && level.zombie_vars[ "openfire_on" ] == true )
{

level.powerup_hud[ 0 ].x = -48;
level.powerup_hud[ 1 ].x = 0;
level.powerup_hud[ 2 ].x = 48;

level.powerup_hud[ 0 ] setshader( shader_2x, 32, 32 );
level.powerup_hud[ 1 ] setshader( shader_insta, 32, 32 );
level.powerup_hud[ 2 ] setshader( shader_warp , 32, 32 );
level.powerup_hud[ 2 ] setshader( shader_openfire , 32, 32 );

level.powerup_hud[ 0 ].alpha = 1;
level.powerup_hud[ 1 ].alpha = 1;
level.powerup_hud[ 2 ].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[ "warp_on" ] == true && level.zombie_vars[ "openfire_on" ] == true )
{
level.powerup_hud[ 0 ].x = -24;
level.powerup_hud[ 2 ].x = 24;

level.powerup_hud[ 0 ] setshader(shader_2x, 32, 32);
level.powerup_hud[ 2 ] setshader(shader_warp, 32, 32);
level.powerup_hud[ 2 ] setshader(shader_openfire, 32, 32);

level.powerup_hud[ 0 ].alpha = 1;
level.powerup_hud[ 1 ].alpha = 0;
level.powerup_hud[ 2 ].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[ "warp_on" ] == true && level.zombie_vars[ "openfire_on" ] == true )
{
level.powerup_hud[ 1 ].x = -24;
level.powerup_hud[ 2 ].x = 24;

level.powerup_hud[ 1 ] setshader( shader_insta, 32, 32 );
level.powerup_hud[ 2 ] setshader( shader_warp, 32, 32 );
level.powerup_hud[ 2 ] setshader( shader_openfire, 32, 32 );

level.powerup_hud[ 0 ].alpha = 0;
level.powerup_hud[ 1 ].alpha = 1;
level.powerup_hud[ 2 ].alpha = 1;
}
else if ( level.zombie_vars[ "zombie_powerup_point_doubler_on" ] == true && level.zombie_vars[ "zombie_powerup_insta_kill_on" ] == true && level.zombie_vars[ "warp_on" ] == false && level.zombie_vars[ "openfire_on" ] == false )
{
level.powerup_hud[ 0 ].x = -24;
level.powerup_hud[ 1 ].x = 24;

level.powerup_hud[ 0 ] setshader( shader_2x, 32, 32 );
level.powerup_hud[ 1 ] setshader( shader_insta, 32, 32 );

level.powerup_hud[ 0 ].alpha = 1;
level.powerup_hud[ 1 ].alpha = 1;
level.powerup_hud[ 2 ].alpha = 0;
}
else if ( level.zombie_vars[ "zombie_powerup_point_doubler_on" ] == true && level.zombie_vars[ "zombie_powerup_insta_kill_on" ] == false && level.zombie_vars[ "warp_on" ] == false && level.zombie_vars[ "openfire_on" ] == false )
{
level.powerup_hud[ 0 ].x = 0;

level.powerup_hud[ 0 ] setshader( shader_2x, 32, 32 );

level.powerup_hud[ 0 ].alpha = 1;
level.powerup_hud[ 1 ].alpha = 0;
level.powerup_hud[ 2 ].alpha = 0;
}
else if ( level.zombie_vars[ "zombie_powerup_point_doubler_on" ] == false && level.zombie_vars[ "zombie_powerup_insta_kill_on" ] == true && level.zombie_vars[ "warp_on" ] == false && level.zombie_vars[ "openfire_on" ] == false )
{
level.powerup_hud[ 1 ].x = 0;

level.powerup_hud[ 1 ] setshader(shader_insta, 32, 32);

level.powerup_hud[ 0 ].alpha = 0;
level.powerup_hud[ 1 ].alpha = 1;
level.powerup_hud[ 2 ].alpha = 0;
}
else if ( level.zombie_vars[" zombie_powerup_point_doubler_on" ] == false && level.zombie_vars[ "zombie_powerup_insta_kill_on" ] == false && level.zombie_vars[ "warp_on" ] == true && level.zombie_vars[ "openfire_on" ] == true )
{
level.powerup_hud[ 2 ].x = 0;

level.powerup_hud[ 2 ] setshader( shader_warp, 32, 32 );
level.powerup_hud[ 2 ] setshader( shader_openfire, 32, 32 );

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

}
Title: Re: Power Up Shader?
Post by: Harry Bo21 on July 19, 2015, 04:23:36 am
i cant see what line is what, which line is the problem one ( highlight it )

youve also set shader again on something already defined :

Code Snippet
Plaintext
level.powerup_hud[ 2 ] setshader( shader_warp , 32, 32 );
level.powerup_hud[ 2 ] setshader( shader_openfire , 32, 32 );
Title: Re: Power Up Shader?
Post by: MJPWGaming on July 19, 2015, 04:35:06 am
i cant see what line is what, which line is the problem one ( highlight it )

In the image I highlighted the line its just a {

Code Snippet
Plaintext
		If ( level.zombie_vars[ "zombie_powerup_point_doubler_on" ] == true && level.zombie_vars[ "zombie_powerup_insta_kill_on" ] == true && level.zombie_vars[ "warp_on" ] == true && level.zombie_vars[ "openfire_on" ] == true )
{ //this line right here

level.powerup_hud[ 0 ].x = -48;
level.powerup_hud[ 1 ].x = 0;
level.powerup_hud[ 2 ].x = 48;

level.powerup_hud[ 0 ] setshader( shader_2x, 32, 32 );
level.powerup_hud[ 1 ] setshader( shader_insta, 32, 32 );
level.powerup_hud[ 2 ] setshader( shader_warp , 32, 32 );
level.powerup_hud[ 2 ] setshader( shader_openfire , 32, 32 );

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

youve also set shader again on something already defined

Im sorry I do not understand :( Im not good at scripting just applying them
Title: Re: Power Up Shader?
Post by: Harry Bo21 on July 19, 2015, 05:00:34 am
level.powerup_hud[ 2 ]

^^ you did set shader on that twice, the second should be on

level.powerup_hud[ 3 ]

which involves extending all of what i did again for 1 more perk. This is what imeant by treyarchs crappy coding, could easily be automatic, but they just hardcoded it in ( im guesssing they were on a timer )

i think it might be the capital I in If, should be "if"
Title: Re: Power Up Shader?
Post by: Harry Bo21 on July 19, 2015, 06:39:50 am
Try this, if you add anymore though id suggest just redoing this whole function to be more adaptable :

Code Snippet
Plaintext
powerup_hud_overlay()
{
level.powerup_hud = [];
level.powerup_hud_cover = [];
level endon ( "disconnect" );

for(i = 0; i < 4; i++)
{
level.powerup_hud[ i ] = create_simple_hud();
level.powerup_hud[ i ].foreground = true;
level.powerup_hud[ i ].sort = 2;
level.powerup_hud[ i ].hidewheninmenu = false;
level.powerup_hud[ i ].alignX = "center";
level.powerup_hud[ i ].alignY = "bottom";
level.powerup_hud[ i ].horzAlign = "center";
level.powerup_hud[ i ].vertAlign = "bottom";
level.powerup_hud[ i ].x = -32 + ( i * 15 );
level.powerup_hud[ i ].y = level.powerup_hud[ i ].y - 35;
level.powerup_hud[ i ].alpha = 0.8;
}

shader_2x = "specialty_doublepoints_zombies";
shader_insta = "specialty_instakill_zombies";
shader_NEWPERK = "NEWPERK_SHADER"; // CHANGE HERE ===================================================================
shader_NEWPERK_2 = "NEWPERK_2_SHADER"; // CHANGE HERE ===================================================================

while( true )
{
if ( level.zombie_vars[ "NEWPERKNAME_time" ] < 5 ) // CHANGE HERE ===================================================================
{
wait .1;
level.powerup_hud[ 3 ].alpha = 0;
wait .1;
}
else if( level.zombie_vars[ "NEWPERKNAME_time" ] < 10 ) // CHANGE HERE ===================================================================
{
wait .2;
level.powerup_hud[ 3 ].alpha = 0;
wait .18;
}
if ( level.zombie_vars[ "NEWPERKNAME_time" ] < 5 ) // CHANGE HERE ===================================================================
{
wait .1;
level.powerup_hud[ 2 ].alpha = 0;
wait .1;
}
else if( level.zombie_vars[ "NEWPERKNAME_time" ] < 10 ) // CHANGE HERE ===================================================================
{
wait .2;
level.powerup_hud[ 2 ].alpha = 0;
wait .18;
}
if( level.zombie_vars[ "zombie_powerup_insta_kill_time" ] < 5 )
{
wait .1;
level.powerup_hud[ 1 ].alpha = 0;
wait .1;
}
else if( level.zombie_vars[ "zombie_powerup_insta_kill_time" ] < 10 )
{
wait .2;
level.powerup_hud[ 1 ].alpha = 0;
wait .18;
}
if( level.zombie_vars[ "zombie_powerup_point_doubler_time" ] < 5 )
{
wait .1;
level.powerup_hud[ 0 ].alpha = 0;
wait .1;
}
else if( level.zombie_vars[ "zombie_powerup_point_doubler_time" ] < 10 )
{
wait .2;
level.powerup_hud[ 0 ].alpha = 0;
wait .18;
}

// ========================================================== ALL 4 ON ==============================================================

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" ] == true )  // CHANGE HERE ===================================================================
{

level.powerup_hud[ 0 ].x = -48;
level.powerup_hud[ 1 ].x = -24;
level.powerup_hud[ 2 ].x = 24;
level.powerup_hud[ 3 ].x = 48;

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[ 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 = 1;
level.powerup_hud[ 3 ].alpha = 1;
}

// ========================================================== 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;
}

// ========================================================== 2 ON ==============================================================

else if ( level.zombie_vars[ "zombie_powerup_point_doubler_on" ] == false && 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[ 2 ].x = -24;
level.powerup_hud[ 3 ].x = 24;

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 = 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" ] == false ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 1 ].x = -24;
level.powerup_hud[ 2 ].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[ 0 ].alpha = 0;
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" ] == false ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 0 ].x = -24;
level.powerup_hud[ 1 ].x = 24;

level.powerup_hud[ 0 ] setshader( shader_2x, 32, 32 );
level.powerup_hud[ 1 ] setshader( shader_insta, 32, 32 );

level.powerup_hud[ 0 ].alpha = 1;
level.powerup_hud[ 1 ].alpha = 1;
level.powerup_hud[ 2 ].alpha = 0;
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" ] == false && level.zombie_vars[ "NEWPERKNAME_on" ] == false && level.zombie_vars[ "NEWPERKNAME_2_on" ] == true ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 0 ].x = -24;
level.powerup_hud[ 3 ].x = 24;

level.powerup_hud[ 0 ] setshader( shader_2x, 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 = 0;
level.powerup_hud[ 2 ].alpha = 0;
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" ] == false && level.zombie_vars[ "NEWPERKNAME_2_on" ] == true ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 1 ].x = -24;
level.powerup_hud[ 3 ].x = 24;

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 = 0;
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" ] == false ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 1 ].x = -24;
level.powerup_hud[ 3 ].x = 24;

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 = 0;
level.powerup_hud[ 1 ].alpha = 1;
level.powerup_hud[ 2 ].alpha = 0;
level.powerup_hud[ 3 ].alpha = 1;
}

// ========================================================== 1 ON ==============================================================

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" ] == false && level.zombie_vars[ "NEWPERKNAME_2_on" ] == false ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 0 ].x = 0;

level.powerup_hud[ 0 ] setshader( shader_2x, 32, 32 );

level.powerup_hud[ 0 ].alpha = 1;
level.powerup_hud[ 1 ].alpha = 0;
level.powerup_hud[ 2 ].alpha = 0;
level.powerup_hud[ 3 ].alpha = 0;
}
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" ] == false && level.zombie_vars[ "NEWPERKNAME_2_on" ] == false ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 1 ].x = 0;

level.powerup_hud[ 1 ] setshader( shader_insta, 32, 32 );

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

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

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

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

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


Need to add these at the top where ever the stock ones are already :

Code Snippet
Plaintext
level.zombie_vars[ "zombie_powerup_point_doubler_on" ] = false;
level.zombie_vars[ "zombie_powerup_insta_kill_on" ] = false;
level.zombie_vars[ "NEWPERK_on" ] = false; // need to add this, This is used by the script to tell the game this powerup is active
level.zombie_vars[ "NEWPERK_2_on" ] = false; // need to add this, This is used by the script to tell the game this powerup is active

level.zombie_vars[ "zombie_powerup_point_doubler_time" ] = 30;
level.zombie_vars[ "zombie_powerup_insta_kill_time" ] = 30;
level.zombie_vars[ "NEWPERK_time" ] = 30; // need to add this, This tells the game how long it can last
level.zombie_vars[ "NEWPERK_2_time" ] = 30; // need to add this, This tells the game how long it can last

Again this is untested, your just lucky I got VERY bored at work lol ;)  :D

- may add this to the tutorial section later
Title: Re: Power Up Shader?
Post by: MJPWGaming on July 19, 2015, 07:59:37 am
Try this, if you add anymore though id suggest just redoing this whole function to be more adaptable :

Again this is untested, your just lucky I got VERY bored at work lol ;)  :D

Thank you so much! Unfortunately the game isn't showing the shaders :( I understand the functions now the way you wrote it out it helps me a lot! I did add

Code Snippet
Plaintext
	PrecacheShader( "specialty_openfire" );
PrecacheShader( "specialty_warp" );

Under

Code Snippet
Plaintext
	PrecacheShader( "specialty_doublepoints_zombies" );
PrecacheShader( "specialty_instakill_zombies" );

At the top and added

Code Snippet
Plaintext
material,specialty_openfire
material,specialty_warp

Into the mod.csv this is all correct right? Or do I not add those
Title: Re: Power Up Shader?
Post by: Harry Bo21 on July 19, 2015, 08:04:32 am
Infact I just deleted what I wrote to you and did it for you, as im home now, but I would suggest reading through it to see what i did, this is basically a flow chart

if ( insta on, dbl on, powerup 3 on, power up 4 on ) -> then display all 4
if ( insta on, dbl on, powerup 3 on, power up 4 off ) -> then display the first 3, but not the 4th
if ( insta on, dbl on, powerup 3 of, power up 4 on ) -> then display1, 2 and 4, but "not" 3

and in those if / else statements, it alligns the shaders "x", otherwise they wouldnt move into place properly when one ran out

Code Snippet
Plaintext
#include maps\_utility; 
#include common_scripts\utility;
#include maps\_zombiemode_utility;

init()
{

PrecacheShader( "specialty_doublepoints_zombies" );
PrecacheShader( "specialty_instakill_zombies" );
PrecacheShader( "specialty_openfire" );
PrecacheShader( "specialty_warp" );


PrecacheShader( "black" );
// powerup Vars
set_zombie_var( "zombie_insta_kill", 0 );
set_zombie_var( "zombie_point_scalar", 1 );
set_zombie_var( "zombie_drop_item", 0 );
set_zombie_var( "zombie_timer_offset", 350 ); // hud offsets
set_zombie_var( "zombie_timer_offset_interval", 30 );
set_zombie_var( "zombie_powerup_insta_kill_on", false );
set_zombie_var( "zombie_powerup_point_doubler_on", false );
set_zombie_var( "zombie_powerup_point_doubler_time", 30 ); // length of point doubler
set_zombie_var( "zombie_powerup_insta_kill_time", 30 ); // length of insta kill
set_zombie_var( "zombie_powerup_drop_increment", 2000 ); // lower this to make drop happen more often
set_zombie_var( "zombie_powerup_drop_max_per_round", 4 ); // lower this to make drop happen more often
set_zombie_var( "NEWPERK_on", false ); // need to add this, This is used by the script to tell the game this powerup is active
set_zombie_var( "NEWPERK_2_on", false ); // need to add this, This is used by the script to tell the game this powerup is active
set_zombie_var( "NEWPERK_time", 30 ); // need to add this, This tells the game how long it can last
set_zombie_var( "NEWPERK_2_time", 30 ); // need to add this, This tells the game how long it can last

// powerups
level._effect["powerup_on"] = loadfx( "misc/fx_zombie_powerup_on" );
level._effect["powerup_grabbed"] = loadfx( "misc/fx_zombie_powerup_grab" );
level._effect["powerup_grabbed_wave"] = loadfx( "misc/fx_zombie_powerup_wave" );

init_powerups();

thread watch_for_drop();
}

init_powerups()
{
if( !IsDefined( level.zombie_powerup_array ) )
{
level.zombie_powerup_array = [];
}
if ( !IsDefined( level.zombie_special_drop_array ) )
{
level.zombie_special_drop_array = [];
}

// Random Drops
add_zombie_powerup( "nuke", "zombie_bomb", &"ZOMBIE_POWERUP_NUKE", "misc/fx_zombie_mini_nuke" );
// add_zombie_powerup( "nuke", "zombie_bomb", &"ZOMBIE_POWERUP_NUKE", "misc/fx_zombie_mini_nuke_hotness" );
add_zombie_powerup( "insta_kill", "zombie_skull", &"ZOMBIE_POWERUP_INSTA_KILL" );
add_zombie_powerup( "double_points","zombie_x2_icon", &"ZOMBIE_POWERUP_DOUBLE_POINTS" );
add_zombie_powerup( "full_ammo",  "zombie_ammocan", &"ZOMBIE_POWERUP_MAX_AMMO");
add_zombie_powerup( "carpenter",  "zombie_carpenter", &"ZOMBIE_POWERUP_MAX_AMMO");

// add_zombie_special_powerup( "monkey" );

// additional special "drops"
// add_zombie_special_drop( "nothing" );
add_zombie_special_drop( "dog" );

// Randomize the order
randomize_powerups();

level.zombie_powerup_index = 0;
randomize_powerups();

level thread powerup_hud_overlay();


powerup_hud_overlay()
{
level.powerup_hud = [];
level.powerup_hud_cover = [];
level endon ( "disconnect" );

for(i = 0; i < 4; i++)
{
level.powerup_hud[ i ] = create_simple_hud();
level.powerup_hud[ i ].foreground = true;
level.powerup_hud[ i ].sort = 2;
level.powerup_hud[ i ].hidewheninmenu = false;
level.powerup_hud[ i ].alignX = "center";
level.powerup_hud[ i ].alignY = "bottom";
level.powerup_hud[ i ].horzAlign = "center";
level.powerup_hud[ i ].vertAlign = "bottom";
level.powerup_hud[ i ].x = -32 + ( i * 15 );
level.powerup_hud[ i ].y = level.powerup_hud[ i ].y - 35;
level.powerup_hud[ i ].alpha = 0.8;
}

shader_2x = "specialty_doublepoints_zombies";
shader_insta = "specialty_instakill_zombies";
shader_NEWPERK = "specialty_openfire"; // CHANGE HERE ===================================================================
shader_NEWPERK_2 = "specialty_warp"; // CHANGE HERE ===================================================================

while( true )
{
if ( level.zombie_vars[ "NEWPERKNAME_time" ] < 5 ) // CHANGE HERE ===================================================================
{
wait .1;
level.powerup_hud[ 3 ].alpha = 0;
wait .1;
}
else if( level.zombie_vars[ "NEWPERKNAME_time" ] < 10 ) // CHANGE HERE ===================================================================
{
wait .2;
level.powerup_hud[ 3 ].alpha = 0;
wait .18;
}
if ( level.zombie_vars[ "NEWPERKNAME_time" ] < 5 ) // CHANGE HERE ===================================================================
{
wait .1;
level.powerup_hud[ 2 ].alpha = 0;
wait .1;
}
else if( level.zombie_vars[ "NEWPERKNAME_time" ] < 10 ) // CHANGE HERE ===================================================================
{
wait .2;
level.powerup_hud[ 2 ].alpha = 0;
wait .18;
}
if( level.zombie_vars[ "zombie_powerup_insta_kill_time" ] < 5 )
{
wait .1;
level.powerup_hud[ 1 ].alpha = 0;
wait .1;
}
else if( level.zombie_vars[ "zombie_powerup_insta_kill_time" ] < 10 )
{
wait .2;
level.powerup_hud[ 1 ].alpha = 0;
wait .18;
}
if( level.zombie_vars[ "zombie_powerup_point_doubler_time" ] < 5 )
{
wait .1;
level.powerup_hud[ 0 ].alpha = 0;
wait .1;
}
else if( level.zombie_vars[ "zombie_powerup_point_doubler_time" ] < 10 )
{
wait .2;
level.powerup_hud[ 0 ].alpha = 0;
wait .18;
}

// ========================================================== ALL 4 ON ==============================================================

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" ] == true )  // CHANGE HERE ===================================================================
{

level.powerup_hud[ 0 ].x = -48;
level.powerup_hud[ 1 ].x = -24;
level.powerup_hud[ 2 ].x = 24;
level.powerup_hud[ 3 ].x = 48;

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[ 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 = 1;
level.powerup_hud[ 3 ].alpha = 1;
}

// ========================================================== 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;
}

// ========================================================== 2 ON ==============================================================

else if ( level.zombie_vars[ "zombie_powerup_point_doubler_on" ] == false && 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[ 2 ].x = -24;
level.powerup_hud[ 3 ].x = 24;

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 = 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" ] == false ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 1 ].x = -24;
level.powerup_hud[ 2 ].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[ 0 ].alpha = 0;
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" ] == false ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 0 ].x = -24;
level.powerup_hud[ 1 ].x = 24;

level.powerup_hud[ 0 ] setshader( shader_2x, 32, 32 );
level.powerup_hud[ 1 ] setshader( shader_insta, 32, 32 );

level.powerup_hud[ 0 ].alpha = 1;
level.powerup_hud[ 1 ].alpha = 1;
level.powerup_hud[ 2 ].alpha = 0;
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" ] == false && level.zombie_vars[ "NEWPERKNAME_on" ] == false && level.zombie_vars[ "NEWPERKNAME_2_on" ] == true ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 0 ].x = -24;
level.powerup_hud[ 3 ].x = 24;

level.powerup_hud[ 0 ] setshader( shader_2x, 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 = 0;
level.powerup_hud[ 2 ].alpha = 0;
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" ] == false && level.zombie_vars[ "NEWPERKNAME_2_on" ] == true ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 1 ].x = -24;
level.powerup_hud[ 3 ].x = 24;

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 = 0;
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" ] == false ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 1 ].x = -24;
level.powerup_hud[ 3 ].x = 24;

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 = 0;
level.powerup_hud[ 1 ].alpha = 1;
level.powerup_hud[ 2 ].alpha = 0;
level.powerup_hud[ 3 ].alpha = 1;
}

// ========================================================== 1 ON ==============================================================

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" ] == false && level.zombie_vars[ "NEWPERKNAME_2_on" ] == false ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 0 ].x = 0;

level.powerup_hud[ 0 ] setshader( shader_2x, 32, 32 );

level.powerup_hud[ 0 ].alpha = 1;
level.powerup_hud[ 1 ].alpha = 0;
level.powerup_hud[ 2 ].alpha = 0;
level.powerup_hud[ 3 ].alpha = 0;
}
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" ] == false && level.zombie_vars[ "NEWPERKNAME_2_on" ] == false ) // CHANGE HERE ===================================================================
{
level.powerup_hud[ 1 ].x = 0;

level.powerup_hud[ 1 ] setshader( shader_insta, 32, 32 );

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

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

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

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

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


randomize_powerups()
{
level.zombie_powerup_array = array_randomize( level.zombie_powerup_array );
}

get_next_powerup()
{
if( level.zombie_powerup_index >= level.zombie_powerup_array.size )
{
level.zombie_powerup_index = 0;
randomize_powerups();
}

powerup = level.zombie_powerup_array[level.zombie_powerup_index];

/#
if( isdefined( level.zombie_devgui_power ) && level.zombie_devgui_power == 1 )
return powerup;

#/

//level.windows_destroyed = get_num_window_destroyed();

while( powerup == "carpenter" && get_num_window_destroyed() < 5)
{


if( level.zombie_powerup_index >= level.zombie_powerup_array.size )
{
level.zombie_powerup_index = 0;
randomize_powerups();
}


powerup = level.zombie_powerup_array[level.zombie_powerup_index];
level.zombie_powerup_index++;

if( powerup != "carpenter" )
return powerup;


wait(0.05);
}

level.zombie_powerup_index++;

return powerup;
}

get_num_window_destroyed()
{
num = 0;
for( i = 0; i < level.exterior_goals.size; i++ )
{
/*targets = getentarray(level.exterior_goals[i].target, "targetname");

barrier_chunks = [];
for( j = 0; j < targets.size; j++ )
{
if( IsDefined( targets[j].script_noteworthy ) )
{
if( targets[j].script_noteworthy == "clip" )
{
continue;
}
}

barrier_chunks[barrier_chunks.size] = targets[j];
}*/


if( all_chunks_destroyed( level.exterior_goals[i].barrier_chunks ) )
{
num += 1;
}

}

return num;
}

watch_for_drop()
{
players = get_players();
score_to_drop = ( players.size * level.zombie_vars["zombie_score_start"] ) + level.zombie_vars["zombie_powerup_drop_increment"];

while (1)
{
players = get_players();

curr_total_score = 0;

for (i = 0; i < players.size; i++)
{
curr_total_score += players[i].score_total;
}

if (curr_total_score > score_to_drop )
{
level.zombie_vars["zombie_powerup_drop_increment"] *= 1.14;
score_to_drop = curr_total_score + level.zombie_vars["zombie_powerup_drop_increment"];
level.zombie_vars["zombie_drop_item"] = 1;
}

wait( 0.5 );
}
}

add_zombie_powerup( powerup_name, model_name, hint, fx )
{
if( IsDefined( level.zombie_include_powerups ) && !IsDefined( level.zombie_include_powerups[powerup_name] ) )
{
return;
}

PrecacheModel( model_name );
PrecacheString( hint );

struct = SpawnStruct();

if( !IsDefined( level.zombie_powerups ) )
{
level.zombie_powerups = [];
}

struct.powerup_name = powerup_name;
struct.model_name = model_name;
struct.weapon_classname = "script_model";
struct.hint = hint;

if( IsDefined( fx ) )
{
struct.fx = LoadFx( fx );
}

level.zombie_powerups[powerup_name] = struct;
level.zombie_powerup_array[level.zombie_powerup_array.size] = powerup_name;
add_zombie_special_drop( powerup_name );
}


// special powerup list for the teleporter drop
add_zombie_special_drop( powerup_name )
{
level.zombie_special_drop_array[ level.zombie_special_drop_array.size ] = powerup_name;
}

include_zombie_powerup( powerup_name )
{
if( !IsDefined( level.zombie_include_powerups ) )
{
level.zombie_include_powerups = [];
}

level.zombie_include_powerups[powerup_name] = true;
}

powerup_round_start()
{
level.powerup_drop_count = 0;
}

powerup_drop(drop_point)
{
rand_drop = randomint(100);

if( level.powerup_drop_count >= level.zombie_vars["zombie_powerup_drop_max_per_round"] )
{
println( "^3POWERUP DROP EXCEEDED THE MAX PER ROUND!" );
return;
}

if( !isDefined(level.zombie_include_powerups) || level.zombie_include_powerups.size == 0 )
{
return;
}

// some guys randomly drop, but most of the time they check for the drop flag
if (rand_drop > 2)
{
if (!level.zombie_vars["zombie_drop_item"])
{
return;
}

debug = "score";
}
else
{
debug = "random";
}

// never drop unless in the playable area
playable_area = getentarray("playable_area","targetname");

powerup = maps\_zombiemode_net::network_safe_spawn( "powerup", 1, "script_model", drop_point + (0,0,40));

//chris_p - fixed bug where you could not have more than 1 playable area trigger for the whole map
valid_drop = false;
for (i = 0; i < playable_area.size; i++)
{
if (powerup istouching(playable_area[i]))
{
valid_drop = true;
}
}

if(!valid_drop)
{
powerup delete();
return;
}

powerup powerup_setup();
level.powerup_drop_count++;

print_powerup_drop( powerup.powerup_name, debug );

powerup thread powerup_timeout();
powerup thread powerup_wobble();
powerup thread powerup_grab();

level.zombie_vars["zombie_drop_item"] = 0;


//powerup = powerup_setup();


// if is !is touching trig
// return

// spawn the model, do a ground trace and place above
// start the movement logic, spawn the fx
// start the time out logic
// start the grab logic
}


//
// Special power up drop - done outside of the powerup system.
special_powerup_drop(drop_point)
{
// if( level.powerup_drop_count == level.zombie_vars["zombie_powerup_drop_max_per_round"] )
// {
// println( "^3POWERUP DROP EXCEEDED THE MAX PER ROUND!" );
// return;
// }

if( !isDefined(level.zombie_include_powerups) || level.zombie_include_powerups.size == 0 )
{
return;
}

powerup = spawn ("script_model", drop_point + (0,0,40));

// never drop unless in the playable area
playable_area = getentarray("playable_area","targetname");
//chris_p - fixed bug where you could not have more than 1 playable area trigger for the whole map
valid_drop = false;
for (i = 0; i < playable_area.size; i++)
{
if (powerup istouching(playable_area[i]))
{
valid_drop = true;
break;
}
}

if(!valid_drop)
{
powerup Delete();
return;
}

powerup special_drop_setup();
}


//
// Pick the next powerup in the list
powerup_setup()
{
powerup = get_next_powerup();

struct = level.zombie_powerups[powerup];
self SetModel( struct.model_name );

//TUEY Spawn Powerup
playsoundatposition("spawn_powerup", self.origin);

self.powerup_name = struct.powerup_name;
self.hint = struct.hint;

if( IsDefined( struct.fx ) )
{
self.fx = struct.fx;
}

self PlayLoopSound("spawn_powerup_loop");
}


//
// Get the special teleporter drop
special_drop_setup()
{
powerup = undefined;
is_powerup = true;
// Always give something at lower rounds or if a player is in last stand mode.
if ( level.round_number <= 10 || maps\_laststand::player_num_in_laststand() )
{
powerup = get_next_powerup();
}
// Gets harder now
else
{
powerup = level.zombie_special_drop_array[ RandomInt(level.zombie_special_drop_array.size) ];
if ( level.round_number > 15 &&
( RandomInt(100) < (level.round_number - 15)*5 ) )
{
powerup = "nothing";
}
}
//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":
break;

// Limit max ammo drops because it's too powerful
case "full_ammo":
if ( level.round_number > 10 &&
( RandomInt(100) < (level.round_number - 10)*5 ) )
{
// Randomly pick another one
powerup = level.zombie_powerup_array[ RandomInt(level.zombie_powerup_array.size) ];
}
break;

case "dog":
if ( level.round_number >= 15 )
{
is_powerup = false;
dog_spawners = GetEntArray( "special_dog_spawner", "targetname" );
maps\_zombiemode_dogs::special_dog_spawn( dog_spawners, 1 );
//iprintlnbold( "Samantha Sez: No Powerup For You!" );
thread play_sound_2d( "sam_nospawn" );
}
else
{
powerup = get_next_powerup();
}
break;

// Nothing drops!!
default: // "nothing"
is_powerup = false;
Playfx( level._effect["lightning_dog_spawn"], self.origin );
playsoundatposition( "pre_spawn", self.origin );
wait( 1.5 );
playsoundatposition( "bolt", self.origin );

Earthquake( 0.5, 0.75, self.origin, 1000);
PlayRumbleOnPosition("explosion_generic", self.origin);
playsoundatposition( "spawn", self.origin );

wait( 1.0 );
//iprintlnbold( "Samantha Sez: No Powerup For You!" );
thread play_sound_2d( "sam_nospawn" );
self Delete();
}

if ( is_powerup )
{
Playfx( level._effect["lightning_dog_spawn"], self.origin );
playsoundatposition( "pre_spawn", self.origin );
wait( 1.5 );
playsoundatposition( "bolt", self.origin );

Earthquake( 0.5, 0.75, self.origin, 1000);
PlayRumbleOnPosition("explosion_generic", self.origin);
playsoundatposition( "spawn", self.origin );

// wait( 0.5 );

struct = level.zombie_powerups[powerup];
self SetModel( struct.model_name );

//TUEY Spawn Powerup
playsoundatposition("spawn_powerup", self.origin);

self.powerup_name = struct.powerup_name;
self.hint = struct.hint;

if( IsDefined( struct.fx ) )
{
self.fx = struct.fx;
}

self PlayLoopSound("spawn_powerup_loop");

self thread powerup_timeout();
self thread powerup_wobble();
self thread powerup_grab();
}
}

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;

default:
println ("Unrecognized poweup.");
break;
}
}

wait( 0.1 );

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

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

start_carpenter( origin )
{

level thread play_devil_dialog("carp_vox");
window_boards = getstructarray( "exterior_goal", "targetname" );
total = level.exterior_goals.size;

//COLLIN
carp_ent = spawn("script_origin", (0,0,0));
carp_ent playloopsound( "carp_loop" );

while(true)
{
windows = get_closest_window_repair(window_boards, origin);
if( !IsDefined( windows ) )
{
carp_ent stoploopsound( 1 );
carp_ent playsound( "carp_end", "sound_done" );
carp_ent waittill( "sound_done" );
break;
}

else
window_boards = array_remove(window_boards, windows);


while(1)
{
if( all_chunks_intact( windows.barrier_chunks ) )
{
break;
}

chunk = get_random_destroyed_chunk( windows.barrier_chunks );

if( !IsDefined( chunk ) )
break;

windows thread maps\_zombiemode_blockers_new::replace_chunk( chunk, false, true );
windows.clip enable_trigger();
windows.clip DisconnectPaths();
wait_network_frame();
wait(0.05);
}
 

wait_network_frame();

}


players = get_players();
for(i = 0; i < players.size; i++)
{
players[i].score += 200;
players[i].score_total += 200;
players[i] maps\_zombiemode_score::set_player_score_hud();
}


carp_ent delete();


}
get_closest_window_repair( windows, origin )
{
current_window = undefined;
shortest_distance = undefined;
for( i = 0; i < windows.size; i++ )
{
if( all_chunks_intact(windows[i].barrier_chunks ) )
continue;

if( !IsDefined( current_window ) )
{
current_window = windows[i];
shortest_distance = DistanceSquared( current_window.origin, origin );

}
else
{
if( DistanceSquared(windows[i].origin, origin) < shortest_distance )
{

current_window = windows[i];
shortest_distance =  DistanceSquared( windows[i].origin, origin );
}

}

}

return current_window;


}

powerup_vo(type)
{
self endon("death");
self endon("disconnect");

index = maps\_zombiemode_weapons::get_player_index(self);
sound = undefined;
rand = randomintrange(0,3);
vox_rand = randomintrange(1,100);  //RARE: This is to setup the Rare devil response lines
percentage = 1;  //What percent chance the rare devil response line has to play

if(!isdefined (level.player_is_speaking))
{
level.player_is_speaking = 0;
}

wait(randomfloatrange(1,2));

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;
}

//This keeps multiple voice overs from playing on the same player (both killstreaks and headshots).
if (level.player_is_speaking != 1 && isDefined(sound))
{
level.player_is_speaking = 1;
self playsound(sound, "sound_done");
self waittill("sound_done");
level.player_is_speaking = 0;
}


}

powerup_wobble()
{
self endon ("powerup_grabbed");
self endon ("powerup_timedout");

if (isdefined(self))
{
playfxontag (level._effect["powerup_on"], self, "tag_origin");
}

while (isdefined(self))
{
waittime = randomfloatrange(2.5, 5);
yaw = RandomInt( 360 );
if( yaw > 300 )
{
yaw = 300;
}
else if( yaw < 60 )
{
yaw = 60;
}
yaw = self.angles[1] + yaw;
self rotateto ((-60 + randomint(120), yaw, -45 + randomint(90)), waittime, waittime * 0.5, waittime * 0.5);
wait randomfloat (waittime - 0.1);
}
}

powerup_timeout()
{
self endon ("powerup_grabbed");

wait 15;

for (i = 0; i < 40; i++)
{
// hide and show
if (i % 2)
{
self hide();
}
else
{
self show();
}

if (i < 15)
{
wait 0.5;
}
else if (i < 25)
{
wait 0.25;
}
else
{
wait 0.1;
}
}

self notify ("powerup_timedout");
self delete();
}

// kill them all!
nuke_powerup( drop_item )
{
zombies = getaispeciesarray("axis");

PlayFx( drop_item.fx, drop_item.origin );
// players = get_players();
// array_thread (players, ::nuke_flash);
level thread nuke_flash();



zombies = get_array_of_closest( drop_item.origin, zombies );

for (i = 0; i < zombies.size; i++)
{
wait (randomfloatrange(0.1, 0.7));
if( !IsDefined( zombies[i] ) )
{
continue;
}

if( zombies[i].animname == "boss_zombie" )
{
continue;
}

if( is_magic_bullet_shield_enabled( zombies[i] ) )
{
continue;
}

if( i < 5 && !( zombies[i] enemy_is_dog() ) )
{
zombies[i] thread animscripts\death::flame_death_fx();

}

if( !( zombies[i] enemy_is_dog() ) )
{
zombies[i] maps\_zombiemode_spawner::zombie_head_gib();
}

zombies[i] dodamage( zombies[i].health + 666, zombies[i].origin );
playsoundatposition( "nuked", zombies[i].origin );
}

players = get_players();
for(i = 0; i < players.size; i++)
{
players[i].score += 400;
players[i].score_total += 400;
players[i] maps\_zombiemode_score::set_player_score_hud();
}

}

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();
}

// double the points
double_points_powerup( drop_item )
{
level notify ("powerup points scaled");
level endon ("powerup points scaled");

// players = get_players();
// array_thread(level,::point_doubler_on_hud, drop_item);
level thread point_doubler_on_hud( drop_item );

level.zombie_vars["zombie_point_scalar"] = 2;
wait 30;

level.zombie_vars["zombie_point_scalar"] = 1;
}

full_ammo_powerup( drop_item )
{
players = get_players();

for (i = 0; i < players.size; i++)
{
primaryWeapons = players[i] GetWeaponsList();

for( x = 0; x < primaryWeapons.size; x++ )
{
players[i] GiveMaxAmmo( primaryWeapons[x] );
}
}
// array_thread (players, ::full_ammo_on_hud, drop_item);
level thread full_ammo_on_hud( drop_item );
}

insta_kill_powerup( drop_item )
{
level notify( "powerup instakill" );
level endon( "powerup instakill" );


// array_thread (players, ::insta_kill_on_hud, drop_item);
level thread insta_kill_on_hud( drop_item );

level.zombie_vars["zombie_insta_kill"] = 1;
wait( 30 );
level.zombie_vars["zombie_insta_kill"] = 0;
players = get_players();
for(i = 0; i < players.size; i++)
{
players[i] notify("insta_kill_over");

}

}

check_for_instakill( player )
{
if( IsDefined( player ) && IsAlive( player ) && level.zombie_vars["zombie_insta_kill"])
{
if( is_magic_bullet_shield_enabled( self ) )
{
return;
}

if( self.animname == "boss_zombie" )
{
return;
}

if(player.use_weapon_type == "MOD_MELEE")
{
player.last_kill_method = "MOD_MELEE";
}
else
{
player.last_kill_method = "MOD_UNKNOWN";

}

if( flag( "dog_round" ) )
{
self DoDamage( self.health + 666, self.origin, player );
player notify("zombie_killed");
}
else
{
self maps\_zombiemode_spawner::zombie_head_gib();
self DoDamage( self.health + 666, self.origin, player );
player notify("zombie_killed");

}
}
}

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;
}

time_remaning_on_insta_kill_powerup()
{
//self setvalue( level.zombie_vars["zombie_powerup_insta_kill_time"] );
level thread play_devil_dialog("insta_vox");
temp_enta = spawn("script_origin", (0,0,0));
temp_enta playloopsound("insta_kill_loop");

/*
players = get_players();
for (i = 0; i < players.size; i++)
{
players[i] playloopsound ("insta_kill_loop");
}
*/


// time it down!
while ( level.zombie_vars["zombie_powerup_insta_kill_time"] >= 0)
{
wait 0.1;
level.zombie_vars["zombie_powerup_insta_kill_time"] = level.zombie_vars["zombie_powerup_insta_kill_time"] - 0.1;
// self setvalue( level.zombie_vars["zombie_powerup_insta_kill_time"] );
}

players = get_players();
for (i = 0; i < players.size; i++)
{
//players[i] stoploopsound (2);

players[i] playsound("insta_kill");

}

temp_enta stoploopsound(2);
// turn off the timer
level.zombie_vars["zombie_powerup_insta_kill_on"] = false;

// remove the offset to make room for new powerups, reset timer for next time
level.zombie_vars["zombie_powerup_insta_kill_time"] = 30;
//level.zombie_timer_offset += level.zombie_timer_offset_interval;
//self destroy();
temp_enta delete();
}

point_doubler_on_hud( drop_item )
{
self endon ("disconnect");

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

level.zombie_vars["zombie_powerup_point_doubler_on"] = true;
//level.powerup_hud_array[0] = 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"] );
//hudelem.sort = 0.5;
//hudelem.alpha = 0;
//hudelem fadeovertime( 0.5 );
//hudelem.alpha = 1;
//hudelem.label = drop_item.hint;

// set time remaining for point doubler
level thread time_remaining_on_point_doubler_powerup();

// offset in case we get another powerup
//level.zombie_timer_offset -= level.zombie_timer_offset_interval;
}
play_devil_dialog(sound_to_play)
{
if(!IsDefined(level.devil_is_speaking))
{
level.devil_is_speaking = 0;
}
if(level.devil_is_speaking == 0)
{
level.devil_is_speaking = 1;
play_sound_2D( sound_to_play );
wait 2.0;
level.devil_is_speaking =0;
}

}
time_remaining_on_point_doubler_powerup()
{
//self setvalue( level.zombie_vars["zombie_powerup_point_doubler_time"] );

temp_ent = spawn("script_origin", (0,0,0));
temp_ent playloopsound ("double_point_loop");

level thread play_devil_dialog("dp_vox");


// time it down!
while ( level.zombie_vars["zombie_powerup_point_doubler_time"] >= 0)
{
wait 0.1;
level.zombie_vars["zombie_powerup_point_doubler_time"] = level.zombie_vars["zombie_powerup_point_doubler_time"] - 0.1;
//self setvalue( level.zombie_vars["zombie_powerup_point_doubler_time"] );
}

// turn off the timer
level.zombie_vars["zombie_powerup_point_doubler_on"] = false;
players = get_players();
for (i = 0; i < players.size; i++)
{
//players[i] stoploopsound("double_point_loop", 2);
players[i] playsound("points_loop_off");
}
temp_ent stoploopsound(2);


// remove the offset to make room for new powerups, reset timer for next time
level.zombie_vars["zombie_powerup_point_doubler_time"] = 30;
//level.zombie_timer_offset += level.zombie_timer_offset_interval;
//self destroy();
temp_ent delete();
}
devil_dialog_delay()
{
wait(1.8);
level thread play_devil_dialog("nuke_vox");

}
full_ammo_on_hud( drop_item )
{
self endon ("disconnect");

// 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"] * 2));
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
hudelem thread full_ammo_move_hud();

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

full_ammo_move_hud()
{

players = get_players();
level thread play_devil_dialog("ma_vox");
for (i = 0; i < players.size; i++)
{
players[i] playsound ("full_ammo");

}
wait 0.5;
move_fade_time = 1.5;

self FadeOverTime( move_fade_time );
self MoveOverTime( move_fade_time );
self.y = 270;
self.alpha = 0;

wait move_fade_time;

self destroy();
}

//
// DEBUG
//

print_powerup_drop( powerup, type )
{
/#
if( !IsDefined( level.powerup_drop_time ) )
{
level.powerup_drop_time = 0;
level.powerup_random_count = 0;
level.powerup_score_count = 0;
}

time = ( GetTime() - level.powerup_drop_time ) * 0.001;
level.powerup_drop_time = GetTime();

if( type == "random" )
{
level.powerup_random_count++;
}
else
{
level.powerup_score_count++;
}

println( "========== POWER UP DROPPED ==========" );
println( "DROPPED: " + powerup );
println( "HOW IT DROPPED: " + type );
println( "--------------------" );
println( "Drop Time: " + time );
println( "Random Powerup Count: " + level.powerup_random_count );
println( "Random Powerup Count: " + level.powerup_score_count );
println( "======================================" );
#/
}
Title: Re: Power Up Shader?
Post by: MJPWGaming on July 19, 2015, 08:26:49 am
Infact I just deleted what I wrote to you and did it for you, as im home now, but I would suggest reading through it to see what i did, this is basically a flow chart

if ( insta on, dbl on, powerup 3 on, power up 4 on ) -> then display all 4
if ( insta on, dbl on, powerup 3 on, power up 4 off ) -> then display the first 3, but not the 4th
if ( insta on, dbl on, powerup 3 of, power up 4 on ) -> then display1, 2 and 4, but "not" 3

and in those if / else statements, it alligns the shaders "x", otherwise they wouldnt move into place properly when one ran out

Yes I have that all down and everything is in its correct place :( here is my entire power up script

Code Snippet
Plaintext
REMOVED: Due to secrets
Title: Re: Power Up Shader?
Post by: Harry Bo21 on July 19, 2015, 08:27:59 am
looks alright to me, still not working? Giving an error?

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;
Title: Re: Power Up Shader?
Post by: MJPWGaming on July 19, 2015, 08:29:36 am
looks alright to me, still not working? Giving an error?

Still not working :( and no errors just no shaders (except the X2 Points and Instakill)
Title: Re: Power Up Shader?
Post by: Harry Bo21 on July 19, 2015, 08:30:08 am
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;
Title: Re: Power Up Shader?
Post by: MJPWGaming on July 19, 2015, 09:02:23 am
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.
Title: Re: Power Up Shader?
Post by: Harry Bo21 on July 19, 2015, 09:16:57 am
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...
Title: Re: Power Up Shader?
Post by: MJPWGaming on July 19, 2015, 09:28:59 am
your not setting the timer

Would it look like this?

Code Snippet
Plaintext
REMOVED: Due to secrets
Title: Re: Power Up Shader?
Post by: Harry Bo21 on July 19, 2015, 07:34:31 pm
looks fine to me ;)
Title: Re: Power Up Shader?
Post by: ProGamerzFTW on July 19, 2015, 08:39:32 pm
What would be better is to dynamically adjust the hud depending on how many powerups are active.
Title: Re: Power Up Shader?
Post by: Harry Bo21 on July 19, 2015, 08:49:00 pm
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
Title: Re: Power Up Shader?
Post by: ProGamerzFTW on July 19, 2015, 08:53:35 pm
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.
Title: Re: Power Up Shader?
Post by: Harry Bo21 on July 19, 2015, 08:56:30 pm
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 :
Title: Re: Power Up Shader?
Post by: ProGamerzFTW on July 19, 2015, 08:58:44 pm
again.... ive said this multiple times :

Ahh, my apologies, I missed that. Forgive me. lol  :please:
Title: Re: Power Up Shader?
Post by: Harry Bo21 on July 19, 2015, 09:09:13 pm
lol its all good ;)
Title: Re: Power Up Shader?
Post by: MJPWGaming on July 19, 2015, 10:52:39 pm
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?
Title: Re: Power Up Shader?
Post by: Harry Bo21 on July 19, 2015, 11:16:43 pm
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
Title: Re: Power Up Shader?
Post by: MJPWGaming on July 19, 2015, 11:41:51 pm
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?
Title: Re: Power Up Shader?
Post by: Harry Bo21 on July 19, 2015, 11:54:03 pm
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
Title: Re: Power Up Shader?
Post by: MJPWGaming on July 20, 2015, 02:02:06 am
lol oh boy...

thread the function on a trigger or something

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

You are the man! I tweaked it all and chenged up the Insta Kill and 2X thread to not have it being all glitchy and everything works the way it should :)

I really appreciate how youve helped me threw the whole thing not many people would do that <3

Ive +1'd you after every post the last day or so :)

(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fi.gyazo.com%2F1cd8712d9ee5843825630d50df6ff028.png&hash=10ebf384d2e4967154d451ea140b0246bbe81e96)
Title: Re: Power Up Shader?
Post by: Harry Bo21 on July 20, 2015, 02:26:54 am
lol yeah i assumed that was you

your welcome man ;)