UGX-Mods Login

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

Bam's Add-Ons - Main [Updated 5/10/14 6:30 PM]

HOT
broken avatar :(
Created 10 years ago
by jei9363
0 Members and 1 Guest are viewing this topic.
37,386 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 1 year ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Signature
Hey if you had tons of fun on playing my maps please DONATE :)

play ESTATE now, and claim your mansion back from the undead!
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
jei9363's Contact & Social Linksjei9363jei9363jayingardia
if it crashed due to a Porter shader error, redownload the IWDs.

if the machines are invisible delete your mapname_patch from your modding folder
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 4 October 2012
Last active: 1 year ago
Posts
147
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Zombie Detailer
Signature
Nacht_DTW_1.1- COMPLETE
Hobo_Ville-COMPLETE
Hobo1.1-Might never happen.
Necro_City-not in my hands anymore.
Ghost_Swamp:75%
×
Weezy428's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Weezy428's Contact & Social Linksweezy428zombieweezy428Weezy428
if it crashed due to a Porter shader error, redownload the IWDs.

if the machines are invisible delete your mapname_patch from your modding folder

It crashes with no error, just crashes. Its after  I add your patch file. Also I deleted my original patch file and never re compiled it since. But if I add my patch file to the (appdata folder)then my map works.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 1 year ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
jei9363's Contact & Social Linksjei9363jei9363jayingardia
it still seems like you didnt download the all_IWDs file, and replace everything in your appdata
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 4 October 2012
Last active: 1 year ago
Posts
147
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Zombie Detailer
×
Weezy428's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Weezy428's Contact & Social Linksweezy428zombieweezy428Weezy428
it still seems like you didnt download the all_IWDs file, and replace everything in your appdata
ill try to do that again but I grabbed all the files from this page and overwritten the old.



Nope didnt work.
Last Edit: May 13, 2014, 04:13:35 am by Weezy428
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 1 year ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
jei9363's Contact & Social Linksjei9363jei9363jayingardia
are you making a v1.4 Der Riese style map?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 4 October 2012
Last active: 1 year ago
Posts
147
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Zombie Detailer
×
Weezy428's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Weezy428's Contact & Social Linksweezy428zombieweezy428Weezy428
are you making a v1.4 Der Riese style map?
yeah
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 1 year ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
jei9363's Contact & Social Linksjei9363jei9363jayingardia
what happens if you use your mapname_patch? invisible machines, but with functionality?

If so, the only way my patch will cause the crash is a missing image for a material it's looking for.

have you uncalled my black ops perk call in _zombiemode?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 4 October 2012
Last active: 1 year ago
Posts
147
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Zombie Detailer
×
Weezy428's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Weezy428's Contact & Social Linksweezy428zombieweezy428Weezy428
what happens if you use your mapname_patch? invisible machines, but with functionality?

If so, the only way my patch will cause the crash is a missing image for a material it's looking for.

have you uncalled my black ops perk call in _zombiemode?
yes the machines work w/o your patch but invisible (and after I buy a working perk). I have gone into my zombiemode and commented it out to test. this is my _zombiemode.

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

#using_animtree( "generic_human" );

main(init_zombie_spawner_name)
{
// Put this somewhere after _zombiemode::main() - YaPh1l
players = get_players();
for(i = 0; i < players.size; i++)
{
    // Places the FX roughly at half of the player's height
    ent = Spawn("script_model", players[i].origin + (0, 0, 36));
    ent SetModel("tag_origin");
    PlayFxOnTag(level._effect["flashlight"], ent, "tag_origin");
    ent LinkTo(players[i]);
}

precache_shaders();
precache_models();

PrecacheItem( "fraggrenade" );
PrecacheItem( "zombie_colt" );
//PrecacheItem( "claymore_zm" );

init_strings();
init_levelvars();
init_animscripts();
init_sounds();
init_shellshocks();
init_flags();

//Limit zombie to 24 max, must have for network purposes
SetAILimit( 24 );
// the initial spawners
if( !IsDefined( init_zombie_spawner_name) )
{
level.enemy_spawns = getEntArray( "zombie_spawner_init", "targetname" );
}
else
{
level.enemy_spawns = getEntArray( init_zombie_spawner_name, "targetname" );
}

level.zombie_rise_spawners = [];

//maps\_destructible_type94truck::init();

level.custom_introscreen = ::zombie_intro_screen;
level.custom_intermission = ::player_intermission;
level.reset_clientdvars = ::onPlayerConnect_clientDvars;

init_fx();


// load map defaults
maps\_load::main();

level.hudelem_count = 0;
// Call the other zombiemode scripts
if( level.script == "nazi_zombie_sumpf" )
{
maps\_zombiemode_weapons_sumpf::init();
}
else
{
maps\_zombiemode_weapons::init();
}
maps\_zombiemode_blockers_new::init();
maps\_zombiemode_spawner::init();
maps\_zombiemode_powerups::init();
maps\_zombiemode_radio::init();
maps\_zombiemode_perks::init();
maps\_zombiemode_tesla::init();
//maps\_zombiemode_dogs::init();
maps\_zombiemode_bowie::bowie_init();
maps\_zombiemode_cymbal_monkey::init();
//maps\_zombiemode_claymore::init();
maps\_zombiemode_betty::init();
maps\_zombiemode_timer::init();
maps\_zombiemode_auto_turret::init();
//maps\_zombiemode_perks_black_ops::init();
maps\_zombiemode_thundergun::init();
//maps\_zombiemode_double_swtich_door::init();
//maps\_kinostyle_teleporter::init();
maps\bam_bo_mod_e_cherry_standalone::cherry_init();
level.vulture_chance = 40; //percent per zombie for dropping goodies
level.vulture_limit = 8; //cap how many waypoints can be seen
level.vulture_packets_limit = 5; //cap number of packets on ground
level.vulture_range = 2048; //see visibility limit for way points
level.vulture_range_min = 256; //is the player close enough to not need help?
level.stink_time = 10;              //how long does the stink smoke last?
level.makeStinkTime = 20; //how long until trying to give another zombie stink?
    maps\bam_bo_mod_vulture_aid_standalone::vulture_init();
level.perk_limit = 9;
    level.revive_point = getEnt("revive_retreat_point","targetname");
    maps\bam_bo_mod_bo1_perks_standalone::bo1_perks_init();

/#
maps\_zombiemode_devgui::init();
#/

init_utility();

// register a client system...
maps\_utility::registerClientSys("zombify");

// level thread coop_player_spawn_placement();

// zombie ai and anim inits
init_anims();

if( isDefined( level.custom_ai_type ) )
{
for( i = 0; i < level.custom_ai_type.size; i++ )
{
[[ level.custom_ai_type[i] ]]();
}
}


// Sets up function pointers for animscripts to refer to
level.playerlaststand_func = ::player_laststand;
// level.global_kill_func = maps\_zombiemode_spawner::zombie_death;
level.global_damage_func = maps\_zombiemode_spawner::zombie_damage;
level.global_damage_func_ads = maps\_zombiemode_spawner::zombie_damage_ads;
level.overridePlayerKilled = ::player_killed_override;
level.overridePlayerDamage = ::player_damage_override;

level.melee_miss_func = maps\_zombiemode::zombiemode_melee_miss;

if( !IsDefined( level.Player_Spawn_func ) )
{
level.Player_Spawn_func = ::coop_player_spawn_placement;
}

level thread [[level.Player_Spawn_func]]();
// used to a check in last stand for players to become zombies
level.is_zombie_level = true;
level.player_becomes_zombie = ::zombify_player;

// so we dont get the uber colt when we're knocked out
level.laststandpistol = "colt";

level.round_start_time = 0;

level thread onPlayerConnect();

init_dvars();
initZombieLeaderboardData();


flag_wait( "all_players_connected" );

bbPrint( "sessions: mapname %s gametype zom isserver 1", level.script );



//thread zombie_difficulty_ramp_up();

// Start the Zombie MODE!
level thread end_game();
level thread round_start();
level thread players_playing();
if ( IsDefined( level.crawlers_enabled ) && level.crawlers_enabled == 1 )
{
level thread crawler_round_tracker();
}

//chrisp - adding spawning vo
level thread spawn_vo();

//add ammo tracker for VO
level thread track_players_ammo_count();

//level thread prevent_near_origin();

DisableGrenadeSuicide();

level.startInvulnerableTime = GetDvarInt( "player_deathInvulnerableTime" );

// Do a SaveGame, so we can restart properly when we die
SaveGame( "zombie_start", &"AUTOSAVE_LEVELSTART", "", true );

// TESTING
// wait( 3 );
// level thread intermission();
// thread testing_spawner_bug();

if(!IsDefined(level.eggs) )
{
level.eggs = 0;
}
level.mixed_rounds_enabled = false;
}

