I need to know how to build an area for spawning zombie and dogs and right script flags Double Post Merge: October 06, 2015, 01:42:29 amplease do not offer me dlc3. I need the original zombie factory
Last Edit: October 06, 2015, 01:42:29 am by ville88
The original nazi_zombie_factory scripts are the same as the dlc3 scripts(i decompiled nazi_zombie_factory.ff to make sure) for zones.
This and the receiver zone that you were talking about make up factory's zones:
Code Snippet
Plaintext
factory_zone_init() { // Note this setup is based on a flag-centric view of setting up your zones. A brief // zone-centric example exists below in comments
// Outside East Door add_adjacent_zone( "receiver_zone", "outside_east_zone", "enter_outside_east" );
// Outside West Door add_adjacent_zone( "receiver_zone", "outside_west_zone", "enter_outside_west" );
// Wnuen building ground floor add_adjacent_zone( "wnuen_zone", "outside_east_zone", "enter_wnuen_building" );
The original nazi_zombie_factory scripts are the same as the dlc3 scripts(i decompiled nazi_zombie_factory.ff to make sure) for zones.
This and the receiver zone that you were talking about make up factory's zones:
Code Snippet
Plaintext
factory_zone_init() { // Note this setup is based on a flag-centric view of setting up your zones. A brief // zone-centric example exists below in comments
// Outside East Door add_adjacent_zone( "receiver_zone", "outside_east_zone", "enter_outside_east" );
// Outside West Door add_adjacent_zone( "receiver_zone", "outside_west_zone", "enter_outside_west" );
// Wnuen building ground floor add_adjacent_zone( "wnuen_zone", "outside_east_zone", "enter_wnuen_building" );
Should see a link between the info_volume and the spawners everytime you do this.
<zoneName> is whatever the zone's name is. Can be anything, but for the first zone its usually called "initial_zone" or "start_zone".
thanks)) but not work(( I give up
I create info_volume "targetname" "tp_east_zone" + "script_noteworthy" "tp_east_zone_spawners" (not work) and after just "target" "tp_east_zone_spawners" (not work) and create spawners "targetname" "tp_east_zone_spawners" create in barricade/door "script_flag" "enter_tp_east"
No spawn(((
everything should work ... but nothing. I'm going mad))) I am trying to unravel the name zones, and the script flags with spawners in nazi_zombie_factory (der reise)
I create info_volume "targetname" "tp_east_zone" + "script_noteworthy" "tp_east_zone_spawners" (not work) and after just "target" "tp_east_zone_spawners" (not work) and create spawners "targetname" "tp_east_zone_spawners" create in barricade/door "script_flag" "enter_tp_east"
No spawn(((
everything should work ... but nothing. I'm going mad))) I am trying to unravel the name zones, and the script flags with spawners in nazi_zombie_factory (der reise)
You don't need the script_noteworthy on the info_volume(for spawners atleast).
You also need to add the zone in the script. It should look something like this:
<zone1> = zone that is currently open, the one that the player is probably currently in. <zone2> = zone that will be activated when the <notify_string> is sent. <notify_string> = the string that activates the zone when a player buys a debris(script_flag).
who knows the names of the zones and spawn in Nazi zombies Factory (standart map)? I tried everything but not spaw( no zombie no dogs) maybe I do not prescribe the correct script flag but /-add_adjacent_zone( "receiver_zone", "outside_east_zone", "enter_outside_east" );
I want to understand how it works DLС3 is easy to understand but the factory is a puzzle. It may be the right thing. or am I just doing the wrong spawners zombie
Last Edit: October 07, 2015, 06:43:15 pm by ville88
who knows the names of the zones and spawn in Nazi zombies Factory (standart map)? I tried everything but not spaw( no zombie no dogs) maybe I do not prescribe the correct script flag but /-add_adjacent_zone( "receiver_zone", "outside_east_zone", "enter_outside_east" );
I want to understand how it works DLС3 is easy to understand but the factory is a puzzle. It may be the right thing. or am I just doing the wrong spawners zombie
main() { // This has to be first for CreateFX -- Dale maps\nazi_zombie_night_storm_fx::main();
// used to modify the percentages of pulls of ray gun and tesla gun in magic box level.pulls_since_last_ray_gun = 0; level.pulls_since_last_tesla_gun = 0; level.player_drops_tesla_gun = false;
level.dogs_enabled = true; //PI ESM - added for dog support // level.crawlers_enabled = true; //MM - added for crawler support level.mixed_rounds_enabled = true; // MM added support for mixed crawlers and dogs level.burning_zombies = []; //JV max number of zombies that can be on fire level.traps = []; //Contains all traps currently in this map level.zombie_rise_spawners = []; // Zombie riser control level.max_barrier_search_dist_override = 400;
//for(i=0;i<level.exterior_goals.size;i++) //{ // level.exterior_goals[i].is_active = 1; //} //ESM - two electrice switches, everything inactive until the right one gets used // level thread wuen_electric_switch(); // level thread warehouse_electric_switch(); // level thread watch_bridge_halves(); level thread power_electric_switch();
level thread magic_box_init();
// This controls when zones become active and start monitoring players so zombies can spawn // level thread setup_door_waits();
// If you want to modify/add to the weapons table, please copy over the _zombiemode_weapons init_weapons() and paste it here. // I recommend putting it in it's own function... // If not a MOD, you may need to provide new localized strings to reflect the proper cost.
//ESM - time for electrocuting thread init_elec_trap_trigs();
// // Create the zone information for zombie spawning // factory_zone_init() { // Note this setup is based on a flag-centric view of setting up your zones. A brief // zone-centric example exists below in comments
// Outside East Door add_adjacent_zone( "receiver_zone", "outside_east_zone", "enter_outside_east" );
// Outside West Door add_adjacent_zone( "receiver_zone", "outside_west_zone", "enter_outside_west" );
// Wnuen building ground floor add_adjacent_zone( "wnuen_zone", "outside_east_zone", "enter_wnuen_building" );
//------------------------------------------------------------------- // Animation functions - need to be specified separately in order to use different animtrees //------------------------------------------------------------------- #using_animtree( "zombie_factory" ); script_anims_init() { level.scr_anim[ "half_gate" ] = %o_zombie_lattice_gate_half; level.scr_anim[ "full_gate" ] = %o_zombie_lattice_gate_full; level.scr_anim[ "difference_engine" ] = %o_zombie_difference_engine_ani;
// Include the weapons that are only inr your level so that the cost/hints are accurate // Also adds these weapons to the random treasure chest. include_weapons() { include_weapon( "zombie_colt" ); include_weapon( "zombie_colt_upgraded", false ); include_weapon( "zombie_sw_357" ); include_weapon( "zombie_sw_357_upgraded", false );
// force gibbing if the zombie is still alive self thread animscripts\death::do_gib(); } } }
// // This initialitze the box spawn locations // You can disable boxes from appearing by not adding their script_noteworthy ID to the list // magic_box_init() { //MM - all locations are valid. If it goes somewhere you haven't opened, you need to open it. level.open_chest_location = []; level.open_chest_location[0] = "chest1"; // TP East level.open_chest_location[1] = "chest2"; // TP West level.open_chest_location[2] = "chest3"; // TP South level.open_chest_location[3] = "chest4"; // WNUEN level.open_chest_location[4] = "chest5"; // Warehouse bottom level.open_chest_location[5] = "start_chest"; }
/*------------------------------------ the electric switch under the bridge once this is used, it activates other objects in the map and makes them available to use ------------------------------------*/ power_electric_switch() { trig = getent("use_power_switch","targetname"); master_switch = getent("power_switch","targetname"); master_switch notsolid(); //master_switch rotatepitch(90,1); trig sethintstring(&"ZOMBIE_ELECTRIC_SWITCH");
//turn off the buyable door triggers for electric doors // door_trigs = getentarray("electric_door","script_noteworthy"); // array_thread(door_trigs,::set_door_unusable); // array_thread(door_trigs,::play_door_dialog);
user = undefined; if ( cheat != true ) { trig waittill("trigger",user); }
// MM - turning on the power powers the entire map // if ( IsDefined(user) ) // only send a notify if we weren't originally triggered through script // { // other_trig = getent("use_warehouse_switch","targetname"); // other_trig notify( "trigger", undefined ); // // wuen_trig = getent("use_wuen_switch", "targetname" ); // wuen_trig notify( "trigger", undefined ); // }
// Don't want east or west to spawn when in south zone, but vice versa is okay maps\_zombiemode_zone_manager::connect_zones( "outside_east_zone", "outside_south_zone" ); maps\_zombiemode_zone_manager::connect_zones( "outside_west_zone", "outside_south_zone", true ); }
/*------------------------------------ This controls the electric traps in the level self = use trigger associated with the trap ------------------------------------*/ electric_trap_think( enable_flag ) { self sethintstring(&"ZOMBIE_FLAMES_UNAVAILABLE"); self.zombie_cost = 1000;
self thread electric_trap_dialog();
// get a list of all of the other triggers with the same name triggers = getentarray( self.targetname, "targetname" ); flag_wait( "electricity_on" );
// Get the damage trigger. This is the unifying element to let us know it's been activated. self.zombie_dmg_trig = getent(self.target,"targetname"); self.zombie_dmg_trig.in_use = 0;
// Set buy string self sethintstring(&"ZOMBIE_BUTTON_NORTH_FLAMES");
// Getting the light that's related is a little esoteric, but there isn't // a better way at the moment. It uses linknames, which are really dodgy. light_name = ""; // scope declaration tswitch = getent(self.script_linkto,"script_linkname"); switch ( tswitch.script_linkname ) { case "10": // wnuen case "11": light_name = "zapper_light_wuen"; break;
case "20": // warehouse case "21": light_name = "zapper_light_warehouse"; break;
case "30": // Bridge case "31": light_name = "zapper_light_bridge"; break; }
// The power is now on, but keep it disabled until a certain condition is met // such as opening the door it is blocking or waiting for the bridge to lower. if ( !flag( enable_flag ) ) { self trigger_off();
//turn off the valve triggers associated with this trap until available again array_thread (triggers, ::trigger_off);
play_sound_at_pos( "purchase", who.origin ); self thread electric_trap_move_switch(self); //need to play a 'woosh' sound here, like a gas furnace starting up self waittill("switch_activated"); //set the score who maps\_zombiemode_score::minus_to_player_score( self.zombie_cost );
//this trigger detects zombies walking thru the flames self.zombie_dmg_trig trigger_on();
//play the flame FX and do the actual damage self thread activate_electric_trap();
//wait until done and then re-enable the valve for purchase again self waittill("elec_done");
clientnotify(self.script_string +"off");
//delete any FX ents if(isDefined(self.fx_org)) { self.fx_org delete(); } if(isDefined(self.zapper_fx_org)) { self.zapper_fx_org delete(); } if(isDefined(self.zapper_fx_switch_org)) { self.zapper_fx_switch_org delete(); }
//turn the damage detection trigger off until the flames are used again self.zombie_dmg_trig trigger_off(); wait(25);
array_thread (triggers, ::trigger_on);
//COLLIN: Play the 'alarm' sound to alert players that the traps are available again (playing on a temp ent in case the PA is already in use. //speakerA = getstruct("loudspeaker", "targetname"); //playsoundatposition("warning", speakera.origin); self notify("available");
case "20": // warehouse case "21": light_name = "zapper_light_warehouse"; break;
case "30": case "31": light_name = "zapper_light_bridge"; break; }
//turn the light above the door red zapper_light_red( light_name ); tswitch rotatepitch(180,.5); tswitch playsound("amb_sparks_l_b"); tswitch waittill("rotatedone");
if( !isDefined(self.is_burning) && !self maps\_laststand::player_is_in_laststand() ) { self.is_burning = 1; self setelectrified(1.25); shocktime = 2.5; //Changed Shellshock to Electrocution so we can have different bus volumes. self shellshock("electrocution", shocktime);
//10% chance the zombie will burn, a max of 6 burning zombs can be goign at once //otherwise the zombie just gibs and dies if(flame_chance > 90 && level.burning_zombies.size < 6) { level.burning_zombies[level.burning_zombies.size] = self; self thread zombie_flame_watch(); self playsound("ignite"); self thread animscripts\death::flame_death_fx(); wait(randomfloat(1.25)); } else {
// // Swaps a cage light model to the red one. zapper_light_red( lightname ) { zapper_lights = getentarray( lightname, "targetname"); for(i=0;i<zapper_lights.size;i++) { zapper_lights[i] setmodel("zombie_zapper_cagelight_red");
// // Swaps a cage light model to the green one. zapper_light_green( lightname ) { zapper_lights = getentarray( lightname, "targetname"); for(i=0;i<zapper_lights.size;i++) { zapper_lights[i] setmodel("zombie_zapper_cagelight_green");
// Wait for it to be hit by an upgraded weapon upgrade_hit = false; while ( !upgrade_hit ) { trig_control_panel waittill( "damage", amount, inflictor, direction, point, type );
if( vox_rand <= percent ) { index = maps\_zombiemode_weapons::get_player_index(who); plr = "plr_" + index + "_";
switch( object ) { case "vox_corkboard_1": //iprintlnbold( "Inside trigger " + object ); who thread create_and_play_dialog( plr, "vox_resp_corkmap", .25 ); break; case "vox_corkboard_2": //iprintlnbold( "Inside trigger " + object ); who thread create_and_play_dialog( plr, "vox_resp_corkmap", .25 ); break; case "vox_corkboard_3": //iprintlnbold( "Inside trigger " + object ); who thread create_and_play_dialog( plr, "vox_resp_corkmap", .25 ); break; case "vox_teddy": if( index != 2 ) { //iprintlnbold( "Inside trigger " + object ); who thread create_and_play_dialog( plr, "vox_resp_teddy", .25 ); } break; case "vox_fieldop": if( (index != 1) && (index != 3) ) { //iprintlnbold( "Inside trigger " + object ); who thread create_and_play_dialog( plr, "vox_resp_fieldop", .25 ); } break; c
Double Post Merge: October 07, 2015, 09:06:42 pmin "Nazi Zombie Factory" all works.. but I have a map with these scripts and do not work Double Post Merge: October 07, 2015, 09:29:14 pmit's my zone manager
//-------------------------------------------------------------- // Checks to see if a player is in a zone_name volume //-------------------------------------------------------------- player_in_zone( zone_name ) { // If the zone hasn't been activated, don't even bother checking if ( !IsDefined(level.zones[ zone_name ]) ) { return false; } zone = level.zones[ zone_name ];
// Okay check to see if a player is in one of the zone volumes players = get_players(); { for (i = 0; i < zone.volumes.size; i++) { for (j = 0; j < players.size; j++) { if ( players[j] IsTouching(zone.volumes[i]) ) return true; } } } return false; }
// // Disable exterior_goals that have a script_noteworthy. This can prevent zombies from // pathing to a goal that the zombie can't path towards the player after entering. // It is assumed these will be activated later, when the zone gets initialized. deactivate_initial_barrier_goals() { special_goals = getstructarray("exterior_goal", "targetname"); for (i = 0; i < special_goals.size; i++) { if (IsDefined(special_goals[i].script_noteworthy)) { special_goals[i].is_active = undefined; special_goals[i] trigger_off(); } } }
// // Allows zombies to path to the specified barriers. // All barriers with a script_noteworthy should initially triggered off by // deactivate_barrier_goals // activate_barrier_goals(barrier_name, key) { // entry_points = getstructarray(barrier_name, key);
//-------------------------------------------------------------- // Call this when you want to allow zombies to spawn from a zone // - Must have at least one info_volume with targetname = (name of the zone) // - Have the info_volumes target the zone's spawners //-------------------------------------------------------------- zone_init( zone_name ) { if ( IsDefined( level.zones[ zone_name ] ) ) { // It's already been activated return; }
// Add this to the list of active zones level.zones[ zone_name ] = spawnstruct(); level.zones[ zone_name ].is_enabled = false; // Does the zone need to be evaluated? level.zones[ zone_name ].is_occupied = false; // Is the zone occupied by a player? level.zones[ zone_name ].is_active = false; // Are the spawners currently enabled for spawning? level.zones[ zone_name ].adjacent_zones = []; // NOTE: These must be defined in a separate level-specific initialization level.zones[ zone_name ].volumes = GetEntArray( zone_name, "targetname" );
assertEx( IsDefined( level.zones[ zone_name ].volumes[0] ), "zone_init: No volumes found for zone: "+zone_name );
if ( IsDefined( level.zones[ zone_name ].volumes[0].target ) ) { // Grab all of the zombie and dog spawners and sort them into two arrays level.zones[ zone_name ].spawners = []; level.zones[ zone_name ].dog_spawners = [];
// Grab all of the zombie dog spawn structs level.zones[ zone_name ].dog_locations = GetStructArray(level.zones[ zone_name ].volumes[0].target + "_dog", "targetname");
// grab all zombie rise locations for the zone level.zones[ zone_name ].rise_locations = GetStructArray(level.zones[ zone_name ].volumes[0].target + "_rise", "targetname"); } }
// // Turn on the zone enable_zone( zone_name ) { level.zones[ zone_name ].is_enabled = true;
// activate any player spawn points spawn_points = getstructarray("player_respawn_point", "targetname"); for( i = 0; i < spawn_points.size; i++ ) { if ( spawn_points[i].script_noteworthy == zone_name ) { spawn_points[i].locked = false; } }
// // Makes zone_a connected to zone_b. If one_way is false, zone_b is also made "adjacent" to zone_a add_adjacent_zone( zone_name_a, zone_name_b, flag_name, one_way ) { if ( !IsDefined( one_way ) ) { one_way = false; }
// If it's not already activated, it will activate the zone // If it's already activated, it won't do anything. zone_init( zone_name_a ); zone_init( zone_name_b );
// B becomes an adjacent zone of A if ( !IsDefined( level.zones[ zone_name_a ].adjacent_zones[ zone_name_b ] ) ) { level.zones[ zone_name_a ].adjacent_zones[ zone_name_b ] = SpawnStruct(); level.zones[ zone_name_a ].adjacent_zones[ zone_name_b ].is_connected = false; level.zones[ zone_name_a ].adjacent_zones[ zone_name_b ].flags_do_or_check = false; if ( IsArray( flag_name ) ) { level.zones[ zone_name_a ].adjacent_zones[ zone_name_b ].flags = flag_name; } else { level.zones[ zone_name_a ].adjacent_zones[ zone_name_b ].flags[0] = flag_name; } } else { // we've already defined a link condition, but we need to add another one and treat // it as an "OR" condition assertEx( !IsArray( flag_name ), "add_adjacent_zone: can't mix single and arrays of flags" ); size = level.zones[ zone_name_a ].adjacent_zones[ zone_name_b ].flags.size; level.zones[ zone_name_a ].adjacent_zones[ zone_name_b ].flags[ size ] = flag_name; level.zones[ zone_name_a ].adjacent_zones[ zone_name_b ].flags_do_or_check = true; }
if ( !one_way ) { if ( !IsDefined( level.zones[ zone_name_b ].adjacent_zones[ zone_name_a ] ) ) { // A becomes an adjacent zone of B level.zones[ zone_name_b ].adjacent_zones[ zone_name_a ] = SpawnStruct(); level.zones[ zone_name_b ].adjacent_zones[ zone_name_a ].is_connected = false; level.zones[ zone_name_b ].adjacent_zones[ zone_name_a ].flags_do_or_check = false; if ( IsArray( flag_name ) ) { level.zones[ zone_name_b ].adjacent_zones[ zone_name_a ].flags = flag_name; } else { level.zones[ zone_name_b ].adjacent_zones[ zone_name_a ].flags[0] = flag_name; } } else { // we've already defined a link condition, but we need to add another one and treat // it as an "OR" condition assertEx( !IsArray( flag_name ), "add_adjacent_zone: can't mix single and arrays of flags" ); size = level.zones[ zone_name_b ].adjacent_zones[ zone_name_a ].flags.size; level.zones[ zone_name_b ].adjacent_zones[ zone_name_a ].flags[ size ] = flag_name; level.zones[ zone_name_b ].adjacent_zones[ zone_name_a ].flags_do_or_check = true; } } }
//-------------------------------------------------------------- // Gathers all flags that need to be evaluated and sets up waits for them //-------------------------------------------------------------- setup_zone_flag_waits() { flags = []; for( z=0; z<level.zones.size; z++ ) { zkeys = GetArrayKeys( level.zones ); for ( az = 0; az<level.zones[ zkeys[z] ].adjacent_zones.size; az++ ) { azkeys = GetArrayKeys( level.zones[ zkeys[z] ].adjacent_zones ); for ( f = 0; f< level.zones[ zkeys[z] ].adjacent_zones[ azkeys[az] ].flags.size; f++ ) { no_dupes = array_check_for_dupes( flags, level.zones[ zkeys[z] ].adjacent_zones[ azkeys[az] ].flags[f] ); if( no_dupes ) { flags = add_to_array(flags, level.zones[ zkeys[z] ].adjacent_zones[ azkeys[az] ].flags[f] ); } } } }
// // Wait for a zone flag to be set and then update zones // zone_flag_wait( flag_name ) { if ( !IsDefined( level.flag[ flag_name ] ) ) { flag_init( flag_name ); } flag_wait( flag_name );
// Enable adjacent zones if all flags are set for a connection for( z=0; z<level.zones.size; z++ ) { zkeys = GetArrayKeys( level.zones ); for ( az = 0; az<level.zones[ zkeys[z] ].adjacent_zones.size; az++ ) { azkeys = GetArrayKeys( level.zones[ zkeys[z] ].adjacent_zones );
if ( !level.zones[ zkeys[z] ].adjacent_zones[ azkeys[az] ].is_connected ) { if ( level.zones[ zkeys[z] ].adjacent_zones[ azkeys[az] ].flags_do_or_check ) { // If ANY flag is set, then connect zones flags_set = false; for ( f = 0; f< level.zones[ zkeys[z] ].adjacent_zones[ azkeys[az] ].flags.size; f++ ) { if ( flag( level.zones[ zkeys[z] ].adjacent_zones[ azkeys[az] ].flags[f] ) ) { flags_set = true; break; } } if ( flags_set ) { level.zones[ zkeys[z] ].adjacent_zones[ azkeys[az] ].is_connected = true; if ( !level.zones[ azkeys[az] ].is_enabled ) { enable_zone( azkeys[az] ); } } } else { // See if ALL the flags have been set, otherwise, move on flags_set = true; for ( f = 0; f< level.zones[ zkeys[z] ].adjacent_zones[ azkeys[az] ].flags.size; f++ ) { if ( !flag( level.zones[ zkeys[z] ].adjacent_zones[ azkeys[az] ].flags[f] ) ) { flags_set = false; } } if ( flags_set ) { level.zones[ zkeys[z] ].adjacent_zones[ azkeys[az] ].is_connected = true; if ( !level.zones[ azkeys[az] ].is_enabled ) { enable_zone( azkeys[az] ); } } } } } } }
//-------------------------------------------------------------- // This needs to be called when new zones open up via doors //-------------------------------------------------------------- connect_zones( zone_name_a, zone_name_b, one_way ) { if ( !IsDefined( one_way ) ) { one_way = false; }
// If it's not already activated, it will activate the zone // If it's already activated, it won't do anything. zone_init( zone_name_a ); zone_init( zone_name_b );
// B becomes an adjacent zone of A if ( !IsDefined( level.zones[ zone_name_a ].adjacent_zones[ zone_name_b ] ) ) { level.zones[ zone_name_a ].adjacent_zones[ zone_name_b ] = SpawnStruct(); level.zones[ zone_name_a ].adjacent_zones[ zone_name_b ].is_connected = true; }
if ( !one_way ) { // A becomes an adjacent zone of B if ( !IsDefined( level.zones[ zone_name_b ].adjacent_zones[ zone_name_a ] ) ) { level.zones[ zone_name_b ].adjacent_zones[ zone_name_a ] = SpawnStruct(); level.zones[ zone_name_b ].adjacent_zones[ zone_name_a ].is_connected = true; } } }
//-------------------------------------------------------------- // This one function will handle managing all zones in your map // to turn them on/off - probably the best way to handle this //-------------------------------------------------------------- manage_zones( initial_zone ) { assertEx( IsDefined( initial_zone ), "You must specify an initial zone to manage" );
deactivate_initial_barrier_goals(); // Must be called before zone_init
level.zones = []; // Setup zone connections if ( IsDefined( level.zone_manager_init_func ) ) { [[ level.zone_manager_init_func ]](); }
if ( IsArray( initial_zone ) ) { for ( i = 0; i < initial_zone.size; i++ ) { zone_init( initial_zone[i] ); enable_zone( initial_zone[i] ); } } else { zone_init( initial_zone ); enable_zone( initial_zone ); }
setup_zone_flag_waits();
// Now iterate through the active zones and see if we need to activate spawners while(getdvarint("noclip") == 0 ||getdvarint("notarget") != 0 ) { zkeys = GetArrayKeys( level.zones );
// clear out active zone flags for( z=0; z<zkeys.size; z++ ) { level.zones[ zkeys[z] ].is_active = false; level.zones[ zkeys[z] ].is_occupied = false; }
// Figure out which zones are active // If a player occupies a zone, then that zone and any of its enabled adjacent zones will activate a_zone_is_active = false; // let's us know if an active zone is found for( z=0; z<zkeys.size; z++ ) { if ( !level.zones[ zkeys[z] ].is_enabled ) { continue; }
// MM - Special logic for empty spawner list if ( !a_zone_is_active ) { level.zones[ "receiver_zone" ].is_active = true; level.zones[ "receiver_zone" ].is_occupied = true; }
// Okay now we can modify the spawner list for( z=0; z<zkeys.size; z++ ) { zone_name = zkeys[z];
if ( !level.zones[ zkeys[z] ].is_enabled ) { continue; }
if ( level.zones[ zone_name ].is_active ) { // Making an assumption that if one of the zone's spawners is in the array, then all of them are in the array if ( level.zones[ zone_name ].spawners.size > 0 ) { no_dupes = array_check_for_dupes( level.enemy_spawns, level.zones[ zone_name ].spawners[0] ); if( no_dupes ) { for(x=0;x<level.zones[ zone_name ].spawners.size;x++) { level.zones[ zone_name ].spawners[x].locked_spawner = false; level.enemy_spawns = add_to_array(level.enemy_spawns, level.zones[ zone_name ].spawners[x]); } } }
// Making an assumption that if one of the zone's spawners is in the array, then all of them are in the array if ( level.zones[ zone_name ].dog_spawners.size > 0 ) { no_dupes = array_check_for_dupes( level.enemy_dog_spawns, level.zones[ zone_name ].dog_spawners[0] ); if( no_dupes ) { for(x=0;x<level.zones[ zone_name ].dog_spawners.size;x++) { level.enemy_dog_spawns = add_to_array(level.enemy_dog_spawns, level.zones[ zone_name ].dog_spawners[x]); } } }
// activate any associated dog_spawn locations if ( level.zones[ zone_name ].dog_locations.size > 0 ) { // Making an assumption that if one of the structs // is in the array, then all of them are in the array no_dupes = array_check_for_dupes(level.enemy_dog_locations, level.zones[ zone_name ].dog_locations[0]); if( no_dupes ) { for(x=0; x<level.zones[ zone_name ].dog_locations.size; x++) { level.zones[ zone_name ].dog_locations[x].locked_spawner = false; level.enemy_dog_locations = add_to_array(level.enemy_dog_locations, level.zones[ zone_name ].dog_locations[x]); } } }
// activate any associated zombie_rise locations if ( level.zones[ zone_name ].rise_locations.size > 0 ) { // Making an assumption that if one of the zone's spawners // is in the array, then all of them are in the array no_dupes = array_check_for_dupes(level.zombie_rise_spawners, level.zones[ zone_name ].rise_locations[0]); if( no_dupes ) { for(x=0; x<level.zones[ zone_name ].rise_locations.size; x++) { level.zones[ zone_name ].rise_locations[x].locked_spawner = false; level.zombie_rise_spawners = add_to_array(level.zombie_rise_spawners, level.zones[ zone_name ].rise_locations[x]); } } } } // The zone is not active so disable the spawners else { // Making an assumption that if one of the zone's spawners // is in the array, then all of them are in the array if ( level.zones[ zone_name ].spawners.size > 0 ) { no_dupes = array_check_for_dupes( level.enemy_spawns, level.zones[ zone_name ].spawners[0] ); if( !no_dupes ) { for(x=0;x<level.zones[ zone_name ].spawners.size;x++) { level.zones[ zone_name ].spawners[x].locked_spawner = true; level.enemy_spawns = array_remove_nokeys(level.enemy_spawns, level.zones[ zone_name ].spawners[x]); } } }
// Making an assumption that if one of the zone's spawners is in the array, then all of them are in the array if ( level.zones[ zone_name ].dog_spawners.size > 0 ) { no_dupes = array_check_for_dupes( level.enemy_dog_spawns, level.zones[ zone_name ].dog_spawners[0] ); if( !no_dupes ) { for(x=0;x<level.zones[ zone_name ].dog_spawners.size;x++) { level.enemy_dog_spawns = array_remove_nokeys(level.enemy_dog_spawns, level.zones[ zone_name ].dog_spawners[x]); } } }
// deactivate any associated dog spawn locations if ( level.zones[ zone_name ].dog_locations.size > 0 ) { // Making an assumption that if one of the structs is in the array, then all of them are in the array no_dupes = array_check_for_dupes(level.enemy_dog_locations, level.zones[ zone_name ].dog_locations[0]); if( !no_dupes ) { for(x=0; x<level.zones[ zone_name ].dog_locations.size; x++) { level.zones[ zone_name ].dog_locations[x].locked_spawner = false; level.enemy_dog_locations = array_remove_nokeys(level.enemy_dog_locations, level.zones[ zone_name ].dog_locations[x]); } } } // deactivate any associated zombie_rise locations if ( level.zones[ zone_name ].rise_locations.size > 0 ) { // Making an assumption that if one of the zone's spawners // is in the array, then all of them are in the array no_dupes = array_check_for_dupes(level.zombie_rise_spawners, level.zones[ zone_name ].rise_locations[0]); if( !no_dupes ) { for(x=0; x<level.zones[ zone_name ].rise_locations.size; x++) { level.zones[ zone_name ].rise_locations[x].locked_spawner = false; level.zombie_rise_spawners = array_remove_nokeys(level.zombie_rise_spawners, level.zones[ zone_name ].rise_locations[x]); } } } } }
//wait a second before another check wait(1); } }
Last Edit: October 07, 2015, 09:29:50 pm by ville88