From a6f763f3079bf155bbad8108b87137236fbcf0b8 Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Thu, 30 Mar 2023 02:24:08 -0700 Subject: [PATCH] Maxis Drone: buildable table model changes Maxis Drone: fix new script_model spawning everytime buildable table trigger is touched --- README.md | 4 +- scripts/zm/replaced/zm_tomb_craftables.gsc | 58 ++++++++++++++++++++++ scripts/zm/zm_tomb/zm_tomb_reimagined.gsc | 5 +- 3 files changed, 62 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index aaa25749..d534859d 100644 --- a/README.md +++ b/README.md @@ -409,6 +409,8 @@ ### Maxis Drone * Added hint strings for purchased, can only be one, and cooling down +* Buildable table model sits on top of the stand +* Rotated buildable table model 90 degrees * Switches back to correct weapon after deploying ## Bank @@ -546,7 +548,7 @@ * Moved Quick Revive to Speed Cola's location on Borough * Moved Speed Cola to its location on Buried * Moved Stamin-Up to Vulture Aid's location on Buried -* Buildables can spawn at Church bench +* Buildables can spawn at Church buildable table * Added better randomization for buildables #### Maze diff --git a/scripts/zm/replaced/zm_tomb_craftables.gsc b/scripts/zm/replaced/zm_tomb_craftables.gsc index 30b7006c..55b86bed 100644 --- a/scripts/zm/replaced/zm_tomb_craftables.gsc +++ b/scripts/zm/replaced/zm_tomb_craftables.gsc @@ -13,6 +13,44 @@ #include maps\mp\zombies\_zm_equipment; #include maps\mp\zm_tomb_craftables; +init_craftables() +{ + precachemodel( "p6_zm_tm_quadrotor_stand" ); + flag_init( "quadrotor_cooling_down" ); + level.craftable_piece_count = 4; + flag_init( "any_crystal_picked_up" ); + flag_init( "staff_air_zm_enabled" ); + flag_init( "staff_fire_zm_enabled" ); + flag_init( "staff_lightning_zm_enabled" ); + flag_init( "staff_water_zm_enabled" ); + register_clientfields(); + add_zombie_craftable( "equip_dieseldrone_zm", &"ZM_TOMB_CRQ", &"ZM_TOMB_CRQ", &"ZM_TOMB_TQ", ::onfullycrafted_quadrotor, 1 ); + add_zombie_craftable_vox_category( "equip_dieseldrone_zm", "build_dd" ); + make_zombie_craftable_open( "equip_dieseldrone_zm", "veh_t6_dlc_zm_quadrotor", ( 0, 0, 0 ), ( 0, -4, 10 ) ); + add_zombie_craftable( "tomb_shield_zm", &"ZM_TOMB_CRRI", undefined, &"ZOMBIE_BOUGHT_RIOT", undefined, 1 ); + add_zombie_craftable_vox_category( "tomb_shield_zm", "build_zs" ); + make_zombie_craftable_open( "tomb_shield_zm", "t6_wpn_zmb_shield_dlc4_dmg0_world", vectorscale( ( 0, -1, 0 ), 90.0 ), ( 0, 0, level.riotshield_placement_zoffset ) ); + add_zombie_craftable( "elemental_staff_fire", &"ZM_TOMB_CRF", &"ZM_TOMB_INS", &"ZM_TOMB_BOF", ::staff_fire_fullycrafted, 1 ); + add_zombie_craftable_vox_category( "elemental_staff_fire", "fire_staff" ); + add_zombie_craftable( "elemental_staff_air", &"ZM_TOMB_CRA", &"ZM_TOMB_INS", &"ZM_TOMB_BOA", ::staff_air_fullycrafted, 1 ); + add_zombie_craftable_vox_category( "elemental_staff_air", "air_staff" ); + add_zombie_craftable( "elemental_staff_lightning", &"ZM_TOMB_CRL", &"ZM_TOMB_INS", &"ZM_TOMB_BOL", ::staff_lightning_fullycrafted, 1 ); + add_zombie_craftable_vox_category( "elemental_staff_lightning", "light_staff" ); + add_zombie_craftable( "elemental_staff_water", &"ZM_TOMB_CRW", &"ZM_TOMB_INS", &"ZM_TOMB_BOW", ::staff_water_fullycrafted, 1 ); + add_zombie_craftable_vox_category( "elemental_staff_water", "ice_staff" ); + add_zombie_craftable( "gramophone", &"ZM_TOMB_CRAFT_GRAMOPHONE", &"ZM_TOMB_CRAFT_GRAMOPHONE", &"ZM_TOMB_BOUGHT_GRAMOPHONE", undefined, 0 ); + add_zombie_craftable_vox_category( "gramophone", "gramophone" ); + level.zombie_craftable_persistent_weapon = ::tomb_check_crafted_weapon_persistence; + level.custom_craftable_validation = ::tomb_custom_craftable_validation; + level.zombie_custom_equipment_setup = ::setup_quadrotor_purchase; + level thread hide_staff_model(); + level.quadrotor_status = spawnstruct(); + level.quadrotor_status.crafted = 0; + level.quadrotor_status.picked_up = 0; + level.num_staffpieces_picked_up = []; + level.n_staffs_crafted = 0; +} + include_craftables() { level thread run_craftables_devgui(); @@ -151,6 +189,26 @@ include_craftables() level thread craftable_add_glow_fx(); } +onfullycrafted_quadrotor( player ) +{ + if (is_true(level.quadrotor_status.crafted)) + { + return 1; + } + + level.quadrotor_status.crafted = 1; + pickup_trig = level.quadrotor_status.pickup_trig; + level.quadrotor_status.str_zone = maps\mp\zombies\_zm_zonemgr::get_zone_from_position( pickup_trig.origin, 1 ); + level.quadrotor_status.pickup_indicator = spawn( "script_model", pickup_trig.model.origin + vectorscale( ( 0, 0, -1 ), 10.0 ) ); + level.quadrotor_status.pickup_indicator.angles = pickup_trig.model.angles; + level.quadrotor_status.pickup_indicator setmodel( "p6_zm_tm_quadrotor_stand" ); + pickup_trig.model.origin += (0, 0, 6.5); + pickup_trig.model.angles += (0, -90, 0); + + level notify( "quest_progressed", player, 1 ); + return 1; +} + quadrotor_control_thread() { self endon( "bled_out" ); diff --git a/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc b/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc index 487e52e0..429b4813 100644 --- a/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc +++ b/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc @@ -36,8 +36,8 @@ main() replaceFunc(maps\mp\zm_tomb_ee_main_step_2::remove_plinth, scripts\zm\replaced\zm_tomb_ee_main_step_2::remove_plinth); replaceFunc(maps\mp\zm_tomb_ee_main_step_3::fire_link_cooldown, scripts\zm\replaced\zm_tomb_ee_main_step_3::fire_link_cooldown); replaceFunc(maps\mp\zm_tomb_challenges::challenges_init, scripts\zm\replaced\zm_tomb_challenges::challenges_init); + replaceFunc(maps\mp\zm_tomb_craftables::init_craftables, scripts\zm\replaced\zm_tomb_craftables::init_craftables); replaceFunc(maps\mp\zm_tomb_craftables::include_craftables, scripts\zm\replaced\zm_tomb_craftables::include_craftables); - replaceFunc(maps\mp\zm_tomb_craftables::quadrotor_control_thread, scripts\zm\replaced\zm_tomb_craftables::quadrotor_control_thread); replaceFunc(maps\mp\zm_tomb_dig::init_shovel, scripts\zm\replaced\zm_tomb_dig::init_shovel); replaceFunc(maps\mp\zm_tomb_dig::increment_player_perk_purchase_limit, scripts\zm\replaced\zm_tomb_dig::increment_player_perk_purchase_limit); replaceFunc(maps\mp\zm_tomb_tank::players_on_tank_update, scripts\zm\replaced\zm_tomb_tank::players_on_tank_update); @@ -59,9 +59,6 @@ init() level.zombie_init_done = ::zombie_init_done; level.special_weapon_magicbox_check = ::tomb_special_weapon_magicbox_check; level.custom_magic_box_timer_til_despawn = ::custom_magic_box_timer_til_despawn; - level.zombie_craftable_persistent_weapon = scripts\zm\replaced\zm_tomb_craftables::tomb_check_crafted_weapon_persistence; - level.custom_craftable_validation = scripts\zm\replaced\zm_tomb_craftables::tomb_custom_craftable_validation; - level.zombie_custom_equipment_setup = scripts\zm\replaced\zm_tomb_craftables::setup_quadrotor_purchase; change_stargate_teleport_return_player_angles();