zombiemode_melee_miss()
{
if( isDefined( self.enemy.curr_pay_turret ) )
{
self.enemy DoDamage( (60 / GetDvarFloat("player_damageMultiplier")), self.origin, self, self );
}
}

/*------------------------------------
chrisp - adding vo to track players ammo
------------------------------------*/
track_players_ammo_count()
{
self endon("disconnect");
self endon("death");
if(!IsDefined (level.player_ammo_low))
{
level.player_ammo_low = 0;
}
if(!IsDefined(level.player_ammo_out))
{
level.player_ammo_out = 0;
}
while(1)
{
players = get_players();
for(i=0;i<players.size;i++)
{

weap = players[i] getcurrentweapon();
//iprintln("current weapon: " + weap);
//iprintlnbold(weap);
//Excludes all Perk based 'weapons' so that you don't get low ammo spam.
if(!isDefined(weap) || weap == "none" || weap == "zombie_perk_bottle_doubletap" || weap == "zombie_perk_bottle_jugg" || weap == "zombie_perk_bottle_revive" || weap == "zombie_perk_bottle_sleight" || weap == "mine_bouncing_betty" || weap == "syrette" || weap == "zombie_knuckle_crack" || weap == "zombie_bowie_flourish" )
{
continue;
}
//iprintln("checking ammo for " + weap);
if ( players[i] GetAmmoCount( weap ) > 5)
{
continue;
}
if ( players[i] maps\_laststand::player_is_in_laststand() )
{
continue;
}
else if (players[i] GetAmmoCount( weap ) < 5 && players[i] GetAmmoCount( weap ) > 0)
{
if (level.player_ammo_low == 0)
{
level.player_ammo_low = 1;
players[i] thread add_low_ammo_dialog();
players[i] thread ammo_dialog_timer();
level waittill("send_dialog_reminder");
level.player_ammo_low = 0;
}

}
else if (players[i] GetAmmoCount( weap ) == 0)
{
if(!isDefined(weap) || weap == "none")
{
continue;
}
level.player_ammo_out = 1;
players[i] thread add_no_ammo_dialog( weap );
//put in this wait to keep the game from spamming about being low on ammo.
wait(20);
level.player_ammo_out = 0;
}
else
{
continue;
}
}
wait(.5);
}
}
ammo_dialog_timer()
{
level endon ("ammo_out");
while(1)
{
wait(20);
level notify ("send_dialog_reminder");

}

}
add_low_ammo_dialog()
{
index = maps\_zombiemode_weapons::get_player_index(self);
player_index = "plr_" + index + "_";
if(!IsDefined (self.vox_ammo_low))
{
num_variants = maps\_zombiemode_spawner::get_number_variants(player_index + "vox_ammo_low");
self.vox_ammo_low = [];
for(i=0;i<num_variants;i++)
{
self.vox_ammo_low[self.vox_ammo_low.size] = "vox_ammo_low_" + i;
}
self.vox_ammo_low_available = self.vox_ammo_low;
}
sound_to_play = random(self.vox_ammo_low_available);

self.vox_ammo_low_available = array_remove(self.vox_ammo_low_available,sound_to_play);

if (self.vox_ammo_low_available.size < 1 )
{
self.vox_ammo_low_available = self.vox_ammo_low;
}

self maps\_zombiemode_spawner::do_player_playdialog(player_index, sound_to_play, 0.25);



}
add_no_ammo_dialog( weap )
{
self endon( "disconnect" );

// Let's pause here a couple of seconds to see if we're really out of ammo.
// If you take a weapon, there's a second or two where your current weapon
// will be set to no ammo while you switch to the new one.
wait(2);

curr_weap = self getcurrentweapon();
if ( !IsDefined(curr_weap) || curr_weap != weap || self GetAmmoCount( curr_weap ) != 0 )
{
// False alarm
return;
}


index = maps\_zombiemode_weapons::get_player_index(self);
player_index = "plr_" + index + "_";
if(!IsDefined (self.vox_ammo_out))
{
num_variants = maps\_zombiemode_spawner::get_number_variants(player_index + "vox_ammo_out");
self.vox_ammo_out = [];
for(i=0;i<num_variants;i++)
{
self.vox_ammo_out[self.vox_ammo_out.size] = "vox_ammo_out_" + i;
}
self.vox_ammo_out_available = self.vox_ammo_out;
}
sound_to_play = random(self.vox_ammo_out_available);

self.vox_ammo_out_available = array_remove(self.vox_ammo_out_available,sound_to_play);

if (self.vox_ammo_out_available.size < 1 )
{
self.vox_ammo_out_available = self.vox_ammo_out;
}

self maps\_zombiemode_spawner::do_player_playdialog(player_index, sound_to_play, 0.25);



}
/*------------------------------------
audio plays when more than 1 player connects
------------------------------------*/
spawn_vo()
{
//not sure if we need this
wait(1);

players = get_players();

//just pick a random player for now and play some vo
if(players.size > 1)
{
player = random(players);
index = maps\_zombiemode_weapons::get_player_index(player);
player thread spawn_vo_player(index,players.size);
}

}

spawn_vo_player(index,num)
{
sound = "plr_" + index + "_vox_" + num +"play";
self playsound(sound, "sound_done");
self waittill("sound_done");
}

testing_spawner_bug()
{
wait( 0.1 );
level.round_number = 7;

spawners = [];
spawners[0] = GetEnt( "testy", "targetname" );
while( 1 )
{
wait( 1 );
level.enemy_spawns = spawners;
}
}

precache_shaders()
{
PrecacheShader( "hud_chalk_1" );
PrecacheShader( "hud_chalk_2" );
PrecacheShader( "hud_chalk_3" );
PrecacheShader( "hud_chalk_4" );
PrecacheShader( "hud_chalk_5" );
}

precache_models()
{
precachemodel( "char_ger_honorgd_zomb_behead" );
precachemodel( "char_ger_zombieeye" );
PrecacheModel( "tag_origin" );
}

init_shellshocks()
{
level.player_killed_shellshock = "zombie_death";
PrecacheShellshock( level.player_killed_shellshock );
}

