From b50a5ba78e80c7c39857dc8d860aed76a233250d Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Sat, 30 Dec 2023 19:05:33 -0800 Subject: [PATCH] Containment and Meat: remove most HUD messages Meat: add dropped the meat obituary message Meat: optimize meat obituary messages --- english/localizedstrings/reimagined.str | 6 ++ scripts/zm/replaced/zgrief.gsc | 86 +++++++++++-------------- scripts/zm/replaced/zmeat.gsc | 8 --- scripts/zm/zgrief/zgrief_reimagined.gsc | 34 ---------- 4 files changed, 42 insertions(+), 92 deletions(-) diff --git a/english/localizedstrings/reimagined.str b/english/localizedstrings/reimagined.str index a756c322..dc1c6189 100644 --- a/english/localizedstrings/reimagined.str +++ b/english/localizedstrings/reimagined.str @@ -213,6 +213,12 @@ LANG_ENGLISH "^8&&1 grabbed the meat" REFERENCE ZOMBIE_GRABBED_MEAT_ENEMY LANG_ENGLISH "^9&&1 grabbed the meat" +REFERENCE ZOMBIE_DROPPED_MEAT +LANG_ENGLISH "^8&&1 dropped the meat" + +REFERENCE ZOMBIE_DROPPED_MEAT_ENEMY +LANG_ENGLISH "^9&&1 dropped the meat" + REFERENCE ZOMBIE_HAS_MEAT LANG_ENGLISH "^8&&1 has the meat stink" diff --git a/scripts/zm/replaced/zgrief.gsc b/scripts/zm/replaced/zgrief.gsc index 7729db12..cab42b57 100644 --- a/scripts/zm/replaced/zgrief.gsc +++ b/scripts/zm/replaced/zgrief.gsc @@ -123,6 +123,13 @@ meat_bounce_override(pos, normal, ent, bounce) { self hide(); + players = get_players(); + + foreach (player in players) + { + player thread print_meat_msg(self.owner, "dropped"); + } + if (level.scr_zm_ui_gametype_obj == "zmeat") { level.meat_powerup = maps\mp\zombies\_zm_powerups::specific_powerup_drop("meat_stink", pos); @@ -140,7 +147,7 @@ meat_bounce_override(pos, normal, ent, bounce) self delete(); } -meat_stink(who) +meat_stink(who, owner) { if (who hasWeapon(level.item_meat_name)) { @@ -149,19 +156,22 @@ meat_stink(who) if (!is_player_valid(who)) { + if (isDefined(owner)) + { + players = get_players(); + + foreach (player in players) + { + player thread print_meat_msg(owner, "dropped"); + } + } + if (level.scr_zm_ui_gametype_obj == "zmeat") { valid_drop = scripts\zm\replaced\_zm_utility::check_point_in_life_brush(who.origin) || (check_point_in_enabled_zone(who.origin) && !scripts\zm\replaced\_zm_utility::check_point_in_kill_brush(who.origin)); if (valid_drop) { - players = get_players(); - - foreach (player in players) - { - player thread scripts\zm\zgrief\zgrief_reimagined::show_grief_hud_msg(&"ZOMBIE_MEAT_DROPPED"); - } - level.meat_powerup = maps\mp\zombies\_zm_powerups::specific_powerup_drop("meat_stink", who.origin); } else @@ -206,22 +216,6 @@ meat_stink(who) } player thread print_meat_msg(who, "grabbed"); - - if (level.scr_zm_ui_gametype_obj == "zmeat") - { - if (player == who) - { - player thread scripts\zm\zgrief\zgrief_reimagined::show_grief_hud_msg(&"ZOMBIE_PLAYER_HAS_MEAT"); - } - else if (player.team == who.team) - { - player thread scripts\zm\zgrief\zgrief_reimagined::show_grief_hud_msg(&"ZOMBIE_YOUR_TEAM_MEAT"); - } - else - { - player thread scripts\zm\zgrief\zgrief_reimagined::show_grief_hud_msg(&"ZOMBIE_OTHER_TEAM_MEAT"); - } - } } who thread meat_stink_ignoreme_think(0); @@ -374,11 +368,9 @@ meat_stink_cleanup_on_downed() if (valid_drop) { - players = get_players(); - foreach (player in players) { - player thread scripts\zm\zgrief\zgrief_reimagined::show_grief_hud_msg(&"ZOMBIE_MEAT_DROPPED"); + player thread print_meat_msg(self, "dropped", 1); } level.meat_powerup = maps\mp\zombies\_zm_powerups::specific_powerup_drop("meat_stink", self.origin); @@ -439,7 +431,7 @@ meat_stink_player(who, owner) if (level.scr_zm_ui_gametype_obj == "zmeat") { - level thread meat_stink(who); + level thread meat_stink(who, owner); return; } @@ -515,40 +507,34 @@ meat_stink_player_create() self setclientfieldtoplayer("meat_stink", 1); } -print_meat_msg(meat_player, verb) +print_meat_msg(meat_player, verb, show_after_obituaries = 0) { self endon("disconnect"); meat_player endon("disconnect"); - if (verb == "grabbed" || verb == "has") + while (is_true(self.printing_meat_msg)) { - wait 0.05; // must wait to show after any obituaries that happened on the same frame + self waittill("meat_msg_printed"); } - hint_string = ""; + self.printing_meat_msg = 1; - if (self.team == meat_player.team) + if (show_after_obituaries) { - if (verb == "grabbed") - { - hint_string = &"ZOMBIE_GRABBED_MEAT"; - } - else if (verb == "has") - { - hint_string = &"ZOMBIE_HAS_MEAT"; - } + wait 0.05; } - else + + meat = "_MEAT"; + + if (self.team != meat_player.team) { - if (verb == "grabbed") - { - hint_string = &"ZOMBIE_GRABBED_MEAT_ENEMY"; - } - else if (verb == "has") - { - hint_string = &"ZOMBIE_HAS_MEAT_ENEMY"; - } + meat = "_MEAT_ENEMY"; } + hint_string = istring(toupper("ZOMBIE_" + verb + meat)); + self iprintln(hint_string, meat_player.name); + + self.printing_meat_msg = undefined; + self notify("meat_msg_printed"); } \ No newline at end of file diff --git a/scripts/zm/replaced/zmeat.gsc b/scripts/zm/replaced/zmeat.gsc index 489cec18..52651f40 100644 --- a/scripts/zm/replaced/zmeat.gsc +++ b/scripts/zm/replaced/zmeat.gsc @@ -72,14 +72,6 @@ item_meat_on_spawn_retrieve_trigger(watcher, player, weaponname) { other_player.ignoreme = 0; } - - if (level.scr_zm_ui_gametype_obj == "zmeat") - { - if (!is_true(player._kicking_meat)) - { - other_player thread scripts\zm\zgrief\zgrief_reimagined::show_grief_hud_msg(&"ZOMBIE_MEAT_THROWN"); - } - } } if (!(isdefined(self._fake_meat) && self._fake_meat)) diff --git a/scripts/zm/zgrief/zgrief_reimagined.gsc b/scripts/zm/zgrief/zgrief_reimagined.gsc index 53a91410..ef42118a 100644 --- a/scripts/zm/zgrief/zgrief_reimagined.gsc +++ b/scripts/zm/zgrief/zgrief_reimagined.gsc @@ -2663,11 +2663,6 @@ containment_think() held_time["axis"] = getTime(); held_time["allies"] = getTime(); held_prev = "cont"; - - foreach (player in players) - { - player thread show_grief_hud_msg(&"ZOMBIE_CONTAINMENT_ZONE_CONTESTED"); - } } if ((level.grief_score["A"] + 1) >= get_gamemode_winning_score() || (level.grief_score["B"] + 1) >= get_gamemode_winning_score()) @@ -2705,18 +2700,6 @@ containment_think() held_time["allies"] = undefined; held_prev = "axis"; - - foreach (player in players) - { - if (player.team == "axis") - { - player thread show_grief_hud_msg(&"ZOMBIE_YOUR_TEAM_CONTAINMENT_ZONE"); - } - else - { - player thread show_grief_hud_msg(&"ZOMBIE_OTHER_TEAM_CONTAINMENT_ZONE"); - } - } } } else if (in_containment_zone["allies"].size > in_containment_zone["axis"].size) @@ -2748,18 +2731,6 @@ containment_think() held_time["axis"] = undefined; held_prev = "allies"; - - foreach (player in players) - { - if (player.team == "axis") - { - player thread show_grief_hud_msg(&"ZOMBIE_OTHER_TEAM_CONTAINMENT_ZONE"); - } - else - { - player thread show_grief_hud_msg(&"ZOMBIE_YOUR_TEAM_CONTAINMENT_ZONE"); - } - } } } else @@ -2785,11 +2756,6 @@ containment_think() held_time["axis"] = undefined; held_time["allies"] = undefined; held_prev = "none"; - - foreach (player in players) - { - player thread show_grief_hud_msg(&"ZOMBIE_CONTAINMENT_ZONE_UNCONTROLLED"); - } } }