Checked 3 zm_buried_patch scripts.

Checked zm_buried_gamemodes.gsc, zm_buried_grief_street.gsc, and zm_buried_sq.gsc.
This commit is contained in:
JezuzLizard 2021-01-25 01:06:56 -08:00
parent b88ded4a51
commit 30bab61abe
4 changed files with 114 additions and 184 deletions

View File

@ -1,14 +1,19 @@
//checked includes changed to match cerberus output
#include maps/mp/zombies/_zm_unitrigger; #include maps/mp/zombies/_zm_unitrigger;
#include maps/mp/zombies/_zm_weapons; #include maps/mp/zombies/_zm_weapons;
#include maps/mp/zombies/_zm_zonemgr; #include maps/mp/zombies/_zm_zonemgr;
#include maps/mp/zm_buried_grief_street;
#include maps/mp/zm_buried_turned_street;
#include maps/mp/zm_buried_classic;
#include maps/mp/zm_buried; #include maps/mp/zm_buried;
#include maps/mp/zombies/_zm_buildables;
#include maps/mp/gametypes_zm/_zm_gametype; #include maps/mp/gametypes_zm/_zm_gametype;
#include maps/mp/zombies/_zm_game_module; #include maps/mp/zombies/_zm_game_module;
#include maps/mp/zombies/_zm_utility; #include maps/mp/zombies/_zm_utility;
#include maps/mp/_utility; #include maps/mp/_utility;
#include common_scripts/utility; #include common_scripts/utility;
init() init() //checked matches cerberus output
{ {
add_map_gamemode( "zclassic", ::maps/mp/zm_buried::zclassic_preinit, undefined, undefined ); add_map_gamemode( "zclassic", ::maps/mp/zm_buried::zclassic_preinit, undefined, undefined );
add_map_gamemode( "zcleansed", ::maps/mp/zm_buried::zcleansed_preinit, undefined, undefined ); add_map_gamemode( "zcleansed", ::maps/mp/zm_buried::zcleansed_preinit, undefined, undefined );
@ -18,79 +23,64 @@ init()
add_map_location_gamemode( "zgrief", "street", ::maps/mp/zm_buried_grief_street::precache, ::maps/mp/zm_buried_grief_street::main ); add_map_location_gamemode( "zgrief", "street", ::maps/mp/zm_buried_grief_street::precache, ::maps/mp/zm_buried_grief_street::main );
} }
deletechalktriggers() deletechalktriggers() //checked matches cerberus output
{ {
chalk_triggers = getentarray( "chalk_buildable_trigger", "targetname" ); chalk_triggers = getentarray( "chalk_buildable_trigger", "targetname" );
array_thread( chalk_triggers, ::self_delete ); array_thread( chalk_triggers, ::self_delete );
} }
deletebuyabledoors() deletebuyabledoors() //checked changed to match cerberus output
{ {
doors_trigs = getentarray( "zombie_door", "targetname" ); doors_trigs = getentarray( "zombie_door", "targetname" );
_a41 = doors_trigs; foreach(door in doors_trigs)
_k41 = getFirstArrayKey( _a41 );
while ( isDefined( _k41 ) )
{ {
door = _a41[ _k41 ];
doors = getentarray( door.target, "targetname" ); doors = getentarray( door.target, "targetname" );
array_thread( doors, ::self_delete ); array_thread( doors, ::self_delete );
_k41 = getNextArrayKey( _a41, _k41 );
} }
array_thread( doors_trigs, ::self_delete ); array_thread( doors_trigs, ::self_delete );
} }
deletebuyabledebris( justtriggers ) deletebuyabledebris( justtriggers ) //checked changed to match cerberus output
{ {
debris_trigs = getentarray( "zombie_debris", "targetname" ); debris_trigs = getentarray( "zombie_debris", "targetname" );
while ( !is_true( justtriggers ) ) while ( !is_true( justtriggers ) )
{ {
_a56 = debris_trigs; foreach ( trig in debris_trigs )
_k56 = getFirstArrayKey( _a56 );
while ( isDefined( _k56 ) )
{ {
trig = _a56[ _k56 ];
if ( isDefined( trig.script_flag ) ) if ( isDefined( trig.script_flag ) )
{ {
flag_set( trig.script_flag ); flag_set( trig.script_flag );
} }
parts = getentarray( trig.target, "targetname" ); parts = getentarray( trig.target, "targetname" );
array_thread( parts, ::self_delete ); array_thread( parts, ::self_delete );
_k56 = getNextArrayKey( _a56, _k56 );
} }
} }
array_thread( debris_trigs, ::self_delete ); array_thread( debris_trigs, ::self_delete );
} }
deleteslothbarricades( justtriggers ) deleteslothbarricades( justtriggers ) //checked changed to match cerberus output
{ {
sloth_trigs = getentarray( "sloth_barricade", "targetname" ); sloth_trigs = getentarray( "sloth_barricade", "targetname" );
while ( !is_true( justtriggers ) ) while ( !is_true( justtriggers ) )
{ {
_a77 = sloth_trigs; foreach ( trig in sloth_trigs )
_k77 = getFirstArrayKey( _a77 );
while ( isDefined( _k77 ) )
{ {
trig = _a77[ _k77 ];
if ( isDefined( trig.script_flag ) && level flag_exists( trig.script_flag ) ) if ( isDefined( trig.script_flag ) && level flag_exists( trig.script_flag ) )
{ {
flag_set( trig.script_flag ); flag_set( trig.script_flag );
} }
parts = getentarray( trig.target, "targetname" ); parts = getentarray( trig.target, "targetname" );
array_thread( parts, ::self_delete ); array_thread( parts, ::self_delete );
_k77 = getNextArrayKey( _a77, _k77 );
} }
} }
array_thread( sloth_trigs, ::self_delete ); array_thread( sloth_trigs, ::self_delete );
} }
deleteslothbarricade( location ) deleteslothbarricade( location ) //checked changed to match cerberus output
{ {
sloth_trigs = getentarray( "sloth_barricade", "targetname" ); sloth_trigs = getentarray( "sloth_barricade", "targetname" );
_a96 = sloth_trigs; foreach ( trig in sloth_trigs )
_k96 = getFirstArrayKey( _a96 );
while ( isDefined( _k96 ) )
{ {
trig = _a96[ _k96 ];
if ( isDefined( trig.script_location ) && trig.script_location == location ) if ( isDefined( trig.script_location ) && trig.script_location == location )
{ {
if ( isDefined( trig.script_flag ) ) if ( isDefined( trig.script_flag ) )
@ -100,11 +90,10 @@ deleteslothbarricade( location )
parts = getentarray( trig.target, "targetname" ); parts = getentarray( trig.target, "targetname" );
array_thread( parts, ::self_delete ); array_thread( parts, ::self_delete );
} }
_k96 = getNextArrayKey( _a96, _k96 );
} }
} }
spawnmapcollision( collision_model, origin ) spawnmapcollision( collision_model, origin ) //checked matches cerberus output
{ {
if ( !isDefined( origin ) ) if ( !isDefined( origin ) )
{ {
@ -115,66 +104,55 @@ spawnmapcollision( collision_model, origin )
collision disconnectpaths(); collision disconnectpaths();
} }
turnperkon( perk ) turnperkon( perk ) //checked matches cerberus output
{ {
level notify( perk + "_on" ); level notify( perk + "_on" );
wait_network_frame(); wait_network_frame();
} }
disableallzonesexcept( zones ) disableallzonesexcept( zones ) //checked changed to match cerberus output see compiler_limitations.md No. 1
{ {
_a133 = zones; foreach ( zone in zones )
_k133 = getFirstArrayKey( _a133 );
while ( isDefined( _k133 ) )
{ {
zone = _a133[ _k133 ];
level thread maps/mp/zombies/_zm_zonemgr::enable_zone( zone ); level thread maps/mp/zombies/_zm_zonemgr::enable_zone( zone );
_k133 = getNextArrayKey( _a133, _k133 );
} }
_a140 = level.zones; zoneindex = 0;
zoneindex = getFirstArrayKey( _a140 ); foreach ( zone in level.zones )
while ( isDefined( zoneindex ) )
{ {
zone = _a140[ zoneindex ];
should_disable = 1; should_disable = 1;
_a144 = zones; for ( i = 0; i > zones.size; i++ )
_k144 = getFirstArrayKey( _a144 );
while ( isDefined( _k144 ) )
{ {
cleared_zone = _a144[ _k144 ]; if ( zoneindex == i )
if ( zoneindex == cleared_zone )
{ {
should_disable = 0; should_disable = 0;
} }
_k144 = getNextArrayKey( _a144, _k144 );
} }
if ( is_true( should_disable ) ) if ( is_true( should_disable ) )
{ {
zone.is_enabled = 0; zones[ i ].is_enabled = 0;
zone.is_spawning_allowed = 0; zones[ i ].is_spawning_allowed = 0;
} }
zoneindex = getNextArrayKey( _a140, zoneindex ); zoneindex++;
} }
} }
remove_adjacent_zone( main_zone, adjacent_zone ) remove_adjacent_zone( main_zone, adjacent_zone ) //checked changed to match cerberus output
{ {
if ( isDefined( level.zones[ main_zone ].adjacent_zones ) && isDefined( level.zones[ main_zone ].adjacent_zones[ adjacent_zone ] ) ) if ( isDefined( level.zones[ main_zone ].adjacent_zones ) && isDefined( level.zones[ main_zone ].adjacent_zones[ adjacent_zone ] ) )
{ {
level.zones[ main_zone ].adjacent_zones[ adjacent_zone ] = undefined;
} }
if ( isDefined( level.zones[ adjacent_zone ].adjacent_zones ) && isDefined( level.zones[ adjacent_zone ].adjacent_zones[ main_zone ] ) ) if ( isDefined( level.zones[ adjacent_zone ].adjacent_zones ) && isDefined( level.zones[ adjacent_zone ].adjacent_zones[ main_zone ] ) )
{ {
level.zones[ adjacent_zone ].adjacent_zones[ main_zone ] = undefined;
} }
} }
builddynamicwallbuy( location, weaponname ) builddynamicwallbuy( location, weaponname ) //checked changed to match cerberus output
{ {
match_string = ( level.scr_zm_ui_gametype + "_" ) + level.scr_zm_map_start_location; match_string = ( level.scr_zm_ui_gametype + "_" ) + level.scr_zm_map_start_location;
_a177 = level.chalk_builds; foreach ( stub in level.chalk_builds )
_k177 = getFirstArrayKey( _a177 );
while ( isDefined( _k177 ) )
{ {
stub = _a177[ _k177 ];
wallbuy = getstruct( stub.target, "targetname" ); wallbuy = getstruct( stub.target, "targetname" );
if ( isDefined( wallbuy.script_location ) && wallbuy.script_location == location ) if ( isDefined( wallbuy.script_location ) && wallbuy.script_location == location )
{ {
@ -184,42 +162,33 @@ builddynamicwallbuy( location, weaponname )
thread wait_and_remove( stub, stub.buildablezone.pieces[ 0 ] ); thread wait_and_remove( stub, stub.buildablezone.pieces[ 0 ] );
} }
} }
_k177 = getNextArrayKey( _a177, _k177 );
} }
} }
buildbuildable( buildable ) buildbuildable( buildable ) //checked changed to match cerberus output see compiler_limitations.md No. 1
{ {
player = get_players()[ 0 ]; player = get_players()[ 0 ];
_a197 = level.buildable_stubs; foreach ( stub in level.buildable_stubs )
_k197 = getFirstArrayKey( _a197 );
while ( isDefined( _k197 ) )
{ {
stub = _a197[ _k197 ];
if ( !isDefined( buildable ) || stub.equipname == buildable ) if ( !isDefined( buildable ) || stub.equipname == buildable )
{ {
if ( isDefined( buildable ) || stub.persistent != 3 ) if ( isDefined( buildable ) || stub.persistent != 3 )
{ {
stub maps/mp/zombies/_zm_buildables::buildablestub_finish_build( player ); stub maps/mp/zombies/_zm_buildables::buildablestub_finish_build( player );
stub maps/mp/zombies/_zm_buildables::buildablestub_remove(); stub maps/mp/zombies/_zm_buildables::buildablestub_remove();
_a206 = stub.buildablezone.pieces; for ( i = 0; i < stub.buildablezone.pieces.size; i++ )
_k206 = getFirstArrayKey( _a206 );
while ( isDefined( _k206 ) )
{ {
piece = _a206[ _k206 ]; stub.buildablezone.pieces[ i ] maps/mp/zombies/_zm_buildables::piece_unspawn();
piece maps/mp/zombies/_zm_buildables::piece_unspawn();
_k206 = getNextArrayKey( _a206, _k206 );
} }
stub.model notsolid(); stub.model notsolid();
stub.model show(); stub.model show();
return; return;
} }
} }
_k197 = getNextArrayKey( _a197, _k197 );
} }
} }
wait_and_remove( stub, piece ) wait_and_remove( stub, piece ) //checked matches cerberus output
{ {
wait 0,1; wait 0,1;
self buildablestub_remove(); self buildablestub_remove();
@ -227,15 +196,12 @@ wait_and_remove( stub, piece )
piece piece_unspawn(); piece piece_unspawn();
} }
generatebuildabletarps() generatebuildabletarps() //checked changed to match cerberus output
{ {
struct_locations = getstructarray( "buildables_tarp", "targetname" ); struct_locations = getstructarray( "buildables_tarp", "targetname" );
level.buildable_tarps = []; level.buildable_tarps = [];
_a234 = struct_locations; foreach ( struct in struct_locations )
_k234 = getFirstArrayKey( _a234 );
while ( isDefined( _k234 ) )
{ {
struct = _a234[ _k234 ];
tarp = spawn( "script_model", struct.origin ); tarp = spawn( "script_model", struct.origin );
tarp.angles = struct.angles; tarp.angles = struct.angles;
tarp setmodel( "p6_zm_bu_buildable_bench_tarp" ); tarp setmodel( "p6_zm_bu_buildable_bench_tarp" );
@ -245,26 +211,21 @@ generatebuildabletarps()
tarp.script_location = struct.script_location; tarp.script_location = struct.script_location;
} }
level.buildable_tarps[ level.buildable_tarps.size ] = tarp; level.buildable_tarps[ level.buildable_tarps.size ] = tarp;
_k234 = getNextArrayKey( _a234, _k234 );
} }
} }
deletebuildabletarp( location ) deletebuildabletarp( location ) //checked changed to match cerberus output
{ {
_a252 = level.buildable_tarps; foreach ( tarp in level.buildable_tarps )
_k252 = getFirstArrayKey( _a252 );
while ( isDefined( _k252 ) )
{ {
tarp = _a252[ _k252 ];
if ( isDefined( tarp.script_location ) && tarp.script_location == location ) if ( isDefined( tarp.script_location ) && tarp.script_location == location )
{ {
tarp delete(); tarp delete();
} }
_k252 = getNextArrayKey( _a252, _k252 );
} }
} }
powerswitchstate( on ) powerswitchstate( on ) //checked matches cerberus output
{ {
trigger = getent( "use_elec_switch", "targetname" ); trigger = getent( "use_elec_switch", "targetname" );
if ( isDefined( trigger ) ) if ( isDefined( trigger ) )
@ -277,7 +238,7 @@ powerswitchstate( on )
master_switch notsolid(); master_switch notsolid();
if ( is_true( on ) ) if ( is_true( on ) )
{ {
master_switch rotateroll( -90, 0,3 ); master_switch rotateroll( -90, 0.3 );
flag_set( "power_on" ); flag_set( "power_on" );
} }
} }