init_strings()
{
PrecacheString( &"ZOMBIE_WEAPONCOSTAMMO" );
PrecacheString( &"ZOMBIE_ROUND" );
PrecacheString( &"SCRIPT_PLUS" );
PrecacheString( &"ZOMBIE_GAME_OVER" );
PrecacheString( &"ZOMBIE_SURVIVED_ROUND" );
PrecacheString( &"ZOMBIE_SURVIVED_ROUNDS" );

add_zombie_hint( "undefined", &"ZOMBIE_UNDEFINED" );

// Random Treasure Chest
add_zombie_hint( "default_treasure_chest_950", &"ZOMBIE_RANDOM_WEAPON_950" );

// Barrier Pieces
add_zombie_hint( "default_buy_barrier_piece_10", &"ZOMBIE_BUTTON_BUY_BACK_BARRIER_10" );
add_zombie_hint( "default_buy_barrier_piece_20", &"ZOMBIE_BUTTON_BUY_BACK_BARRIER_20" );
add_zombie_hint( "default_buy_barrier_piece_50", &"ZOMBIE_BUTTON_BUY_BACK_BARRIER_50" );
add_zombie_hint( "default_buy_barrier_piece_100", &"ZOMBIE_BUTTON_BUY_BACK_BARRIER_100" );

// REWARD Barrier Pieces
add_zombie_hint( "default_reward_barrier_piece", &"ZOMBIE_BUTTON_REWARD_BARRIER" );
add_zombie_hint( "default_reward_barrier_piece_10", &"ZOMBIE_BUTTON_REWARD_BARRIER_10" );
add_zombie_hint( "default_reward_barrier_piece_20", &"ZOMBIE_BUTTON_REWARD_BARRIER_20" );
add_zombie_hint( "default_reward_barrier_piece_30", &"ZOMBIE_BUTTON_REWARD_BARRIER_30" );
add_zombie_hint( "default_reward_barrier_piece_40", &"ZOMBIE_BUTTON_REWARD_BARRIER_40" );
add_zombie_hint( "default_reward_barrier_piece_50", &"ZOMBIE_BUTTON_REWARD_BARRIER_50" );

// Debris
add_zombie_hint( "default_buy_debris_100", &"ZOMBIE_BUTTON_BUY_CLEAR_DEBRIS_100" );
add_zombie_hint( "default_buy_debris_200", &"ZOMBIE_BUTTON_BUY_CLEAR_DEBRIS_200" );
add_zombie_hint( "default_buy_debris_250", &"ZOMBIE_BUTTON_BUY_CLEAR_DEBRIS_250" );
add_zombie_hint( "default_buy_debris_500", &"ZOMBIE_BUTTON_BUY_CLEAR_DEBRIS_500" );
add_zombie_hint( "default_buy_debris_750", &"ZOMBIE_BUTTON_BUY_CLEAR_DEBRIS_750" );
add_zombie_hint( "default_buy_debris_1000", &"ZOMBIE_BUTTON_BUY_CLEAR_DEBRIS_1000" );
add_zombie_hint( "default_buy_debris_1250", &"ZOMBIE_BUTTON_BUY_CLEAR_DEBRIS_1250" );
add_zombie_hint( "default_buy_debris_1500", &"ZOMBIE_BUTTON_BUY_CLEAR_DEBRIS_1500" );
add_zombie_hint( "default_buy_debris_1750", &"ZOMBIE_BUTTON_BUY_CLEAR_DEBRIS_1750" );
add_zombie_hint( "default_buy_debris_2000", &"ZOMBIE_BUTTON_BUY_CLEAR_DEBRIS_2000" );

// Doors
add_zombie_hint( "default_buy_door_100", &"ZOMBIE_BUTTON_BUY_OPEN_DOOR_100" );
add_zombie_hint( "default_buy_door_200", &"ZOMBIE_BUTTON_BUY_OPEN_DOOR_200" );
add_zombie_hint( "default_buy_door_250", &"ZOMBIE_BUTTON_BUY_OPEN_DOOR_250" );
add_zombie_hint( "default_buy_door_500", &"ZOMBIE_BUTTON_BUY_OPEN_DOOR_500" );
add_zombie_hint( "default_buy_door_750", &"ZOMBIE_BUTTON_BUY_OPEN_DOOR_750" );
add_zombie_hint( "default_buy_door_1000", &"ZOMBIE_BUTTON_BUY_OPEN_DOOR_1000" );
add_zombie_hint( "default_buy_door_1250", &"ZOMBIE_BUTTON_BUY_OPEN_DOOR_1250" );
add_zombie_hint( "default_buy_door_1500", &"ZOMBIE_BUTTON_BUY_OPEN_DOOR_1500" );
add_zombie_hint( "default_buy_door_1750", &"ZOMBIE_BUTTON_BUY_OPEN_DOOR_1750" );
add_zombie_hint( "default_buy_door_2000", &"ZOMBIE_BUTTON_BUY_OPEN_DOOR_2000" );

// Areas
add_zombie_hint( "default_buy_area_100", &"ZOMBIE_BUTTON_BUY_OPEN_AREA_100" );
add_zombie_hint( "default_buy_area_200", &"ZOMBIE_BUTTON_BUY_OPEN_AREA_200" );
add_zombie_hint( "default_buy_area_250", &"ZOMBIE_BUTTON_BUY_OPEN_AREA_250" );
add_zombie_hint( "default_buy_area_500", &"ZOMBIE_BUTTON_BUY_OPEN_AREA_500" );
add_zombie_hint( "default_buy_area_750", &"ZOMBIE_BUTTON_BUY_OPEN_AREA_750" );
add_zombie_hint( "default_buy_area_1000", &"ZOMBIE_BUTTON_BUY_OPEN_AREA_1000" );
add_zombie_hint( "default_buy_area_1250", &"ZOMBIE_BUTTON_BUY_OPEN_AREA_1250" );
add_zombie_hint( "default_buy_area_1500", &"ZOMBIE_BUTTON_BUY_OPEN_AREA_1500" );
add_zombie_hint( "default_buy_area_1750", &"ZOMBIE_BUTTON_BUY_OPEN_AREA_1750" );
add_zombie_hint( "default_buy_area_2000", &"ZOMBIE_BUTTON_BUY_OPEN_AREA_2000" );

// JBird's extra Blockers
add_zombie_hint( "default_buy_gun_locker_500", &"ZOMBIE_BUTTON_BUY_OPEN_GUN_LOCKER_500" );
add_zombie_hint( "default_activate_swtich", &"ZOMBIE_BUTTON_ACTIVE_SWTICH" );
}

init_sounds()
{
add_sound( "end_of_round", "round_over" );
add_sound( "end_of_game", "mx_game_over" ); //Had to remove this and add a music state switch so that we can add other musical elements.
add_sound( "chalk_one_up", "chalk" );
add_sound( "purchase", "cha_ching" );
add_sound( "no_purchase", "no_cha_ching" );

// Zombification
// TODO need to vary these up
add_sound( "playerzombie_usebutton_sound", "attack_vocals" );
add_sound( "playerzombie_attackbutton_sound", "attack_vocals" );
add_sound( "playerzombie_adsbutton_sound", "attack_vocals" );

// Head gib
add_sound( "zombie_head_gib", "zombie_head_gib" );

// Blockers
add_sound( "rebuild_barrier_piece", "repair_boards" );
add_sound( "rebuild_barrier_hover", "boards_float" );
add_sound( "debris_hover_loop", "couch_loop" );
add_sound( "break_barrier_piece", "break_boards" );
add_sound("blocker_end_move", "board_slam");
add_sound( "barrier_rebuild_slam", "board_slam" );

// Doors
add_sound( "door_slide_open", "door_slide_open" );
add_sound( "door_rotate_open", "door_slide_open" );

// Debris
add_sound( "debris_move", "weap_wall" );

// Random Weapon Chest
add_sound( "open_chest", "lid_open" );
add_sound( "music_chest", "music_box" );
add_sound( "close_chest", "lid_close" );

// Weapons on walls
add_sound( "weapon_show", "weap_wall" );

}

