From c0af13fe736617c0466db01ee26a9061bb82974e Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Wed, 12 Jan 2022 22:43:58 -0800 Subject: [PATCH] Diner: change player spawn points Add general code for setting team spawn to custom locations --- README.md | 23 ++++++++++++++--------- scripts/zm/locs/zm_transit_diner.gsc | 28 +++++++++++++++++++++------- scripts/zm/replaced/utility.gsc | 4 ++-- 3 files changed, 37 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 4a669fde..dfc1cc5e 100644 --- a/README.md +++ b/README.md @@ -257,11 +257,15 @@ * Fixed a zombie pathing exploit at Town in Bookstore * Grief: added Ballistic Knife, Ray Gun, and Ray Gun Mark 2 to the Mystery Box -#### Town -* Moved Quick Revive to Stamin-Up's location on Town -* Moved Stamin-Up to its location on Tranzit -* Moved Tombstone Soda to the laundry room front door -* Grief: added Tombstone Soda +#### Bus Depot +* Lava in starting area activates immediately +* Power doors open when door is opened +* Lava pit is accessible + +#### Diner +* Added Survival and Grief gamemodes +* Wallbuys: M14, Olympia, MP5, Galvaknuckles +* Perks: Juggernog, Quick Revive, Speed Cola, Double Tap #### Farm * Zombies spawn in the Farm zone when in the Barn zone @@ -269,10 +273,11 @@ * Survival: removed Galvaknuckles wallbuy * Grief: removed player spawns near gate -#### Bus Depot -* Lava in starting area activates immediately -* Power doors open when door is opened -* Lava pit is accessible +#### Town +* Moved Quick Revive to Stamin-Up's location on Town +* Moved Stamin-Up to its location on Tranzit +* Moved Tombstone Soda to the laundry room front door +* Grief: added Tombstone Soda ### Die Rise * Zombies no longer spawn in the Upper Blue Highrise zone when in the Trample Steam zone diff --git a/scripts/zm/locs/zm_transit_diner.gsc b/scripts/zm/locs/zm_transit_diner.gsc index b28deea5..3ce4654e 100644 --- a/scripts/zm/locs/zm_transit_diner.gsc +++ b/scripts/zm/locs/zm_transit_diner.gsc @@ -14,13 +14,27 @@ struct_init() scripts/zm/replaced/utility::register_perk_struct( "specialty_fastreload", "zombie_vending_sleight", ( -5470, -7859.5, 0 ), ( 0, 270, 0 ) ); scripts/zm/replaced/utility::register_perk_struct( "specialty_rof", "zombie_vending_doubletap2", ( -4170, -7592, -63 ), ( 0, 270, 0 ) ); - coordinates = array( ( -3991, -7317, -63 ), ( -4231, -7395, -60 ), ( -4127, -6757, -54 ), ( -4465, -7346, -58 ), - ( -5770, -6600, -55 ), ( -6135, -6671, -56 ), ( -6182, -7120, -60 ), ( -5882, -7174, -61 ) ); - angles = array( ( 0, 161, 0 ), ( 0, 120, 0 ), ( 0, 217, 0 ), ( 0, 173, 0 ), ( 0, -106, 0 ), ( 0, -46, 0 ), ( 0, 51, 0 ), ( 0, 99, 0 ) ); - for ( i = 0; i < coordinates.size; i++ ) - { - scripts/zm/replaced/utility::register_map_initial_spawnpoint( coordinates[ i ], angles[ i ] ); - } + ind = 0; + respawnpoints = maps/mp/gametypes_zm/_zm_gametype::get_player_spawns_for_gametype(); + for(i = 0; i < respawnpoints.size; i++) + { + if(respawnpoints[i].script_noteworthy == "zone_gas") + { + ind = i; + break; + } + } + + respawn_array = getstructarray(respawnpoints[ind].target, "targetname"); + foreach(respawn in respawn_array) + { + if(respawn.script_int == 2) + { + respawn.angles += (0, 180, 0); + } + + scripts/zm/replaced/utility::register_map_initial_spawnpoint( respawn.origin, respawn.angles, respawn.script_int ); + } gameObjects = getEntArray( "script_model", "classname" ); foreach ( object in gameObjects ) diff --git a/scripts/zm/replaced/utility.gsc b/scripts/zm/replaced/utility.gsc index 6f4caf7a..6612d722 100644 --- a/scripts/zm/replaced/utility.gsc +++ b/scripts/zm/replaced/utility.gsc @@ -144,7 +144,7 @@ register_perk_struct( name, model, origin, angles ) add_struct( perk_struct ); } -register_map_initial_spawnpoint( origin, angles ) +register_map_initial_spawnpoint( origin, angles, team_num ) { spawnpoint_struct = spawnStruct(); spawnpoint_struct.origin = origin; @@ -158,7 +158,7 @@ register_map_initial_spawnpoint( origin, angles ) } spawnpoint_struct.radius = 32; spawnpoint_struct.script_noteworthy = "initial_spawn"; - spawnpoint_struct.script_int = 2048; + spawnpoint_struct.script_int = team_num; spawnpoint_struct.script_string = getDvar( "g_gametype" ) + "_" + getDvar( "ui_zm_mapstartlocation" ); spawnpoint_struct.locked = 0; player_respawn_point_size = level.struct_class_names[ "targetname" ][ "player_respawn_point" ].size;