diff --git a/scripts/zm/_zm_reimagined.gsc b/scripts/zm/_zm_reimagined.gsc index fd172f29..25d34ba0 100644 --- a/scripts/zm/_zm_reimagined.gsc +++ b/scripts/zm/_zm_reimagined.gsc @@ -313,7 +313,7 @@ set_dvars() setDvar( "sv_voice", 2 ); setDvar( "sv_voiceQuality", 9 ); - setDvar( "sv_cheats", 0 ); + //setDvar( "sv_cheats", 0 ); } set_client_dvars() @@ -365,6 +365,8 @@ health_bar_hud() flag_wait( "initial_blackscreen_passed" ); + level.player_out_of_playable_area_monitor = false; + x = 5; y = -104; if (level.script == "zm_buried") diff --git a/scripts/zm/locs/zm_transit_loc_cornfield.gsc b/scripts/zm/locs/zm_transit_loc_cornfield.gsc new file mode 100644 index 00000000..d7789405 --- /dev/null +++ b/scripts/zm/locs/zm_transit_loc_cornfield.gsc @@ -0,0 +1,191 @@ +#include maps\mp\zombies\_zm_game_module; +#include maps\mp\zombies\_zm_utility; +#include common_scripts\utility; +#include maps\mp\_utility; +#include maps\mp\zombies\_zm; +#include maps\mp\zombies\_zm_zonemgr; + +#include scripts\zm\replaced\utility; +#include scripts\zm\locs\loc_common; + +struct_init() +{ + //replaceFunc(maps\mp\zombies\_zm_zonemgr::manage_zones, ::manage_zones); + + scripts\zm\replaced\utility::register_map_initial_spawnpoint( ( 7521, -545, -198 ), (0, 0, 0), 1 ); + scripts\zm\replaced\utility::register_map_initial_spawnpoint( ( 7751, -522, -202 ), (0, 0, 0), 1 ); + scripts\zm\replaced\utility::register_map_initial_spawnpoint( ( 7691, -395, -201 ), (0, 0, 0), 1 ); + scripts\zm\replaced\utility::register_map_initial_spawnpoint( ( 7536, -432, -199 ), (0, 0, 0), 1 ); + scripts\zm\replaced\utility::register_map_initial_spawnpoint( ( 13745, -336, -188 ), (0, 0, 0), 2 ); + scripts\zm\replaced\utility::register_map_initial_spawnpoint( ( 13758, -681, -188 ), (0, 0, 0), 2 ); + scripts\zm\replaced\utility::register_map_initial_spawnpoint( ( 13816, -1088, -189 ), (0, 0, 0), 2 ); + scripts\zm\replaced\utility::register_map_initial_spawnpoint( ( 13752, -1444, -182 ), (0, 0, 0), 2 ); +} + +precache() +{ + collision = Spawn( "script_model", (10500, -850, 0 ), 1 ); + collision SetModel( "zm_collision_transit_cornfield_survival" ); + collision DisconnectPaths(); +} + +main() +{ + treasure_chest_init(); + init_wallbuys(); + init_barriers(); + disable_zombie_spawn_locations(); + scripts\zm\locs\loc_common::init(); +} + +treasure_chest_init() +{ +} + +init_wallbuys() +{ +} + +init_barriers() +{ +} + +disable_zombie_spawn_locations() +{ +} + +transit_loc_power_zone_init() +{ +} + +manage_zones( initial_zone ) +{ + level.zone_manager_init_func = ::transit_loc_power_zone_init; + initial_zone = []; + initial_zone[0] = "zone_pow"; + initial_zone[1] = "zone_trans_8"; + + deactivate_initial_barrier_goals(); + zone_choke = 0; + spawn_points = maps\mp\gametypes_zm\_zm_gametype::get_player_spawns_for_gametype(); + for ( i = 0; i < spawn_points.size; i++ ) + { + spawn_points[ i ].locked = 1; + } + 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(); + zkeys = getarraykeys( level.zones ); + level.zone_keys = zkeys; + level.newzones = []; + for ( z = 0; z < zkeys.size; z++ ) + { + level.newzones[ zkeys[ z ] ] = spawnstruct(); + } + oldzone = undefined; + flag_set( "zones_initialized" ); + flag_wait( "begin_spawning" ); + while ( getDvarInt( "noclip" ) == 0 || getDvarInt( "notarget" ) != 0 ) + { + for( z = 0; z < zkeys.size; z++ ) + { + level.newzones[ zkeys[ z ] ].is_active = 0; + level.newzones[ zkeys[ z ] ].is_occupied = 0; + } + a_zone_is_active = 0; + a_zone_is_spawning_allowed = 0; + level.zone_scanning_active = 1; + z = 0; + while ( z < zkeys.size ) + { + zone = level.zones[ zkeys[ z ] ]; + newzone = level.newzones[ zkeys[ z ] ]; + if( !zone.is_enabled ) + { + z++; + continue; + } + if ( isdefined(level.zone_occupied_func ) ) + { + newzone.is_occupied = [[ level.zone_occupied_func ]]( zkeys[ z ] ); + } + else + { + newzone.is_occupied = player_in_zone( zkeys[ z ] ); + } + if ( newzone.is_occupied ) + { + newzone.is_active = 1; + a_zone_is_active = 1; + if ( zone.is_spawning_allowed ) + { + a_zone_is_spawning_allowed = 1; + } + if ( !isdefined(oldzone) || oldzone != newzone ) + { + level notify( "newzoneActive", zkeys[ z ] ); + oldzone = newzone; + } + azkeys = getarraykeys( zone.adjacent_zones ); + for ( az = 0; az < zone.adjacent_zones.size; az++ ) + { + if ( zone.adjacent_zones[ azkeys[ az ] ].is_connected && level.zones[ azkeys[ az ] ].is_enabled ) + { + level.newzones[ azkeys[ az ] ].is_active = 1; + if ( level.zones[ azkeys[ az ] ].is_spawning_allowed ) + { + a_zone_is_spawning_allowed = 1; + } + } + } + } + zone_choke++; + if ( zone_choke >= 3 ) + { + zone_choke = 0; + wait 0.05; + } + z++; + } + level.zone_scanning_active = 0; + for ( z = 0; z < zkeys.size; z++ ) + { + level.zones[ zkeys[ z ] ].is_active = level.newzones[ zkeys[ z ] ].is_active; + level.zones[ zkeys[ z ] ].is_occupied = level.newzones[ zkeys[ z ] ].is_occupied; + } + if ( !a_zone_is_active || !a_zone_is_spawning_allowed ) + { + if ( isarray( initial_zone ) ) + { + level.zones[ initial_zone[ 0 ] ].is_active = 1; + level.zones[ initial_zone[ 0 ] ].is_occupied = 1; + level.zones[ initial_zone[ 0 ] ].is_spawning_allowed = 1; + } + else + { + level.zones[ initial_zone ].is_active = 1; + level.zones[ initial_zone ].is_occupied = 1; + level.zones[ initial_zone ].is_spawning_allowed = 1; + } + } + [[ level.create_spawner_list_func ]]( zkeys ); + level.active_zone_names = maps\mp\zombies\_zm_zonemgr::get_active_zone_names(); + wait 1; + } +} \ No newline at end of file diff --git a/scripts/zm/replaced/zm_transit_gamemodes.gsc b/scripts/zm/replaced/zm_transit_gamemodes.gsc index d140fd44..27f0d885 100644 --- a/scripts/zm/replaced/zm_transit_gamemodes.gsc +++ b/scripts/zm/replaced/zm_transit_gamemodes.gsc @@ -31,6 +31,7 @@ init() add_map_location_gamemode( "zstandard", "diner", scripts\zm\locs\zm_transit_loc_diner::precache, scripts\zm\locs\zm_transit_loc_diner::main ); add_map_location_gamemode( "zstandard", "power", scripts\zm\locs\zm_transit_loc_power::precache, scripts\zm\locs\zm_transit_loc_power::main ); add_map_location_gamemode( "zstandard", "tunnel", scripts\zm\locs\zm_transit_loc_tunnel::precache, scripts\zm\locs\zm_transit_loc_tunnel::main ); + add_map_location_gamemode( "zstandard", "cornfield", scripts\zm\locs\zm_transit_loc_cornfield::precache, scripts\zm\locs\zm_transit_loc_cornfield::main ); add_map_location_gamemode( "zgrief", "transit", maps\mp\zm_transit_grief_station::precache, maps\mp\zm_transit_grief_station::main ); add_map_location_gamemode( "zgrief", "farm", maps\mp\zm_transit_grief_farm::precache, maps\mp\zm_transit_grief_farm::main ); @@ -38,6 +39,7 @@ init() add_map_location_gamemode( "zgrief", "diner", scripts\zm\locs\zm_transit_loc_diner::precache, scripts\zm\locs\zm_transit_loc_diner::main ); add_map_location_gamemode( "zgrief", "power", scripts\zm\locs\zm_transit_loc_power::precache, scripts\zm\locs\zm_transit_loc_power::main ); add_map_location_gamemode( "zgrief", "tunnel", scripts\zm\locs\zm_transit_loc_tunnel::precache, scripts\zm\locs\zm_transit_loc_tunnel::main ); + add_map_location_gamemode( "zgrief", "cornfield", scripts\zm\locs\zm_transit_loc_cornfield::precache, scripts\zm\locs\zm_transit_loc_cornfield::main ); scripts\zm\replaced\utility::add_struct_location_gamemode_func( "zstandard", "diner", scripts\zm\locs\zm_transit_loc_diner::struct_init ); scripts\zm\replaced\utility::add_struct_location_gamemode_func( "zgrief", "diner", scripts\zm\locs\zm_transit_loc_diner::struct_init ); @@ -45,4 +47,6 @@ init() scripts\zm\replaced\utility::add_struct_location_gamemode_func( "zgrief", "power", scripts\zm\locs\zm_transit_loc_power::struct_init ); scripts\zm\replaced\utility::add_struct_location_gamemode_func( "zstandard", "tunnel", scripts\zm\locs\zm_transit_loc_tunnel::struct_init ); scripts\zm\replaced\utility::add_struct_location_gamemode_func( "zgrief", "tunnel", scripts\zm\locs\zm_transit_loc_tunnel::struct_init ); + scripts\zm\replaced\utility::add_struct_location_gamemode_func( "zstandard", "cornfield", scripts\zm\locs\zm_transit_loc_cornfield::struct_init ); + scripts\zm\replaced\utility::add_struct_location_gamemode_func( "zgrief", "cornfield", scripts\zm\locs\zm_transit_loc_cornfield::struct_init ); } \ No newline at end of file diff --git a/scripts/zm/zm_transit/zm_transit_reimagined.gsc b/scripts/zm/zm_transit/zm_transit_reimagined.gsc index 211fdf90..2bd800e4 100644 --- a/scripts/zm/zm_transit/zm_transit_reimagined.gsc +++ b/scripts/zm/zm_transit/zm_transit_reimagined.gsc @@ -39,6 +39,32 @@ main() replaceFunc(maps\mp\gametypes_zm\zmeat::last_stand_meat_nudge, scripts\zm\replaced\zmeat::last_stand_meat_nudge); include_weapons_grief(); + + game_mode_objects = getEntArray( "game_mode_object", "targetname" ); + foreach ( game_obj in game_mode_objects ) + { + if ( !isDefined( game_obj.script_string ) ) + { + continue; + } + keys = strTok( game_obj.script_string, " " ); + foreach ( key in keys ) + { + if ( key == "znml" ) + { + game_obj.script_string = "zstandard"; + break; + } + } + } + perk_machines = getEntArray( "zm_perk_machine", "targetname" ); + foreach ( perk in perk_machines ) + { + if ( isDefined( perk.script_string ) && perk.script_string == "znml_perks_cornfield" ) + { + perk.script_string = "zstandard_perks_cornfield"; + } + } } init()