init_levelvars()
{
level.intermission = false;
level.dog_intermission = false;
level.zombie_total = 0;
level.no_laststandmissionfail = true;

level.zombie_vars = [];

// Default to not zombify the player till further support
set_zombie_var( "zombify_player", false );

set_zombie_var( "below_world_check", -1000 );

// Respawn in the spectators in between rounds
set_zombie_var( "spectators_respawn", true );

// Round
set_zombie_var( "zombie_use_failsafe", true );
set_zombie_var( "zombie_round_time", 30 );
set_zombie_var( "zombie_between_round_time", 10 );
set_zombie_var( "zombie_intermission_time", 15 );

// Spawning
set_zombie_var( "zombie_spawn_delay", 2 );



// AI
set_zombie_var( "zombie_health_increase", 100 );
set_zombie_var( "zombie_health_increase_percent", 10, 100 );
set_zombie_var( "zombie_health_start", 150 );
set_zombie_var( "zombie_max_ai", 24 );
set_zombie_var( "zombie_ai_per_player", 6 );

// Scoring
set_zombie_var( "zombie_score_start", 500000 );
/#
if( GetDvarInt( "zombie_cheat" ) >= 1 )
{
set_zombie_var( "zombie_score_start", 100 );
}
#/
set_zombie_var( "zombie_score_kill", 50 );
set_zombie_var( "zombie_score_damage", 5 );
set_zombie_var( "zombie_score_bonus_melee", 80 );
set_zombie_var( "zombie_score_bonus_head", 50 );
set_zombie_var( "zombie_score_bonus_neck", 20 );
set_zombie_var( "zombie_score_bonus_torso", 10 );
set_zombie_var( "zombie_score_bonus_burn", 10 );

set_zombie_var( "penalty_no_revive_percent", 10, 100 );
set_zombie_var( "penalty_died_percent", 0, 100 );
set_zombie_var( "penalty_downed_percent", 5, 100 );

set_zombie_var( "zombie_flame_dmg_point_delay", 500 );

if ( IsSplitScreen() )
{
set_zombie_var( "zombie_timer_offset", 280 ); // hud offsets
}
}

init_dvars()
{
level.zombiemode = true;

//coder mod: tkeegan - new code dvar
setSavedDvar( "zombiemode", "1" );
SetDvar( "ui_gametype", "zom" );
setSavedDvar( "fire_world_damage", "0" );
setSavedDvar( "fire_world_damage_rate", "0" );
setSavedDvar( "fire_world_damage_duration", "0" );

if( GetDvar( "zombie_debug" ) == "" )
{
SetDvar( "zombie_debug", "0" );
}

if( GetDvar( "zombie_cheat" ) == "" )
{
SetDvar( "zombie_cheat", "0" );
}

if(getdvar("magic_chest_movable") == "")
{
SetDvar( "magic_chest_movable", "1" );
}

if(getdvar("magic_box_explore_only") == "")
{
SetDvar( "magic_box_explore_only", "1" );
}

SetDvar( "revive_trigger_radius", "60" );
}

initZombieLeaderboardData()
{
// Initializing Leaderboard Stat Variables
level.zombieLeaderboardStatVariable["nazi_zombie_prototype"]["highestwave"] = "nz_prototype_highestwave";
level.zombieLeaderboardStatVariable["nazi_zombie_prototype"]["timeinwave"] = "nz_prototype_timeinwave";
level.zombieLeaderboardStatVariable["nazi_zombie_prototype"]["totalpoints"] = "nz_prototype_totalpoints";

level.zombieLeaderboardStatVariable["nazi_zombie_asylum"]["highestwave"] = "nz_asylum_highestwave";
level.zombieLeaderboardStatVariable["nazi_zombie_asylum"]["timeinwave"] = "nz_asylum_timeinwave";
level.zombieLeaderboardStatVariable["nazi_zombie_asylum"]["totalpoints"] = "nz_asylum_totalpoints";

level.zombieLeaderboardStatVariable["nazi_zombie_sumpf"]["highestwave"] = "nz_sumpf_highestwave";
level.zombieLeaderboardStatVariable["nazi_zombie_sumpf"]["timeinwave"] = "nz_sumpf_timeinwave";
level.zombieLeaderboardStatVariable["nazi_zombie_sumpf"]["totalpoints"] = "nz_sumpf_totalpoints";

level.zombieLeaderboardStatVariable["nazi_zombie_factory"]["highestwave"] = "nz_factory_highestwave";
level.zombieLeaderboardStatVariable["nazi_zombie_factory"]["timeinwave"] = "nz_factory_timeinwave";
level.zombieLeaderboardStatVariable["nazi_zombie_factory"]["totalpoints"] = "nz_factory_totalpoints";

// Initializing Leaderboard Number
level.zombieLeaderboardNumber["nazi_zombie_prototype"]["waves"] = 13;
level.zombieLeaderboardNumber["nazi_zombie_prototype"]["points"] = 14;

level.zombieLeaderboardNumber["nazi_zombie_asylum"]["waves"] = 15;
level.zombieLeaderboardNumber["nazi_zombie_asylum"]["points"] = 16;

level.zombieLeaderboardNumber["nazi_zombie_sumpf"]["waves"] = 17;
level.zombieLeaderboardNumber["nazi_zombie_sumpf"]["points"] = 18;

level.zombieLeaderboardNumber["nazi_zombie_factory"]["waves"] = 19;
level.zombieLeaderboardNumber["nazi_zombie_factory"]["points"] = 20;
}


init_flags()
{
flag_init("spawn_point_override");
flag_init("electricity_on");
flag_init("crawler_round");
}


init_fx()
{
level._effect["wood_chunk_destory"] = loadfx( "impacts/large_woodhit" );

level._effect["edge_fog"] = LoadFx( "env/smoke/fx_fog_zombie_amb" );
level._effect["chest_light"] = LoadFx( "env/light/fx_ray_sun_sm_short" );

level._effect["eye_glow"] = LoadFx( "misc/fx_zombie_eye_single" );

level._effect["zombie_grain"] = LoadFx( "misc/fx_zombie_grain_cloud" );

level._effect["headshot"] = LoadFX( "impacts/flesh_hit_head_fatal_lg_exit" );
level._effect["headshot_nochunks"] = LoadFX( "misc/fx_zombie_bloodsplat" );
level._effect["bloodspurt"] = LoadFX( "misc/fx_zombie_bloodspurt" );
level._effect["tesla_head_light"] = Loadfx( "maps/zombie/fx_zombie_tesla_neck_spurt");

level._effect["rise_burst_water"] = LoadFx("maps/zombie/fx_zombie_body_wtr_burst");
level._effect["rise_billow_water"] = LoadFx("maps/zombie/fx_zombie_body_wtr_billowing");
level._effect["rise_dust_water"] = LoadFx("maps/zombie/fx_zombie_body_wtr_falling");

level._effect["rise_burst"] = LoadFx("maps/mp_maps/fx_mp_zombie_hand_dirt_burst");
level._effect["rise_billow"] = LoadFx("maps/mp_maps/fx_mp_zombie_body_dirt_billowing");
level._effect["rise_dust"] = LoadFx("maps/mp_maps/fx_mp_zombie_body_dust_falling");

// Flamethrower
level._effect["character_fire_pain_sm"]              = loadfx( "env/fire/fx_fire_player_sm_1sec" );
level._effect["character_fire_death_sm"]              = loadfx( "env/fire/fx_fire_player_md" );
level._effect["character_fire_death_torso"] = loadfx( "env/fire/fx_fire_player_torso" );
}

// zombie specific anims

