@@ -880,15 +880,29 @@ head_icon_origin_think()
880880
881881obj_waypoint()
882882{
883- self .obj_waypoint = [];
884- self .obj_waypoint = newClientHudElem(self );
885- self .obj_waypoint.alignx = " center" ;
886- self .obj_waypoint.aligny = " middle" ;
887- self .obj_waypoint.horzalign = " user_center" ;
888- self .obj_waypoint.vertalign = " user_center" ;
889- self .obj_waypoint.alpha = 0 ;
890- self .obj_waypoint.hidewheninmenu = 1 ;
891- self .obj_waypoint setWaypoint(1 , level .obj_waypoint_icon);
883+ if (level .scr_zm_ui_gametype_obj == " zcontainment" || level .scr_zm_ui_gametype_obj == " zmeat" )
884+ {
885+ self .obj_waypoint = newClientHudElem(self );
886+ self .obj_waypoint.alignx = " center" ;
887+ self .obj_waypoint.aligny = " middle" ;
888+ self .obj_waypoint.horzalign = " user_center" ;
889+ self .obj_waypoint.vertalign = " user_center" ;
890+ self .obj_waypoint.alpha = 0 ;
891+ self .obj_waypoint.hidewheninmenu = 1 ;
892+ }
893+
894+ if (level .scr_zm_ui_gametype_obj == " zcontainment" )
895+ {
896+ self .next_obj_waypoint = newClientHudElem(self );
897+ self .next_obj_waypoint.alignx = " center" ;
898+ self .next_obj_waypoint.aligny = " middle" ;
899+ self .next_obj_waypoint.horzalign = " user_center" ;
900+ self .next_obj_waypoint.vertalign = " user_center" ;
901+ self .next_obj_waypoint.color = (0.5 , 0.5 , 0.5 );
902+ self .next_obj_waypoint.archived = 0 ;
903+ self .next_obj_waypoint.alpha = 0 ;
904+ self .next_obj_waypoint.hidewheninmenu = 1 ;
905+ }
892906
893907 self thread obj_waypoint_destroy_on_end_game();
894908}
@@ -899,10 +913,15 @@ obj_waypoint_destroy_on_end_game()
899913
900914 level waittill (" end_game" );
901915
902- if (isDefined(self .obj_waypoint))
916+ if (isDefined(self .obj_waypoint))
903917 {
904918 self .obj_waypoint destroy();
905919 }
920+
921+ if (isDefined(self .next_obj_waypoint))
922+ {
923+ self .next_obj_waypoint destroy();
924+ }
906925}
907926
908927headstomp_watcher()
@@ -2458,6 +2477,16 @@ containment_think()
24582477 zone_display_name = scripts\zm\_zm_reimagined::get_zone_display_name(zone_name);
24592478 zone = level .zones[zone_name];
24602479
2480+ next_ind = ind + 1 ;
2481+
2482+ if (next_ind >= containment_zones.size )
2483+ {
2484+ next_ind = 0 ;
2485+ }
2486+
2487+ next_zone_name = containment_zones[next_ind];
2488+ next_zone = level .zones[next_zone_name];
2489+
24612490 zone_name_to_lock = zone_name;
24622491 if (zone_name == " zone_street_fountain" )
24632492 {
@@ -2477,13 +2506,16 @@ containment_think()
24772506 level .containment_zone_hud setText(zone_display_name);
24782507 level .containment_time_hud setTimer(60 );
24792508
2509+ zone_time = 60000 ;
2510+ next_obj_waypoint_time = 10000 ;
24802511 obj_time = 1000 ;
24812512 held_time = [];
24822513 held_time[" axis" ] = undefined ;
24832514 held_time[" allies" ] = undefined ;
24842515 held_prev = " none" ;
24852516 start_time = getTime();
2486- while ((getTime() - start_time) <= 60000 || containment_zones.size == 1 )
2517+
2518+ while ((getTime() - start_time) <= zone_time || containment_zones.size == 1 )
24872519 {
24882520 if (containment_zones.size > 1 )
24892521 {
@@ -2502,6 +2534,7 @@ containment_think()
25022534 in_containment_zone = [];
25032535 in_containment_zone[" axis" ] = [];
25042536 in_containment_zone[" allies" ] = [];
2537+ show_next_obj_waypoint = (getTime() - start_time) >= (zone_time - next_obj_waypoint_time);
25052538
25062539 foreach (player in players)
25072540 {
@@ -2518,20 +2551,7 @@ containment_think()
25182551 in_containment_zone[player.team][in_containment_zone[player.team].size ] = player;
25192552 }
25202553
2521- if (isads(player))
2522- {
2523- player.obj_waypoint fadeOverTime(0.25 );
2524- player.obj_waypoint.alpha = 0.25 ;
2525- }
2526- else
2527- {
2528- player.obj_waypoint.alpha = 1 ;
2529- }
2530-
2531- player.obj_waypoint.x = 0 ;
2532- player.obj_waypoint.y = 140 ;
2533- player.obj_waypoint.z = 0 ;
2534- player.obj_waypoint setShader(level .obj_waypoint_icon, getDvarInt(" waypointIconWidth" ), getDvarInt(" waypointIconHeight" ));
2554+ player containment_set_obj_waypoint_on_screen();
25352555 }
25362556 else
25372557 {
@@ -2542,81 +2562,24 @@ containment_think()
25422562 player.ignoreme = close_zombies.size == 0 ;
25432563 }
25442564
2545- player.obj_waypoint.alpha = 1 ;
2546-
2547- if (level .script == " zm_transit" && zone_name == " zone_far_ext" )
2548- {
2549- other_zone = level .zones[" zone_farm_house" ];
2550- other_zone2 = level .zones[" zone_brn" ];
2551- player.obj_waypoint.x = (other_zone.volumes[0 ].origin[0 ] + other_zone2.volumes[0 ].origin[0 ]) / 2 ;
2552- player.obj_waypoint.y = (other_zone.volumes[0 ].origin[1 ] + other_zone2.volumes[0 ].origin[1 ]) / 2 ;
2553- player.obj_waypoint.z = (other_zone.volumes[0 ].origin[2 ] + other_zone2.volumes[0 ].origin[2 ]) / 2 ;
2554- }
2555- else if (level .script == " zm_transit" && zone_name == " zone_trans_8" )
2556- {
2557- other_zone = level .zones[" zone_pow_warehouse" ];
2558- player.obj_waypoint.x = (zone.volumes[0 ].origin[0 ] + other_zone.volumes[0 ].origin[0 ]) / 2 ;
2559- player.obj_waypoint.y = (zone.volumes[0 ].origin[1 ] + other_zone.volumes[0 ].origin[1 ]) / 2 ;
2560- player.obj_waypoint.z = (zone.volumes[0 ].origin[2 ] + other_zone.volumes[0 ].origin[2 ]) / 2 ;
2565+ player containment_set_obj_waypoint_off_screen(zone_name, zone);
2566+ }
25612567
2562- player.obj_waypoint.x += 200 ;
2563- }
2564- else if (level .script == " zm_transit" && zone_name == " zone_town_west" )
2565- {
2566- other_zone = level .zones[" zone_town_barber" ];
2567- other_zone2 = level .zones[" zone_ban" ];
2568- player.obj_waypoint.x = (other_zone.volumes[0 ].origin[0 ] + other_zone2.volumes[0 ].origin[0 ]) / 2 ;
2569- player.obj_waypoint.y = (other_zone.volumes[0 ].origin[1 ] + other_zone2.volumes[0 ].origin[1 ]) / 2 ;
2570- player.obj_waypoint.z = (other_zone.volumes[0 ].origin[2 ] + other_zone2.volumes[0 ].origin[2 ]) / 2 ;
2571- }
2572- else if (level .script == " zm_buried" && zone_name == " zone_street_darkwest" )
2573- {
2574- other_zone = level .zones[" zone_gun_store" ];
2575- other_zone2 = level .zones[" zone_general_store" ];
2576- other_zone3 = level .zones[" zone_street_darkwest_nook" ];
2577- player.obj_waypoint.x = (other_zone.volumes[0 ].origin[0 ] + other_zone2.volumes[0 ].origin[0 ] + other_zone3.volumes[0 ].origin[0 ]) / 3 ;
2578- player.obj_waypoint.y = (other_zone.volumes[0 ].origin[1 ] + other_zone2.volumes[0 ].origin[1 ] + other_zone3.volumes[0 ].origin[1 ]) / 3 ;
2579- player.obj_waypoint.z = (other_zone.volumes[0 ].origin[2 ] + other_zone2.volumes[0 ].origin[2 ] + other_zone3.volumes[0 ].origin[2 ]) / 3 ;
2580- }
2581- else if (level .script == " zm_buried" && zone_name == " zone_street_darkeast" )
2568+ if (containment_zones.size > 1 && show_next_obj_waypoint)
2569+ {
2570+ player_zone_name = player get_current_zone();
2571+ if (isDefined(player_zone_name) && player_zone_name == next_zone_name)
25822572 {
2583- other_zone = level .zones[" zone_underground_bar" ];
2584- other_zone2 = level .zones[" zone_general_store" ];
2585- other_zone3 = level .zones[" zone_gun_store" ];
2586- other_zone4 = level .zones[" zone_toy_store" ];
2587- player.obj_waypoint.x = (other_zone.volumes[0 ].origin[0 ] + other_zone2.volumes[0 ].origin[0 ] + other_zone3.volumes[0 ].origin[0 ] + other_zone4.volumes[0 ].origin[0 ]) / 4 ;
2588- player.obj_waypoint.y = (other_zone.volumes[0 ].origin[1 ] + other_zone2.volumes[0 ].origin[1 ] + other_zone3.volumes[0 ].origin[1 ] + other_zone4.volumes[0 ].origin[1 ]) / 4 ;
2589- player.obj_waypoint.z = (other_zone.volumes[0 ].origin[2 ] + other_zone2.volumes[0 ].origin[2 ] + other_zone3.volumes[0 ].origin[2 ] + other_zone4.volumes[0 ].origin[2 ]) / 4 ;
2573+ player containment_set_obj_waypoint_on_screen(1 );
25902574 }
25912575 else
25922576 {
2593- player.obj_waypoint.x = zone.volumes[0 ].origin[0 ];
2594- player.obj_waypoint.y = zone.volumes[0 ].origin[1 ];
2595- player.obj_waypoint.z = zone.volumes[0 ].origin[2 ];
2596- }
2597-
2598- if (level .script == " zm_buried" && zone_name == " zone_maze" )
2599- {
2600- player.obj_waypoint.z += 200 ;
2601- }
2602- else if (level .script == " zm_prison" && zone_name == " zone_dock" )
2603- {
2604- player.obj_waypoint.z -= 100 ;
2577+ player containment_set_obj_waypoint_off_screen(next_zone_name, next_zone, 1 );
26052578 }
2606- else if (level .script == " zm_prison" && zone_name == " zone_dock_gondola" )
2607- {
2608- player.obj_waypoint.z += 200 ;
2609- }
2610- else if (level .script == " zm_prison" && zone_name == " zone_dock_puzzle" )
2611- {
2612- player.obj_waypoint.z -= 250 ;
2613- }
2614- else if (level .script == " zm_prison" && zone_name == " zone_studio" )
2615- {
2616- player.obj_waypoint.x += 400 ;
2617- }
2618-
2619- player.obj_waypoint setWaypoint(1 , level .obj_waypoint_icon);
2579+ }
2580+ else
2581+ {
2582+ player.next_obj_waypoint.alpha = 0 ;
26202583 }
26212584 }
26222585
@@ -2918,6 +2881,123 @@ containment_get_zones()
29182881 return containment_zones;
29192882}
29202883
2884+ containment_set_obj_waypoint_on_screen(next_obj = false )
2885+ {
2886+ hud = self .obj_waypoint;
2887+ if (next_obj)
2888+ {
2889+ hud = self .next_obj_waypoint;
2890+ }
2891+
2892+ if (isads(self ))
2893+ {
2894+ hud fadeOverTime(0.25 );
2895+ hud.alpha = 0.25 ;
2896+ }
2897+ else
2898+ {
2899+ hud.alpha = 1 ;
2900+ }
2901+
2902+ hud.x = 0 ;
2903+ hud.y = 140 ;
2904+ hud.z = 0 ;
2905+ hud setShader(level .obj_waypoint_icon, getDvarInt(" waypointIconWidth" ), getDvarInt(" waypointIconHeight" ));
2906+ }
2907+
2908+ containment_set_obj_waypoint_off_screen(zone_name, zone, next_obj = false )
2909+ {
2910+ hud = self .obj_waypoint;
2911+ if (next_obj)
2912+ {
2913+ hud = self .next_obj_waypoint;
2914+ }
2915+
2916+ hud.alpha = 1 ;
2917+
2918+ if (level .script == " zm_transit" && zone_name == " zone_far_ext" )
2919+ {
2920+ other_zone = level .zones[" zone_farm_house" ];
2921+ other_zone2 = level .zones[" zone_brn" ];
2922+ hud.x = (other_zone.volumes[0 ].origin[0 ] + other_zone2.volumes[0 ].origin[0 ]) / 2 ;
2923+ hud.y = (other_zone.volumes[0 ].origin[1 ] + other_zone2.volumes[0 ].origin[1 ]) / 2 ;
2924+ hud.z = (other_zone.volumes[0 ].origin[2 ] + other_zone2.volumes[0 ].origin[2 ]) / 2 ;
2925+ }
2926+ else if (level .script == " zm_transit" && zone_name == " zone_trans_8" )
2927+ {
2928+ other_zone = level .zones[" zone_pow_warehouse" ];
2929+ hud.x = (zone.volumes[0 ].origin[0 ] + other_zone.volumes[0 ].origin[0 ]) / 2 ;
2930+ hud.y = (zone.volumes[0 ].origin[1 ] + other_zone.volumes[0 ].origin[1 ]) / 2 ;
2931+ hud.z = (zone.volumes[0 ].origin[2 ] + other_zone.volumes[0 ].origin[2 ]) / 2 ;
2932+
2933+ hud.x += 200 ;
2934+ }
2935+ else if (level .script == " zm_transit" && zone_name == " zone_town_west" )
2936+ {
2937+ other_zone = level .zones[" zone_town_barber" ];
2938+ other_zone2 = level .zones[" zone_ban" ];
2939+ hud.x = (other_zone.volumes[0 ].origin[0 ] + other_zone2.volumes[0 ].origin[0 ]) / 2 ;
2940+ hud.y = (other_zone.volumes[0 ].origin[1 ] + other_zone2.volumes[0 ].origin[1 ]) / 2 ;
2941+ hud.z = (other_zone.volumes[0 ].origin[2 ] + other_zone2.volumes[0 ].origin[2 ]) / 2 ;
2942+ }
2943+ else if (level .script == " zm_buried" && zone_name == " zone_street_darkwest" )
2944+ {
2945+ other_zone = level .zones[" zone_gun_store" ];
2946+ other_zone2 = level .zones[" zone_general_store" ];
2947+ other_zone3 = level .zones[" zone_street_darkwest_nook" ];
2948+ hud.x = (other_zone.volumes[0 ].origin[0 ] + other_zone2.volumes[0 ].origin[0 ] + other_zone3.volumes[0 ].origin[0 ]) / 3 ;
2949+ hud.y = (other_zone.volumes[0 ].origin[1 ] + other_zone2.volumes[0 ].origin[1 ] + other_zone3.volumes[0 ].origin[1 ]) / 3 ;
2950+ hud.z = (other_zone.volumes[0 ].origin[2 ] + other_zone2.volumes[0 ].origin[2 ] + other_zone3.volumes[0 ].origin[2 ]) / 3 ;
2951+ }
2952+ else if (level .script == " zm_buried" && zone_name == " zone_street_darkeast" )
2953+ {
2954+ other_zone = level .zones[" zone_underground_bar" ];
2955+ other_zone2 = level .zones[" zone_general_store" ];
2956+ other_zone3 = level .zones[" zone_gun_store" ];
2957+ other_zone4 = level .zones[" zone_toy_store" ];
2958+ hud.x = (other_zone.volumes[0 ].origin[0 ] + other_zone2.volumes[0 ].origin[0 ] + other_zone3.volumes[0 ].origin[0 ] + other_zone4.volumes[0 ].origin[0 ]) / 4 ;
2959+ hud.y = (other_zone.volumes[0 ].origin[1 ] + other_zone2.volumes[0 ].origin[1 ] + other_zone3.volumes[0 ].origin[1 ] + other_zone4.volumes[0 ].origin[1 ]) / 4 ;
2960+ hud.z = (other_zone.volumes[0 ].origin[2 ] + other_zone2.volumes[0 ].origin[2 ] + other_zone3.volumes[0 ].origin[2 ] + other_zone4.volumes[0 ].origin[2 ]) / 4 ;
2961+ }
2962+ else
2963+ {
2964+ hud.x = zone.volumes[0 ].origin[0 ];
2965+ hud.y = zone.volumes[0 ].origin[1 ];
2966+ hud.z = zone.volumes[0 ].origin[2 ];
2967+ }
2968+
2969+ if (level .script == " zm_buried" && zone_name == " zone_maze" )
2970+ {
2971+ hud.z += 200 ;
2972+ }
2973+ else if (level .script == " zm_prison" && zone_name == " zone_dock" )
2974+ {
2975+ hud.z -= 100 ;
2976+ }
2977+ else if (level .script == " zm_prison" && zone_name == " zone_dock_gondola" )
2978+ {
2979+ hud.z += 200 ;
2980+ }
2981+ else if (level .script == " zm_prison" && zone_name == " zone_dock_puzzle" )
2982+ {
2983+ hud.z -= 250 ;
2984+ }
2985+ else if (level .script == " zm_prison" && zone_name == " zone_studio" )
2986+ {
2987+ hud.x += 400 ;
2988+ }
2989+
2990+ if (next_obj)
2991+ {
2992+ hud setShader(level .obj_waypoint_icon, 8 , 8 );
2993+ hud setWaypoint(1 );
2994+ }
2995+ else
2996+ {
2997+ hud setWaypoint(1 , level .obj_waypoint_icon);
2998+ }
2999+ }
3000+
29213001meat_init()
29223002{
29233003 level ._powerup_timeout_custom_time = ::meat_powerup_custom_time;
0 commit comments