custom powerup

broken avatar :(
Created 2669 days ago
by KDXDARK
0 Members and 1 Guest are viewing this topic.
6,389 views
broken avatar :(
×
broken avatar :(
Relentless Mapper
Location: arSan Cristobal
Date Registered: 21 August 2011
Last active: 2 days ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
Nuclear
My Groups
More
My Contact & Social Links
More
Personal Quote
Time of revenge
Signature
"Nada sale como quiero, es por eso que renuncie a muchas cosas en mi vida, entre ellas, vivir"
×
KDXDARK's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Nuclear
Nuclear
DARKLEGION's requested title
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
KDXDARK's Contact & Social LinksKDXDARKKDXDARKKDXDARKKDXDARK
i make a custom powerup but not work somebody can help me? here is the  _zombiemode_powerups.gsc

[noae]
#include maps\_utility; 
#include common_scripts\utility;
#include maps\_zombiemode_utility;

init()
{

PrecacheShader( "specialty_doublepoints_zombies" );
PrecacheShader( "specialty_instakill_zombies" );



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

// 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_powerup( "teddy",     "zombie_teddybear", &"ZOMBIE_POWERUP_teddy");

// 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_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);
//}

}

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;
case "teddy":
level thread teddy_powerup( self );
break;

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

wait( 0.1 );

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

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

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

}
teddy_powerup( drop_item )
{
PlayFx( drop_item.fx, drop_item.origin );
    players = get_players();
    for (i = 0; i < players.size; i++)
    self iPrintLnBold("^2You move twice as fast, have fun");
self setmovespeedscale(2.0);
// use this method if your map is time based
wait(60); // how long you want this powerup to last
//  use this method if you map is round based
// level waittill("between_round_over");  use this method if you map is round based
self iPrintLnBold("^1You have returned to normal speed");
self setmovespeedscale(1.0);
}

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( "======================================" );
#/
}
[/noae]
the powerup name its teddy
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 13 days ago
Posts
5,545
Respect
6,484Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Signature
If Java had true garbage collection, most programs would delete themselves upon execution.
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
I'll check it out when I get home later - otherwise maybe someone else here can help you earlier.
broken avatar :(
×
broken avatar :(
Location: 00
Date Registered: 13 March 2012
Last active: 466 days ago
Posts
43
Respect
Forum Rank
Legless Crawler
Primary Group
Community Mapper Elite
My Groups
More
My Contact & Social Links
More
Signature
[You are not allowed to view external links. Register or Login to see them]
×
CoDMapper's Groups
Community Mapper Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
CoDMapper's Contact & Social LinksCoDMapperCoDMapper
I'm not at my pc ATM but I will be soon and I can check it out, but from what I can remember there is a function in your maps main .gsc like include_powerups(); and you should have your new powerup in there.
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 13 days ago
Posts
5,545
Respect
6,484Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
I'm not at my pc ATM but I will be soon and I can check it out, but from what I can remember there is a function in your maps main .gsc like include_powerups(); and you should have your new powerup in there.
It was moved to dlc3_code.gsc for 1.4 maps.
broken avatar :(
×
broken avatar :(
Location: 00
Date Registered: 13 March 2012
Last active: 466 days ago
Posts
43
Respect
Forum Rank
Legless Crawler
Primary Group
Community Mapper Elite
My Groups
More
My Contact & Social Links
More
×
CoDMapper's Groups
Community Mapper Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
CoDMapper's Contact & Social LinksCoDMapperCoDMapper
I'm outdated..
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 13 days ago
Posts
5,545
Respect
6,484Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
I'm outdated..
lol.

But yeah I'm still at school so I'll check it out in a few hours if you haven't solved it by then.
broken avatar :(
×
broken avatar :(
Date Registered: 14 March 2012
Last active: 2174 days ago
Posts
105
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
i love zombies
×
ZMBS DON GOONY's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
ZMBS DON GOONY's Contact & Social LinksZMBS_DON_GOONY
the only thing it looks like he forgot to do is open his mapname gsc
and add in the dlc powerup section

include_powerup( "teddy" );
broken avatar :(
×
broken avatar :(
Relentless Mapper
Location: arSan Cristobal
Date Registered: 21 August 2011
Last active: 2 days ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
Nuclear
My Groups
More
My Contact & Social Links
More
Personal Quote
Time of revenge
×
KDXDARK's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Nuclear
Nuclear
DARKLEGION's requested title
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
KDXDARK's Contact & Social LinksKDXDARKKDXDARKKDXDARKKDXDARK
somebody can help me to fix it?
broken avatar :(
×
broken avatar :(
Date Registered: 14 March 2012
Last active: 2174 days ago
Posts
105
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
i love zombies
×
ZMBS DON GOONY's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
ZMBS DON GOONY's Contact & Social LinksZMBS_DON_GOONY
find this in your mapname gsc

// Power Ups. Pointer function automatically loads power ups used in Der Riese.
level.DLC3.powerUps =  maps\dlc3_code::include_powerups;

and add this
 
// Power Ups. Pointer function automatically loads power ups used in Der Riese.
level.DLC3.powerUps =  maps\dlc3_code::include_powerups;
        include_powerup( "teddy" );


also make sure you call your model in zone source
Last Edit: May 01, 2012, 06:58:22 am by ZMBS DON GOONY
broken avatar :(
×
broken avatar :(
Relentless Mapper
Location: arSan Cristobal
Date Registered: 21 August 2011
Last active: 2 days ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
Nuclear
My Groups
More
My Contact & Social Links
More
Personal Quote
Time of revenge
×
KDXDARK's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Nuclear
Nuclear
DARKLEGION's requested title
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
KDXDARK's Contact & Social LinksKDXDARKKDXDARKKDXDARKKDXDARK
i do that i follow this tutorial [You are not allowed to view external links. Register or Login to see them]

but i wanna edit it for have infinit ammo or more speed or random
broken avatar :(
×
broken avatar :(
Date Registered: 14 March 2012
Last active: 2174 days ago
Posts
105
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
i love zombies
×
ZMBS DON GOONY's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
ZMBS DON GOONY's Contact & Social LinksZMBS_DON_GOONY
just open up your zone source and add this in your mapname csv
xmodel,zombie_teddybear
broken avatar :(
×
broken avatar :(
Date Registered: 14 March 2012
Last active: 2174 days ago
Posts
105
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
i love zombies
×
ZMBS DON GOONY's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
ZMBS DON GOONY's Contact & Social LinksZMBS_DON_GOONY
thats the model you called in your script
by the way i lost my map gsc and csv but i still hav my mod folder and it works when i load it is the a way i can take what i build in radiant and add it to the mod some how ??
broken avatar :(
×
broken avatar :(
Relentless Mapper
Location: arSan Cristobal
Date Registered: 21 August 2011
Last active: 2 days ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
Nuclear
My Groups
More
My Contact & Social Links
More
Personal Quote
Time of revenge
×
KDXDARK's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Nuclear
Nuclear
DARKLEGION's requested title
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
KDXDARK's Contact & Social LinksKDXDARKKDXDARKKDXDARKKDXDARK
the powerup work but i grab it and odn't pass nothing i put fo increases the speed of the player
Last Edit: May 01, 2012, 06:01:51 pm by DARKLEGION
broken avatar :(
×
broken avatar :(
Date Registered: 14 March 2012
Last active: 2174 days ago
Posts
105
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
i love zombies
×
ZMBS DON GOONY's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
ZMBS DON GOONY's Contact & Social LinksZMBS_DON_GOONY
the powerup work but i grab it and odn't pass nothing i put fo increases the speed of the player


OK it looks like u have yo powerup code in the wrong spot try this im not sure but hopefully it works i will stay on and finish looking thru this if ur gonna test it quick

[Admin edit: code removed (broken)]
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 13 days ago
Posts
5,545
Respect
6,484Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Do you still need help?

 

Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Twitch
Loading ...