init_standard_zombie_anims()
{
// deaths
level.scr_anim["zombie"]["death1"] = %ai_zombie_death_v1;
level.scr_anim["zombie"]["death2"] = %ai_zombie_death_v2;
level.scr_anim["zombie"]["death3"] = %ai_zombie_crawl_death_v1;
level.scr_anim["zombie"]["death4"] = %ai_zombie_crawl_death_v2;

// run cycles

level.scr_anim["zombie"]["walk1"] = %ai_zombie_walk_v1;
level.scr_anim["zombie"]["walk2"] = %ai_zombie_walk_v2;
level.scr_anim["zombie"]["walk3"] = %ai_zombie_walk_v3;
level.scr_anim["zombie"]["walk4"] = %ai_zombie_walk_v4;

level.scr_anim["zombie"]["run1"] = %ai_zombie_walk_fast_v1;
level.scr_anim["zombie"]["run2"] = %ai_zombie_walk_fast_v2;
level.scr_anim["zombie"]["run3"] = %ai_zombie_walk_fast_v3;
level.scr_anim["zombie"]["run4"] = %ai_zombie_run_v2;
level.scr_anim["zombie"]["run5"] = %ai_zombie_run_v4;
level.scr_anim["zombie"]["run6"] = %ai_zombie_run_v3;
//level.scr_anim["zombie"]["run4"] = %ai_zombie_run_v1;
//level.scr_anim["zombie"]["run6"] = %ai_zombie_run_v4;

level.scr_anim["zombie"]["sprint1"] = %ai_zombie_sprint_v1;
level.scr_anim["zombie"]["sprint2"] = %ai_zombie_sprint_v2;
level.scr_anim["zombie"]["sprint3"] = %ai_zombie_sprint_v1;
level.scr_anim["zombie"]["sprint4"] = %ai_zombie_sprint_v2;
//level.scr_anim["zombie"]["sprint3"] = %ai_zombie_sprint_v3;
//level.scr_anim["zombie"]["sprint3"] = %ai_zombie_sprint_v4;
//level.scr_anim["zombie"]["sprint4"] = %ai_zombie_sprint_v5;

// run cycles in prone
level.scr_anim["zombie"]["crawl1"] = %ai_zombie_crawl;
level.scr_anim["zombie"]["crawl2"] = %ai_zombie_crawl_v1;
level.scr_anim["zombie"]["crawl3"] = %ai_zombie_crawl_v2;
level.scr_anim["zombie"]["crawl4"] = %ai_zombie_crawl_v3;
level.scr_anim["zombie"]["crawl5"] = %ai_zombie_crawl_v4;
level.scr_anim["zombie"]["crawl6"] = %ai_zombie_crawl_v5;
level.scr_anim["zombie"]["crawl_hand_1"] = %ai_zombie_walk_on_hands_a;
level.scr_anim["zombie"]["crawl_hand_2"] = %ai_zombie_walk_on_hands_b;




level.scr_anim["zombie"]["crawl_sprint1"] = %ai_zombie_crawl_sprint;
level.scr_anim["zombie"]["crawl_sprint2"] = %ai_zombie_crawl_sprint_1;
level.scr_anim["zombie"]["crawl_sprint3"] = %ai_zombie_crawl_sprint_2;

if( !isDefined( level._zombie_melee ) )
{
level._zombie_melee = [];
}
if( !isDefined( level._zombie_walk_melee ) )
{
level._zombie_walk_melee = [];
}
if( !isDefined( level._zombie_run_melee ) )
{
level._zombie_run_melee = [];
}

level._zombie_melee["zombie"] = [];
level._zombie_walk_melee["zombie"] = [];
level._zombie_run_melee["zombie"] = [];

level._zombie_melee["zombie"][0] = %ai_zombie_attack_forward_v1;
level._zombie_melee["zombie"][1] = %ai_zombie_attack_forward_v2;
level._zombie_melee["zombie"][2] = %ai_zombie_attack_v1;
level._zombie_melee["zombie"][3] = %ai_zombie_attack_v2;
level._zombie_melee["zombie"][4] = %ai_zombie_attack_v1;
level._zombie_melee["zombie"][5] = %ai_zombie_attack_v4;
level._zombie_melee["zombie"][6] = %ai_zombie_attack_v6;
level._zombie_run_melee["zombie"][0] = %ai_zombie_run_attack_v1;
level._zombie_run_melee["zombie"][1] = %ai_zombie_run_attack_v2;
level._zombie_run_melee["zombie"][2] = %ai_zombie_run_attack_v3;
level.scr_anim["zombie"]["walk5"] = %ai_zombie_walk_v6;
level.scr_anim["zombie"]["walk6"] = %ai_zombie_walk_v7;
level.scr_anim["zombie"]["walk7"] = %ai_zombie_walk_v8;
level.scr_anim["zombie"]["walk8"] = %ai_zombie_walk_v9;

if( isDefined( level.zombie_anim_override ) )
{
[[ level.zombie_anim_override ]]();
}

level._zombie_walk_melee["zombie"][0] = %ai_zombie_walk_attack_v1;
level._zombie_walk_melee["zombie"][1] = %ai_zombie_walk_attack_v2;
level._zombie_walk_melee["zombie"][2] = %ai_zombie_walk_attack_v3;
level._zombie_walk_melee["zombie"][3] = %ai_zombie_walk_attack_v4;

// melee in crawl
if( !isDefined( level._zombie_melee_crawl ) )
{
level._zombie_melee_crawl = [];
}
level._zombie_melee_crawl["zombie"] = [];
level._zombie_melee_crawl["zombie"][0] = %ai_zombie_attack_crawl;
level._zombie_melee_crawl["zombie"][1] = %ai_zombie_attack_crawl_lunge;

if( !isDefined( level._zombie_stumpy_melee ) )
{
level._zombie_stumpy_melee = [];
}
level._zombie_stumpy_melee["zombie"] = [];
level._zombie_stumpy_melee["zombie"][0] = %ai_zombie_walk_on_hands_shot_a;
level._zombie_stumpy_melee["zombie"][1] = %ai_zombie_walk_on_hands_shot_b;
//level._zombie_melee_crawl["zombie"][2] = %ai_zombie_crawl_attack_A;

// tesla deaths
if( !isDefined( level._zombie_tesla_death ) )
{
level._zombie_tesla_death = [];
}
level._zombie_tesla_death["zombie"] = [];
level._zombie_tesla_death["zombie"][0] = %ai_zombie_tesla_death_a;
level._zombie_tesla_death["zombie"][1] = %ai_zombie_tesla_death_b;
level._zombie_tesla_death["zombie"][2] = %ai_zombie_tesla_death_c;
level._zombie_tesla_death["zombie"][3] = %ai_zombie_tesla_death_d;
level._zombie_tesla_death["zombie"][4] = %ai_zombie_tesla_death_e;

if( !isDefined( level._zombie_tesla_crawl_death ) )
{
level._zombie_tesla_crawl_death = [];
}
level._zombie_tesla_crawl_death["zombie"] = [];
level._zombie_tesla_crawl_death["zombie"][0] = %ai_zombie_tesla_crawl_death_a;
level._zombie_tesla_crawl_death["zombie"][1] = %ai_zombie_tesla_crawl_death_b;

// deaths
if( !isDefined( level._zombie_deaths ) )
{
level._zombie_deaths = [];
}
level._zombie_deaths["zombie"] = [];
level._zombie_deaths["zombie"][0] = %ch_dazed_a_death;
level._zombie_deaths["zombie"][1] = %ch_dazed_b_death;
level._zombie_deaths["zombie"][2] = %ch_dazed_c_death;
level._zombie_deaths["zombie"][3] = %ch_dazed_d_death;

/*
ground crawl
*/

if( !isDefined( level._zombie_rise_anims ) )
{
level._zombie_rise_anims = [];
}

// set up the arrays
level._zombie_rise_anims["zombie"] = [];

//level._zombie_rise_anims["zombie"][1]["walk"][0] = %ai_zombie_traverse_ground_v1_crawl;
level._zombie_rise_anims["zombie"][1]["walk"][0] = %ai_zombie_traverse_ground_v1_walk;

//level._zombie_rise_anims["zombie"][1]["run"][0] = %ai_zombie_traverse_ground_v1_crawlfast;
level._zombie_rise_anims["zombie"][1]["run"][0] = %ai_zombie_traverse_ground_v1_run;

level._zombie_rise_anims["zombie"][1]["sprint"][0] = %ai_zombie_traverse_ground_climbout_fast;

//level._zombie_rise_anims["zombie"][2]["walk"][0] = %ai_zombie_traverse_ground_v2_walk; //!broken
level._zombie_rise_anims["zombie"][2]["walk"][0] = %ai_zombie_traverse_ground_v2_walk_altA;
//level._zombie_rise_anims["zombie"][2]["walk"][2] = %ai_zombie_traverse_ground_v2_walk_altB;//!broken

// ground crawl death
if( !isDefined( level._zombie_rise_death_anims ) )
{
level._zombie_rise_death_anims = [];
}

level._zombie_rise_death_anims["zombie"] = [];

level._zombie_rise_death_anims["zombie"][1]["in"][0] = %ai_zombie_traverse_ground_v1_deathinside;
level._zombie_rise_death_anims["zombie"][1]["in"][1] = %ai_zombie_traverse_ground_v1_deathinside_alt;

level._zombie_rise_death_anims["zombie"][1]["out"][0] = %ai_zombie_traverse_ground_v1_deathoutside;
level._zombie_rise_death_anims["zombie"][1]["out"][1] = %ai_zombie_traverse_ground_v1_deathoutside_alt;

level._zombie_rise_death_anims["zombie"][2]["in"][0] = %ai_zombie_traverse_ground_v2_death_low;
level._zombie_rise_death_anims["zombie"][2]["in"][1] = %ai_zombie_traverse_ground_v2_death_low_alt;

level._zombie_rise_death_anims["zombie"][2]["out"][0] = %ai_zombie_traverse_ground_v2_death_high;
level._zombie_rise_death_anims["zombie"][2]["out"][1] = %ai_zombie_traverse_ground_v2_death_high_alt;

//taunts
if( !isDefined( level._zombie_run_taunt ) )
{
level._zombie_run_taunt = [];
}
if( !isDefined( level._zombie_board_taunt ) )
{
level._zombie_board_taunt = [];
}
level._zombie_run_taunt["zombie"] = [];
level._zombie_board_taunt["zombie"] = [];

//level._zombie_taunt["zombie"][0] = %ai_zombie_taunts_1;
//level._zombie_taunt["zombie"][1] = %ai_zombie_taunts_4;
//level._zombie_taunt["zombie"][2] = %ai_zombie_taunts_5b;
//level._zombie_taunt["zombie"][3] = %ai_zombie_taunts_5c;
//level._zombie_taunt["zombie"][4] = %ai_zombie_taunts_5d;
//level._zombie_taunt["zombie"][5] = %ai_zombie_taunts_5e;
//level._zombie_taunt["zombie"][6] = %ai_zombie_taunts_5f;
//level._zombie_taunt["zombie"][7] = %ai_zombie_taunts_7;
//level._zombie_taunt["zombie"][8] = %ai_zombie_taunts_9;
//level._zombie_taunt["zombie"][8] = %ai_zombie_taunts_11;
//level._zombie_taunt["zombie"][8] = %ai_zombie_taunts_12;

level._zombie_board_taunt["zombie"][0] = %ai_zombie_taunts_4;
level._zombie_board_taunt["zombie"][1] = %ai_zombie_taunts_7;
level._zombie_board_taunt["zombie"][2] = %ai_zombie_taunts_9;
level._zombie_board_taunt["zombie"][3] = %ai_zombie_taunts_5b;
level._zombie_board_taunt["zombie"][4] = %ai_zombie_taunts_5c;
level._zombie_board_taunt["zombie"][5] = %ai_zombie_taunts_5d;
level._zombie_board_taunt["zombie"][6] = %ai_zombie_taunts_5e;
level._zombie_board_taunt["zombie"][7] = %ai_zombie_taunts_5f;
}