View File

@ -1,6 +1,9 @@
#include maps/mp/gametypes_zm/_zm_gametype; #include maps/mp/gametypes_zm/_zm_gametype;
#include maps/mp/zombies/_zm_buildables; #include maps/mp/zombies/_zm_buildables;
#include maps/mp/zombies/_zm_magicbox; #include maps/mp/zombies/_zm_magicbox;
#include maps/mp/zombies/_zm_equip_subwoofer;
#include maps/mp/zombies/_zm_equip_springpad;
#include maps/mp/zombies/_zm_equip_turbine;
#include maps/mp/zm_buried_buildables; #include maps/mp/zm_buried_buildables;
#include maps/mp/zm_buried_gamemodes; #include maps/mp/zm_buried_gamemodes;
#include maps/mp/zombies/_zm_race_utility; #include maps/mp/zombies/_zm_race_utility;
@ -8,7 +11,7 @@
#include common_scripts/utility; #include common_scripts/utility;
#include maps/mp/_utility; #include maps/mp/_utility;
precache() precache() //checked matches cerberus output
{ {
precachemodel( "zm_collision_buried_street_grief" ); precachemodel( "zm_collision_buried_street_grief" );
precachemodel( "p6_zm_bu_buildable_bench_tarp" ); precachemodel( "p6_zm_bu_buildable_bench_tarp" );
@ -22,7 +25,7 @@ precache()
maps/mp/zombies/_zm_equip_subwoofer::init( &"ZM_BURIED_EQ_SW_PHS", &"ZM_BURIED_EQ_SW_HTS" ); maps/mp/zombies/_zm_equip_subwoofer::init( &"ZM_BURIED_EQ_SW_PHS", &"ZM_BURIED_EQ_SW_HTS" );
} }
street_treasure_chest_init() street_treasure_chest_init() //checked matches cerberus output
{ {
start_chest = getstruct( "start_chest", "script_noteworthy" ); start_chest = getstruct( "start_chest", "script_noteworthy" );
court_chest = getstruct( "courtroom_chest1", "script_noteworthy" ); court_chest = getstruct( "courtroom_chest1", "script_noteworthy" );
@ -39,7 +42,7 @@ street_treasure_chest_init()
maps/mp/zombies/_zm_magicbox::treasure_chest_init( "start_chest" ); maps/mp/zombies/_zm_magicbox::treasure_chest_init( "start_chest" );
} }
main() main() //checked matches cerberus output
{ {
level.buildables_built[ "pap" ] = 1; level.buildables_built[ "pap" ] = 1;
level.equipment_team_pick_up = 1; level.equipment_team_pick_up = 1;
@ -68,7 +71,7 @@ main()
turnperkon( "Pack_A_Punch" ); turnperkon( "Pack_A_Punch" );
} }
enemy_location_override( zombie, enemy ) enemy_location_override( zombie, enemy ) //checked matches cerberus output
{ {
location = enemy.origin; location = enemy.origin;
if ( isDefined( self.reroute ) && self.reroute ) if ( isDefined( self.reroute ) && self.reroute )
@ -81,7 +84,7 @@ enemy_location_override( zombie, enemy )
return location; return location;
} }
builddynamicwallbuys() builddynamicwallbuys() //checked matches cerberus output
{ {
builddynamicwallbuy( "bank", "beretta93r_zm" ); builddynamicwallbuy( "bank", "beretta93r_zm" );
builddynamicwallbuy( "bar", "pdw57_zm" ); builddynamicwallbuy( "bar", "pdw57_zm" );
@ -97,7 +100,7 @@ builddynamicwallbuys()
builddynamicwallbuy( "candyshop", "870mcs_zm" ); builddynamicwallbuy( "candyshop", "870mcs_zm" );
} }
buildbuildables() buildbuildables() //checked matches cerberus output
{ {
buildbuildable( "springpad_zm" ); buildbuildable( "springpad_zm" );
buildbuildable( "subwoofer_zm" ); buildbuildable( "subwoofer_zm" );

View File

@ -1,3 +1,4 @@
//checked includes changed to match cerberus output
#include maps/mp/zombies/_zm_score; #include maps/mp/zombies/_zm_score;
#include maps/mp/zombies/_zm_spawner; #include maps/mp/zombies/_zm_spawner;
#include maps/mp/zombies/_zm_powerups; #include maps/mp/zombies/_zm_powerups;
@ -8,6 +9,16 @@
#include maps/mp/zombies/_zm_buildables; #include maps/mp/zombies/_zm_buildables;
#include maps/mp/zombies/_zm_stats; #include maps/mp/zombies/_zm_stats;
#include maps/mp/gametypes_zm/_globallogic_score; #include maps/mp/gametypes_zm/_globallogic_score;
#include maps/mp/zm_buried_sq_ows;
#include maps/mp/zm_buried_sq_ip;
#include maps/mp/zm_buried_sq_tpo;
#include maps/mp/zm_buried_sq_ctw;
#include maps/mp/zm_buried_sq_ts;
#include maps/mp/zm_buried_sq_ll;
#include maps/mp/zm_buried_sq_ftl;
#include maps/mp/zm_buried_sq_gl;
#include maps/mp/zm_buried_sq_mta;
#include maps/mp/zm_buried_sq_bt;
#include maps/mp/_visionset_mgr; #include maps/mp/_visionset_mgr;
#include maps/mp/zombies/_zm_sidequests; #include maps/mp/zombies/_zm_sidequests;
#include maps/mp/zombies/_zm_utility; #include maps/mp/zombies/_zm_utility;
@ -17,7 +28,7 @@
#using_animtree( "fxanim_props" ); #using_animtree( "fxanim_props" );
#using_animtree( "fxanim_props_dlc3" ); #using_animtree( "fxanim_props_dlc3" );
init() init() //checked changed to match cerberus output
{ {
level thread sq_prestart_hide(); level thread sq_prestart_hide();
if ( !is_sidequest_allowed( "zclassic" ) ) if ( !is_sidequest_allowed( "zclassic" ) )
@ -28,13 +39,11 @@ init()
sq_buried_register_visionset(); sq_buried_register_visionset();
register_map_navcard( "navcard_held_zm_buried", "navcard_held_zm_highrise" ); register_map_navcard( "navcard_held_zm_buried", "navcard_held_zm_highrise" );
ss_buttons = getentarray( "sq_ss_button", "targetname" ); ss_buttons = getentarray( "sq_ss_button", "targetname" );
i = 0; for ( i = 0; i < ss_buttons.size; i++ )
while ( i < ss_buttons.size )
{ {
ss_buttons[ i ] usetriggerrequirelookat(); ss_buttons[ i ] usetriggerrequirelookat();
ss_buttons[ i ] sethintstring( "" ); ss_buttons[ i ] sethintstring( "" );
ss_buttons[ i ] setcursorhint( "HINT_NOICON" ); ss_buttons[ i ] setcursorhint( "HINT_NOICON" );
i++;
} }
flag_init( "sq_players_out_of_sync" ); flag_init( "sq_players_out_of_sync" );
flag_init( "sq_nav_built" ); flag_init( "sq_nav_built" );
@ -62,16 +71,18 @@ init()
level thread sq_metagame(); level thread sq_metagame();
onplayerconnect_callback( ::sq_metagame_on_player_connect ); onplayerconnect_callback( ::sq_metagame_on_player_connect );
precache_sidequest_assets(); precache_sidequest_assets();
/*
/# /#
level thread setup_sq_debug(); level thread setup_sq_debug();
#/ #/
*/
level thread end_game_reward_richtofen_wrapper(); level thread end_game_reward_richtofen_wrapper();
level thread end_game_reward_maxis_wrapper(); level thread end_game_reward_maxis_wrapper();
flag_wait( "start_zombie_round_logic" ); flag_wait( "start_zombie_round_logic" );
sidequest_start( "sq" ); sidequest_start( "sq" );
} }
precache_sq() precache_sq() //checked matches cerberus output
{ {
precachemodel( "p6_zm_bu_lantern_silver_on" ); precachemodel( "p6_zm_bu_lantern_silver_on" );
precachemodel( "p6_zm_bu_ether_amplifier" ); precachemodel( "p6_zm_bu_ether_amplifier" );
@ -99,11 +110,11 @@ precache_sq()
precachevehicle( "heli_quadrotor2_zm" ); precachevehicle( "heli_quadrotor2_zm" );
} }
sq_prestart_hide() sq_prestart_hide() //checked matches cerberus output
{ {
} }
sq_buried_clientfield_init() sq_buried_clientfield_init() //checked matches cerberus output
{ {
registerclientfield( "actor", "buried_sq_maxis_ending_update_eyeball_color", 12000, 1, "int" ); registerclientfield( "actor", "buried_sq_maxis_ending_update_eyeball_color", 12000, 1, "int" );
registerclientfield( "scriptmover", "AmplifierShaderConstant", 12000, 5, "float" ); registerclientfield( "scriptmover", "AmplifierShaderConstant", 12000, 5, "float" );
@ -145,23 +156,19 @@ sq_buried_clientfield_init()
registerclientfield( "world", "buried_sq_bp_light_09", 13000, 2, "int" ); registerclientfield( "world", "buried_sq_bp_light_09", 13000, 2, "int" );
} }
sq_buried_register_visionset() sq_buried_register_visionset() //checked matches cerberus output
{ {
vsmgr_register_info( "visionset", "cheat_bw", 12000, 17, 1, 1 ); vsmgr_register_info( "visionset", "cheat_bw", 12000, 17, 1, 1 );
} }
sq_easy_cleanup() sq_easy_cleanup() //checked changed to match cerberus output
{ {
computer_buildable_trig = getent( "sq_common_buildable_trigger", "targetname" ); computer_buildable_trig = getent( "sq_common_buildable_trigger", "targetname" );
computer_buildable_trig delete(); computer_buildable_trig delete();
sq_buildables = getentarray( "buildable_sq_common", "targetname" ); sq_buildables = getentarray( "buildable_sq_common", "targetname" );
_a194 = sq_buildables; foreach ( item in sq_buildables )
_k194 = getFirstArrayKey( _a194 );
while ( isDefined( _k194 ) )
{ {
item = _a194[ _k194 ];
item delete(); item delete();
_k194 = getNextArrayKey( _a194, _k194 );
} }
t_generator = getent( "generator_use_trigger", "targetname" ); t_generator = getent( "generator_use_trigger", "targetname" );
if ( isDefined( t_generator ) ) if ( isDefined( t_generator ) )
@ -169,18 +176,14 @@ sq_easy_cleanup()
t_generator delete(); t_generator delete();
} }
gallow_col = getentarray( "gallow_col", "targetname" ); gallow_col = getentarray( "gallow_col", "targetname" );
_a206 = gallow_col; foreach ( collmap in gallow_col )
_k206 = getFirstArrayKey( _a206 );
while ( isDefined( _k206 ) )
{ {
collmap = _a206[ _k206 ];
collmap connectpaths(); collmap connectpaths();
collmap delete(); collmap delete();
_k206 = getNextArrayKey( _a206, _k206 );
} }
} }
init_player_sidequest_stats() init_player_sidequest_stats() //checked matches cerberus output
{ {
self maps/mp/gametypes_zm/_globallogic_score::initpersstat( "sq_buried_started", 0 ); self maps/mp/gametypes_zm/_globallogic_score::initpersstat( "sq_buried_started", 0 );
self maps/mp/gametypes_zm/_globallogic_score::initpersstat( "navcard_held_zm_transit", 0 ); self maps/mp/gametypes_zm/_globallogic_score::initpersstat( "navcard_held_zm_transit", 0 );
@ -194,7 +197,7 @@ init_player_sidequest_stats()
self maps/mp/gametypes_zm/_globallogic_score::initpersstat( "sq_buried_last_completed", 0 ); self maps/mp/gametypes_zm/_globallogic_score::initpersstat( "sq_buried_last_completed", 0 );
} }
init_sidequest() init_sidequest() //checked partially changed to match cerberus output see compiler_limitations.md No. 2
{ {
sq_spawn_props(); sq_spawn_props();
players = get_players(); players = get_players();
@ -202,25 +205,18 @@ init_sidequest()
level.maxcompleted = 0; level.maxcompleted = 0;
level.richcompleted = 0; level.richcompleted = 0;
level.m_sq_start_sign = undefined; level.m_sq_start_sign = undefined;
_a245 = players; foreach ( player in players )
_k245 = getFirstArrayKey( _a245 );
while ( isDefined( _k245 ) )
{ {
player = _a245[ _k245 ];
player.buried_sq_started = 1; player.buried_sq_started = 1;
lastcompleted = player maps/mp/zombies/_zm_stats::get_global_stat( "sq_buried_last_completed" ); lastcompleted = player maps/mp/zombies/_zm_stats::get_global_stat( "sq_buried_last_completed" );
if ( lastcompleted == 1 ) if ( lastcompleted == 1 )
{ {
level.richcompleted = 1; level.richcompleted = 1;
} }
else else if ( lastcompleted == 2 )
{ {
if ( lastcompleted == 2 ) level.maxcompleted = 1;
{
level.maxcompleted = 1;
}
} }
_k245 = getNextArrayKey( _a245, _k245 );
} }
level waittill( "buildables_setup" ); level waittill( "buildables_setup" );
if ( level.richcompleted ) if ( level.richcompleted )
@ -251,29 +247,21 @@ init_sidequest()
} }
} }
sq_delete_tower_pieces( a_model_names, a_pieces ) sq_delete_tower_pieces( a_model_names, a_pieces ) //checked partially changed to match cerberus output see compiler_limitations.md No. 1
{ {
_a301 = a_pieces; foreach ( piece in a_pieces )
_k301 = getFirstArrayKey( _a301 );
while ( isDefined( _k301 ) )
{ {
piece = _a301[ _k301 ]; for ( i = 0; i < a_model_names.size; i++ )
_a303 = a_model_names;
_k303 = getFirstArrayKey( _a303 );
while ( isDefined( _k303 ) )
{ {
str_model = _a303[ _k303 ]; if ( piece.modelname == a_model_names[ i ] )
if ( piece.modelname == str_model )
{ {
piece maps/mp/zombies/_zm_buildables::piece_unspawn(); piece maps/mp/zombies/_zm_buildables::piece_unspawn();
} }
_k303 = getNextArrayKey( _a303, _k303 );
} }
_k301 = getNextArrayKey( _a301, _k301 );
} }
} }
sq_metagame_clear_tower_pieces() sq_metagame_clear_tower_pieces() //checked partially changed to match cerberus output see compiler_limitations.md No. 1 and No. 2
{ {
a_model_names = array( "p6_zm_bu_sq_crystal", "p6_zm_bu_sq_satellite_dish", "p6_zm_bu_sq_vaccume_tube", "p6_zm_bu_sq_buildable_battery", "p6_zm_bu_sq_antenna", "p6_zm_bu_sq_wire_spool" ); a_model_names = array( "p6_zm_bu_sq_crystal", "p6_zm_bu_sq_satellite_dish", "p6_zm_bu_sq_vaccume_tube", "p6_zm_bu_sq_buildable_battery", "p6_zm_bu_sq_antenna", "p6_zm_bu_sq_wire_spool" );
a_pieces = level.sq_rtower_buildable.buildablezone.pieces; a_pieces = level.sq_rtower_buildable.buildablezone.pieces;
@ -281,39 +269,31 @@ sq_metagame_clear_tower_pieces()
a_pieces = level.sq_mtower_buildable.buildablezone.pieces; a_pieces = level.sq_mtower_buildable.buildablezone.pieces;
sq_delete_tower_pieces( a_model_names, a_pieces ); sq_delete_tower_pieces( a_model_names, a_pieces );
players = get_players(); players = get_players();
_a327 = players; for ( i = 0; i < players.size; i++ )
_k327 = getFirstArrayKey( _a327 );
while ( isDefined( _k327 ) )
{ {
player = _a327[ _k327 ]; piece = players[ i ] maps/mp/zombies/_zm_buildables::player_get_buildable_piece( 2 );
piece = player maps/mp/zombies/_zm_buildables::player_get_buildable_piece( 2 );
if ( !isDefined( piece ) ) if ( !isDefined( piece ) )
{ {
} }
else else
{ {
_a335 = a_model_names; foreach ( str_model in a_model_names )
_k335 = getFirstArrayKey( _a335 );
while ( isDefined( _k335 ) )
{ {
str_model = _a335[ _k335 ];
if ( piece.modelname == str_model ) if ( piece.modelname == str_model )
{ {
player maps/mp/zombies/_zm_buildables::player_destroy_piece( piece ); players[ i ] maps/mp/zombies/_zm_buildables::player_destroy_piece( piece );
} }
_k335 = getNextArrayKey( _a335, _k335 );
} }
} }
_k327 = getNextArrayKey( _a327, _k327 );
} }
} }
sq_spawn_props() sq_spawn_props() //checked matches cerberus output
{ {
sq_spawn_model_at_struct( "sq_guillotine", "p6_zm_bu_guillotine" ); sq_spawn_model_at_struct( "sq_guillotine", "p6_zm_bu_guillotine" );
} }
sq_spawn_model_at_struct( str_struct, str_model ) sq_spawn_model_at_struct( str_struct, str_model ) //checked matches cerberus output
{ {
s_struct = getstruct( str_struct, "targetname" ); s_struct = getstruct( str_struct, "targetname" );
if ( !isDefined( s_struct ) ) if ( !isDefined( s_struct ) )
@ -327,15 +307,17 @@ sq_spawn_model_at_struct( str_struct, str_model )
return m_prop; return m_prop;
} }
generic_stage_start() generic_stage_start() //checked matches cerberus output
{ {
/*
/# /#
level thread cheat_complete_stage(); level thread cheat_complete_stage();
#/ #/
*/
level._stage_active = 1; level._stage_active = 1;
} }
cheat_complete_stage() cheat_complete_stage() //checked matches cerberus output
{ {
level endon( "reset_sundial" ); level endon( "reset_sundial" );
while ( 1 ) while ( 1 )
@ -348,14 +330,14 @@ cheat_complete_stage()
stage_completed( "sq", level._last_stage_started ); stage_completed( "sq", level._last_stage_started );
} }
} }
wait 0,1; wait 0.1;
} }
} }
sidequest_logic() sidequest_logic() //checked matches cerberus output
{ {
level thread watch_nav_computer_built(); level thread watch_nav_computer_built();
if ( isDefined( level.maxcompleted ) && level.maxcompleted && isDefined( level.richcompleted ) && level.richcompleted ) if ( is_true( level.maxcompleted ) && is_true( level.richcompleted ) )
{ {
flag_set( "sq_intro_vo_done" ); flag_set( "sq_intro_vo_done" );
return; return;
@ -390,7 +372,7 @@ sidequest_logic()
level thread maps/mp/zombies/_zm_audio::sndmusicstingerevent( "sidequest_7" ); level thread maps/mp/zombies/_zm_audio::sndmusicstingerevent( "sidequest_7" );
stage_start( "sq", "ows" ); stage_start( "sq", "ows" );
level waittill( "sq_ows_over" ); level waittill( "sq_ows_over" );
delay_thread( 0,75, ::snddelayedsidequest8 ); delay_thread( 0.75, ::snddelayedsidequest8 );
level notify( "buried_sidequest_achieved" ); level notify( "buried_sidequest_achieved" );
if ( flag( "sq_is_max_tower_built" ) ) if ( flag( "sq_is_max_tower_built" ) )
{ {
@ -412,22 +394,18 @@ sidequest_logic()
sq_metagame_reset_machine(); sq_metagame_reset_machine();
} }
playfx_on_tower( str_fx, delete_old ) playfx_on_tower( str_fx, delete_old ) //checked changed to match cerberus output
{ {
if ( !isDefined( delete_old ) ) if ( !isDefined( delete_old ) )
{ {
delete_old = 0; delete_old = 0;
} }
a_fx_spots = getentarray( "sq_complete_tower_fx", "targetname" ); a_fx_spots = getentarray( "sq_complete_tower_fx", "targetname" );
while ( delete_old ) if ( delete_old )
{ {
_a486 = a_fx_spots; foreach ( m_fx_spot in a_fx_spots )
_k486 = getFirstArrayKey( _a486 );
while ( isDefined( _k486 ) )
{ {
m_fx_spot = _a486[ _k486 ];
m_fx_spot delete(); m_fx_spot delete();
_k486 = getNextArrayKey( _a486, _k486 );
} }
} }
s_spot = getstruct( "sq_end_smoke", "targetname" ); s_spot = getstruct( "sq_end_smoke", "targetname" );
@ -445,25 +423,21 @@ playfx_on_tower( str_fx, delete_old )
} }
} }
snddelayedsidequest8() snddelayedsidequest8() //checked matches cerberus output
{ {
level thread maps/mp/zombies/_zm_audio::sndmusicstingerevent( "sidequest_8" ); level thread maps/mp/zombies/_zm_audio::sndmusicstingerevent( "sidequest_8" );
} }
sq_give_player_rewards() sq_give_player_rewards() //checked changed to match cerberus output
{ {
players = get_players(); players = get_players();
_a518 = players; foreach ( player in players )
_k518 = getFirstArrayKey( _a518 );
while ( isDefined( _k518 ) )
{ {
player = _a518[ _k518 ];
player thread sq_give_player_all_perks(); player thread sq_give_player_all_perks();
_k518 = getNextArrayKey( _a518, _k518 );
} }
} }
sq_give_player_all_perks() sq_give_player_all_perks() //checked partially changed to match cerberus output see compiler_limitations.md No. 2
{ {
machines = getentarray( "zombie_vending", "targetname" ); machines = getentarray( "zombie_vending", "targetname" );
perks = []; perks = [];
@ -475,17 +449,11 @@ sq_give_player_all_perks()
i++; i++;
continue; continue;
} }
else perks[ perks.size ] = machines[ i ].script_noteworthy;
{
perks[ perks.size ] = machines[ i ].script_noteworthy;
}
i++; i++;
} }
_a539 = perks; foreach ( perk in perks )
_k539 = getFirstArrayKey( _a539 );
while ( isDefined( _k539 ) )
{ {
perk = _a539[ _k539 ];
if ( isDefined( self.perk_purchased ) && self.perk_purchased == perk ) if ( isDefined( self.perk_purchased ) && self.perk_purchased == perk )
{ {
} }
@ -493,21 +461,19 @@ sq_give_player_all_perks()
{ {
if ( self hasperk( perk ) || self maps/mp/zombies/_zm_perks::has_perk_paused( perk ) ) if ( self hasperk( perk ) || self maps/mp/zombies/_zm_perks::has_perk_paused( perk ) )
{ {
break;
} }
else else
{ {
self maps/mp/zombies/_zm_perks::give_perk( perk, 0 ); self maps/mp/zombies/_zm_perks::give_perk( perk, 0 );
wait 0,25; wait 0.25;
} }
} }
_k539 = getNextArrayKey( _a539, _k539 );
} }
self._retain_perks = 1; self._retain_perks = 1;
self thread watch_for_respawn(); self thread watch_for_respawn();
} }
watch_for_respawn() watch_for_respawn() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
self waittill_either( "spawned_player", "player_revived" ); self waittill_either( "spawned_player", "player_revived" );
@ -516,14 +482,14 @@ watch_for_respawn()
self setmaxhealth( level.zombie_vars[ "zombie_perk_juggernaut_health" ] ); self setmaxhealth( level.zombie_vars[ "zombie_perk_juggernaut_health" ] );
} }
watch_nav_computer_built() watch_nav_computer_built() //checked matches cerberus output changed to use is_true instead
{ {
if ( isDefined( level.navcomputer_spawned ) && !level.navcomputer_spawned ) if ( !is_true( level.navcomputer_spawned ) )
{ {
wait_for_buildable( "sq_common" ); wait_for_buildable( "sq_common" );
} }
flag_set( "sq_nav_built" ); flag_set( "sq_nav_built" );
if ( isDefined( level.navcomputer_spawned ) && !level.navcomputer_spawned ) if ( !is_true( level.navcomputer_spawned ) )
{ {
update_sidequest_stats( "sq_buried_started" ); update_sidequest_stats( "sq_buried_started" );
} }

View File

@ -20,6 +20,9 @@ zm_buried_patch/maps/mp/zombies/_zm_weap_slowgun.gsc
``` ```
### The following scripts have been checked, but they have not been tested yet ### The following scripts have been checked, but they have not been tested yet
``` ```
zm_buried_patch/maps/mp/zm_buried_gamemodes.gsc
zm_buried_patch/maps/mp/zm_buried_grief_street.gsc
zm_buried_patch/maps/mp/zm_buried_sq.gsc
``` ```
### The following scripts are not checked yet, uploaded to setup a baseline: ### The following scripts are not checked yet, uploaded to setup a baseline:
@ -34,11 +37,8 @@ zm_buried_patch/maps/mp/zm_buried_ee.gsc
zm_buried_patch/maps/mp/zm_buried_ffotd.gsc zm_buried_patch/maps/mp/zm_buried_ffotd.gsc
zm_buried_patch/maps/mp/zm_buried_fountain.gsc zm_buried_patch/maps/mp/zm_buried_fountain.gsc
zm_buried_patch/maps/mp/zm_buried_fx.gsc zm_buried_patch/maps/mp/zm_buried_fx.gsc
zm_buried_patch/maps/mp/zm_buried_gamemodes.gsc
zm_buried_patch/maps/mp/zm_buried_grief_street.gsc
zm_buried_patch/maps/mp/zm_buried_jail.gsc zm_buried_patch/maps/mp/zm_buried_jail.gsc
zm_buried_patch/maps/mp/zm_buried_power.gsc zm_buried_patch/maps/mp/zm_buried_power.gsc
zm_buried_patch/maps/mp/zm_buried_sq.gsc
zm_buried_patch/maps/mp/zm_buried_sq_bt.gsc zm_buried_patch/maps/mp/zm_buried_sq_bt.gsc
zm_buried_patch/maps/mp/zm_buried_sq_ctw.gsc zm_buried_patch/maps/mp/zm_buried_sq_ctw.gsc
zm_buried_patch/maps/mp/zm_buried_sq_ftl.gsc zm_buried_patch/maps/mp/zm_buried_sq_ftl.gsc