init_anims()
{
init_standard_zombie_anims();
}

// Initialize any animscript related variables
init_animscripts()
{
// Setup the animscripts, then override them (we call this just incase an AI has not yet spawned)
animscripts\init::firstInit();

anim.idleAnimArray ["stand"] = [];
anim.idleAnimWeights ["stand"] = [];
anim.idleAnimArray ["stand"][0][0] = %ai_zombie_idle_v1_delta;
anim.idleAnimWeights ["stand"][0][0] = 10;

anim.idleAnimArray ["crouch"] = [];
anim.idleAnimWeights ["crouch"] = [];
anim.idleAnimArray ["crouch"][0][0] = %ai_zombie_idle_crawl_delta;
anim.idleAnimWeights ["crouch"][0][0] = 10;
}

// Handles the intro screen
zombie_intro_screen( string1, string2, string3, string4, string5 )
{
flag_wait( "all_players_connected" );

wait( 1 );

//TUEY Set music state to Splash Screencompass
setmusicstate( "SPLASH_SCREEN" );
wait (0.2);
//TUEY Set music state to WAVE_1
// setmusicstate("WAVE_1");
}

players_playing()
{
// initialize level.players_playing
players = get_players();
level.players_playing = players.size;

wait( 20 );

players = get_players();
level.players_playing = players.size;
}

//
// NETWORK SECTION ====================================================================== //
//

watchGrenadeThrow()
{
self endon( "disconnect" );
self endon( "death" );

while(1)
{
self waittill("grenade_fire", grenade);

if(isdefined(grenade))
{
if(self maps\_laststand::player_is_in_laststand())
{
grenade delete();
}
}
}
}

onPlayerConnect()
{
for( ;; )
{
level waittill( "connecting", player );

player.entity_num = player GetEntityNumber();
player thread onPlayerSpawned();
player thread onPlayerDisconnect();
player thread player_revive_monitor();

//player thread watchGrenadeThrow();

player.score = level.zombie_vars["zombie_score_start"];
player.score_total = player.score;
player.old_score = player.score;

player.is_zombie = false;
player.initialized = false;
player.zombification_time = 0;
}
}

onPlayerConnect_clientDvars()
{
self SetClientDvars( "cg_deadChatWithDead", "1",
"cg_deadChatWithTeam", "1",
"cg_deadHearTeamLiving", "1",
"cg_deadHearAllLiving", "1",
"cg_everyoneHearsEveryone", "1",
"compass", "0",
"hud_showStance", "0",
"cg_thirdPerson", "0",
"cg_fov", "65",
"cg_thirdPersonAngle", "0",
"ammoCounterHide", "0",
"miniscoreboardhide", "0",
"ui_hud_hardcore", "0" );

self SetDepthOfField( 0, 0, 512, 4000, 4, 0 );
}

onPlayerDisconnect()
{
self waittill( "disconnect" );
self remove_from_spectate_list();
}

onPlayerSpawned()
{
self endon( "disconnect" );

for( ;; )
{
self waittill( "spawned_player" );



self SetClientDvars( "cg_thirdPerson", "0",
"cg_fov", "65",
"cg_thirdPersonAngle", "0" );

self SetDepthOfField( 0, 0, 512, 4000, 4, 0 );

self add_to_spectate_list();

if( isdefined( self.initialized ) )
{
if( self.initialized == false )
{
self.initialized = true;
// self maps\_zombiemode_score::create_player_score_hud();

// set the initial score on the hud
self maps\_zombiemode_score::set_player_score_hud( true );
self thread player_zombie_breadcrumb();

//Init stat tracking variables
self.stats["kills"] = 0;
self.stats["score"] = 0;
self.stats["downs"] = 0;
self.stats["revives"] = 0;
self.stats["perks"] = 0;
self.stats["headshots"] = 0;
self.stats["zombie_gibs"] = 0;
}
}
}
}


//
// Keep track of players going down and getting revived
player_revive_monitor()
{
self endon( "disconnect" );

while (1)
{
self waittill( "player_revived", reviver );

if ( IsDefined(reviver) )
{
// Check to see how much money you lost from being down.
points = self.score_lost_when_downed;
if ( points > 300 )
{
points = 300;
}
reviver maps\_zombiemode_score::add_to_player_score( points );
self.score_lost_when_downed = 0;
}
}
}


player_laststand()
{
self maps\_zombiemode_score::player_downed_penalty();

if( IsDefined( self.intermission ) && self.intermission )
{
maps\_challenges_coop::doMissionCallback( "playerDied", self );

level waittill( "forever" );
}
}

spawnSpectator()
{
self endon( "disconnect" );
self endon( "spawned_spectator" );
self notify( "spawned" );
self notify( "end_respawn" );

if( level.intermission )
{
return;
}

if( IsDefined( level.no_spectator ) && level.no_spectator )
{
wait( 3 );
ExitLevel();
}

// The check_for_level_end looks for this
self.is_zombie = true;

// Remove all reviving abilities
self notify ( "zombified" );

if( IsDefined( self.revivetrigger ) )
{
self.revivetrigger delete();
self.revivetrigger = undefined;
}

self.zombification_time = getTime(); //set time when player died

resetTimeout();

// Stop shellshock and rumble
self StopShellshock();
self StopRumble( "damage_heavy" );

self.sessionstate = "spectator";
self.spectatorclient = -1;

self remove_from_spectate_list();

self.maxhealth = self.health;
self.shellshocked = false;
self.inWater = false;
self.friendlydamage = undefined;
self.hasSpawned = true;
self.spawnTime = getTime();
self.afk = false;

println( "*************************Zombie Spectator***" );
self detachAll();

self setSpectatePermissions( true );
self thread spectator_thread();

self Spawn( self.origin, self.angles );
self notify( "spawned_spectator" );
}

setSpectatePermissions( isOn )
{
self AllowSpectateTeam( "allies", isOn );
self AllowSpectateTeam( "axis", false );
self AllowSpectateTeam( "freelook", false );
self AllowSpectateTeam( "none", false );
}

spectator_thread()
{
self endon( "disconnect" );
self endon( "spawned_player" );

if( IsSplitScreen() )
{
last_alive = undefined;
players = get_players();

for( i = 0; i < players.size; i++ )
{
if( !players[i].is_zombie )
{
last_alive = players[i];
}
}

share_screen( last_alive, true );

return;
}

self thread spectator_toggle_3rd_person();
}

spectator_toggle_3rd_person()
{
self endon( "disconnect" );
self endon( "spawned_player" );

third_person = true;
self set_third_person( true );
// self NotifyOnCommand( "toggle_3rd_person", "weapnext" );

// while( 1 )
// {
// self waittill( "toggle_3rd_person" );
//
// if( third_person )
// {
// third_person = false;
// self set_third_person( false );
// wait( 0.5 );
// }
// else
// {
// third_person = true;
// self set_third_person( true );
// wait( 0.5 );
// }
// }
}


set_third_person( value )
{
if( value )
{
self SetClientDvars( "cg_thirdPerson", "1",
"cg_fov", "40",
"cg_thirdPersonAngle", "354" );

self setDepthOfField( 0, 128, 512, 4000, 6, 1.8 );
}
else
{
self SetClientDvars( "cg_thirdPerson", "0",
"cg_fov", "65",
"cg_thirdPersonAngle", "0" );

self setDepthOfField( 0, 0, 512, 4000, 4, 0 );
}
}

spectators_respawn()
{
level endon( "between_round_over" );

if( !IsDefined( level.zombie_vars["spectators_respawn"] ) || !level.zombie_vars["spectators_respawn"] )
{
return;
}

if( !IsDefined( level.custom_spawnPlayer ) )
{
// Custom spawn call for when they respawn from spectator
level.custom_spawnPlayer = ::spectator_respawn;
}

while( 1 )
{
players = get_players();
for( i = 0; i < players.size; i++ )
{
if( players[i].sessionstate == "spectator" )
{
players[i] [[level.spawnPlayer]]();
if( isDefined( players[i].has_altmelee ) && players[i].has_altmelee )
{
players[i] SetPerk( "specialty_altmelee" );
}
if (isDefined(level.script) && level.round_number > 6 && players[i].score < 1500)
{
players[i].old_score = players[i].score;
players[i].score = 1500;
players[i] maps\_zombiemode_score::set_player_score_hud();
}
}
}

wait( 1 );
}
}

spectator_respawn()
{
println( "*************************Respawn Spectator***" );
assert( IsDefined( self.spectator_respawn ) );

origin = self.spectator_respawn.origin;
angles = self.spectator_respawn.angles;

self setSpectatePermissions( false );

new_origin = undefined;


new_origin = check_for_valid_spawn_near_team( self );


if( IsDefined( new_origin ) )
{
self Spawn( new_origin, angles );
}
else
{
self Spawn( origin, angles );
}


if( IsSplitScreen() )
{
last_alive = undefined;
players = get_players();

for( i = 0; i < players.size; i++ )
{
if( !players[i].is_zombie )
{
last_alive = players[i];
}
}

share_screen( last_alive, false );
}

self.has_betties = undefined;
self.is_burning = undefined;

// The check_for_level_end looks for this
self.is_zombie = false;
self.ignoreme = false;

setClientSysState("lsm", "0", self); // Notify client last stand ended.
self RevivePlayer();

self notify( "spawned_player" );

// Penalize the player when we respawn, since he 'died'
self maps\_zombiemode_score::player_reduce_points( "died" );

self thread player_zombie_breadcrumb();

return true;
}

check_for_valid_spawn_near_team( revivee )
{

players = get_players();
spawn_points = getstructarray("player_respawn_point", "targetname");

if( spawn_points.size == 0 )
return undefined;

for( i = 0; i < players.size; i++ )
{
if( is_player_valid( players[i] ) )
{
for( j = 0 ; j < spawn_points.size; j++ )
{
if( DistanceSquared( players[i].origin, spawn_points[j].origin ) < ( 1000 * 1000 ) && spawn_points[j].locked == false )
{
spawn_array = getstructarray( spawn_points[j].target, "targetname" );

for( k = 0; k < spawn_array.size; k++ )
{
if( spawn_array[k].script_int == (revivee.entity_num + 1) )
{
return spawn_array[k].origin;
}
}

return spawn_array[0].origin;
}

}

}

}

return undefined;

}


get_players_on_team(exclude)
{

teammates = [];

players = get_players();
for(i=0;i<players.size;i++)
{
//check to see if other players on your team are alive and not waiting to be revived
if(players[i].spawn_side == self.spawn_side && !isDefined(players[i].revivetrigger) && players[i] != exclude )
{
teammates[teammates.size] = players[i];
}
}

return teammates;
}



get_safe_breadcrumb_pos( player )
{
players = get_players();
valid_players = [];

min_dist = 150 * 150;
for( i = 0; i < players.size; i++ )
{
if( !is_player_valid( players[i] ) )
{
continue;
}

valid_players[valid_players.size] = players[i];
}

for( i = 0; i < valid_players.size; i++ )
{
count = 0;
for( q = 1; q < player.zombie_breadcrumbs.size; q++ )
{
if( DistanceSquared( player.zombie_breadcrumbs[q], valid_players[i].origin ) < min_dist )
{
continue;
}

count++;
if( count == valid_players.size )
{
return player.zombie_breadcrumbs[q];
}
}
}

return undefined;
}

round_spawning()
{
level endon( "intermission" );
/#
level endon( "kill_round" );
#/

if( level.intermission )
{
return;
}

if( level.enemy_spawns.size < 1 )
{
ASSERTMSG( "No spawners with targetname zombie_spawner in map." );
return;
}

/#
if ( GetDVarInt( "zombie_cheat" ) == 2 || GetDVarInt( "zombie_cheat" ) >= 4 )
{
return;
}
#/

ai_calculate_health();

count = 0;

//CODER MOD: TOMMY K
players = get_players();
for( i = 0; i < players.size; i++ )
{
players[i].zombification_time = 0;
}

max = level.zombie_vars["zombie_max_ai"];

multiplier = level.round_number / 5;
if( multiplier < 1 )
{
multiplier = 1;
}

// After round 10, exponentially have more AI attack the player
if( level.round_number >= 10 )
{
multiplier *= level.round_number * 0.15;
}

player_num = get_players().size;

if( player_num == 1 )
{
max += int( ( 0.5 * level.zombie_vars["zombie_ai_per_player"] ) * multiplier );
}
else
{
max += int( ( ( player_num - 1 ) * level.zombie_vars["zombie_ai_per_player"] ) * multiplier );
}



if(level.round_number < 3 && level.script == "nazi_zombie_asylum")
{
if(get_players().size > 1)
{

max = get_players().size * 3 + level.round_number;

}
else
{

max = 6;

}
}
else if ( level.first_round )
{
max = int( max * 0.2 );
}
else if (level.round_number < 3)
{
max = int( max * 0.4 );
}
else if (level.round_number < 4)
{
max = int( max * 0.6 );
}
else if (level.round_number < 5)
{
max = int( max * 0.8 );
}


level.zombie_total = max;
mixed_spawns = 0; // Number of mixed spawns this round.  Currently means number of dogs in a mixed round

// DEBUG HACK:
//max = 1;
old_spawn = undefined;
while( count < max )
{

spawn_point = level.enemy_spawns[RandomInt( level.enemy_spawns.size )];

if( !IsDefined( old_spawn ) )
{
old_spawn = spawn_point;
}
else if( Spawn_point == old_spawn )
{
spawn_point = level.enemy_spawns[RandomInt( level.enemy_spawns.size )];
}
old_spawn = spawn_point;

// iPrintLn(spawn_point.targetname + " " + level.zombie_vars["zombie_spawn_delay"]);
while( get_enemy_count() > 31 )
{
wait( 0.05 );
}

// MM Mix in dog spawns...
if ( IsDefined( level.mixed_rounds_enabled ) && level.mixed_rounds_enabled == 1 )
{
spawn_dog = false;
if ( level.round_number > 30 )
{
if ( RandomInt(100) < 3 )
{
spawn_dog = false;
}
}
else if ( level.round_number > 25 && mixed_spawns < 3 )
{
if ( RandomInt(100) < 2 )
{
spawn_dog = false;
}
}
else if ( level.round_number > 20 && mixed_spawns < 2 )
{
if ( RandomInt(100) < 2 )
{
spawn_dog = false;
}
}
else if ( level.round_number > 15 && mixed_spawns < 1 )
{
if ( RandomInt(100) < 1 )
{
spawn_dog = false;
}
}

if ( spawn_dog )
{
keys = GetArrayKeys( level.zones );
for ( i=0; i<keys.size; i++ )
{
if ( level.zones[ keys[i] ].is_occupied )
{
akeys = GetArrayKeys( level.zones[ keys[i] ].adjacent_zones );
for ( k=0; k<akeys.size; k++ )
{
if ( level.zones[ akeys[k] ].is_active &&
!level.zones[ akeys[k] ].is_occupied &&
level.zones[ akeys[k] ].dog_locations.size > 0 )
{
maps\_zombiemode_dogs::special_dog_spawn( undefined, 1 );
level.zombie_total--;
wait_network_frame();
}
}
}
}
}
}

ai = spawn_zombie( spawn_point );
if( IsDefined( ai ) )
{
level.zombie_total--;
ai thread round_spawn_failsafe();
count++;
}
wait( level.zombie_vars["zombie_spawn_delay"] );
wait_network_frame();
}

if( level.round_number > 3 )
{
zombies = getaiarray( "axis" );
while( zombies.size > 0 )
{
if( zombies.size == 1 && zombies[0].has_legs == true )
{
var = randomintrange(1, 4);
zombies[0] set_run_anim( "sprint" + var );                       
zombies[0].run_combatanim = level.scr_anim[zombies[0].animname]["sprint" + var];
}
wait(0.5);
zombies = getaiarray("axis");
}

}

}

// TESTING: spawn one zombie at a time
round_spawning_test()
{
while (true)
{
spawn_point = level.enemy_spawns[RandomInt( level.enemy_spawns.size )]; // grab a random spawner

ai = spawn_zombie( spawn_point );
ai waittill("death");

wait 5;
}
}
/////////////////////////////////////////////////////////

round_text( text )
{
if( level.first_round )
{
intro = true;
}
else
{
intro = false;
}

hud = create_simple_hud();
hud.horzAlign = "center";
hud.vertAlign = "middle";
hud.alignX = "center";
hud.alignY = "middle";
hud.y = -100;
hud.foreground = 1;
hud.fontscale = 16.0;
hud.alpha = 0;
hud.color = ( 1, 1, 1 );

hud SetText( text );
hud FadeOverTime( 1.5 );
hud.alpha = 1;
wait( 1.5 );

if( intro )
{
wait( 1 );
level notify( "intro_change_color" );
}

hud FadeOverTime( 3 );
//hud.color = ( 0.8, 0, 0 );
hud.color = ( 0.423, 0.004, 0 );
wait( 3 );

if( intro )
{
level waittill( "intro_hud_done" );
}

hud FadeOverTime( 1.5 );
hud.alpha = 0;
wait( 1.5 );
hud destroy();
}

round_start()
{
level.zombie_health = level.zombie_vars["zombie_health_start"];
level.round_number = 1;
level.first_round = true;

// so players get init'ed with grenades
players = get_players();
for (i = 0; i < players.size; i++)
{
players[i] giveweapon( "mk2_frag" );
players[i] setweaponammoclip( "mk2_frag", 0);
}

level.chalk_hud1 = create_chalk_hud();
level.chalk_hud2 = create_chalk_hud( 64 );

// level waittill( "introscreen_done" );

level.round_spawn_func = ::round_spawning;

/#
if (GetDVarInt("zombie_rise_test"))
{
level.round_spawn_func = ::round_spawning_test; // FOR TESTING, one zombie at a time, no round advancement
}
#/

level thread round_think();
}


create_chalk_hud( x )
{
if( !IsDefined( x ) )
{
x = 0;
}

hud = create_simple_hud();
hud.alignX = "left";
hud.alignY = "bottom";
hud.horzAlign = "left";
hud.vertAlign = "bottom";
hud.color = ( 0.423, 0.004, 0 );
hud.x = x;
hud.alpha = 0;

hud SetShader( "hud_chalk_1", 64, 64 );

return hud;
}
play_intro
Last Edit: May 13, 2014, 04:45:36 am by Weezy428
broken avatar :(
×
broken avatar :(
Location: caottawa
Date Registered: 4 February 2014
Last active: 5 years ago
Posts
43
Respect
Forum Rank
Legless Crawler
Primary Group
Member
Signature
×
Corey's Groups
Corey's Contact & Social Links
Hey bam, so I just beta tested my map with a few guys, and we came across a few bugs.

1. The perk jingles seem to play for all the players once they're bought, no matter where the players are.
2. Vulture aid waypoints for guns, perks, pap, ect flash one and off, sort of like blinking.
3. Only one of us was able to use the wunderfizz, and it wasn't the host.
4. I think you know of this one, but not sure, the green smoke appears for players that don't have vulture aid.

That seems to be it as of now.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 1 year ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
jei9363's Contact & Social Linksjei9363jei9363jayingardia
okay

and

3. Only one of us was able to use the wunderfizz, and it wasn't the host.

whens the last time you downloaded this all_patches download?
broken avatar :(
×
broken avatar :(
Location: caottawa
Date Registered: 4 February 2014
Last active: 5 years ago
Posts
43
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
Corey's Groups
Corey's Contact & Social Links
It's showing that I downloaded it may 9th
Last Edit: May 16, 2014, 11:16:26 pm by Corey
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 9 months ago
Posts
5,551
Respect
6,691Add +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.
2. Vulture aid waypoints for guns, perks, pap, ect flash one and off, sort of like blinking.
You're hitting the hudelem limit.
broken avatar :(
×
broken avatar :(
Location: caottawa
Date Registered: 4 February 2014
Last active: 5 years ago
Posts
43
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
Corey's Groups
Corey's Contact & Social Links
You're hitting the hudelem limit.
Only seems to happen in Co-op though, could it be because everyone had vulture aid and it was adding onto one another?

Sorry, I'm not familiar with the hudelem.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 1 year ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
jei9363's Contact & Social Linksjei9363jei9363jayingardia
You're hitting the hudelem limit.

but.. but.. I used client hud

Code Snippet
Plaintext
self.personal_vulture_hud[i].hud = NewClientHudElem(self);

and they delete when not in FOV
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 8 January 2014
Last active: 6 years ago
Posts
840
Respect
Forum Rank
The Decider
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Embers are the new lens flares
×
chromastone10's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
chromastone10's Contact & Social Linkschromastone10chromastone1chromastone10
zombies still hit me while im down :(
Last Edit: May 17, 2014, 12:09:53 am by chromastone10

 
Loading ...