Add fixed core HUD and shared service window for T5 and T6

This commit is contained in:
2026-10-14 15:55:22 -04:00
parent d15bc50b7d
commit 929bf0354b
18 changed files with 1973 additions and 804 deletions
+58 -27
View File
@@ -1,7 +1,7 @@
# T6 port notes
T6 is ported from T5. Both source trees contain common, HUD, AFK, join, lock,
telemetry and leaderboard modules; neither includes bank or database modules.
telemetry, leaderboard and bank modules; neither includes direct-database modules.
## Differences retained for T6 and requested fixes
@@ -9,7 +9,7 @@ telemetry and leaderboard modules; neither includes bank or database modules.
| --- | --- | --- |
| Paths | `maps/mp/_utility`, `scripts/zm/tws_t6_common` | T6 namespaces and requested filenames |
| Loading | No T5 `zombiemode` dvar gate; each module has `main()` and `init()` | Zombies-only folder loading; avoid r5346 missing-main warnings |
| HUD positioning | Fullscreen screen anchors, same 10-unit margin | Requested fix for inset HUD |
| HUD positioning | Fullscreen upper-right anchors, fixed core and service-window geometry | Keep clear of top-edge overlays and stock scores/ammo without moving the core for services |
| HUD rendering | Precached white shader, local max-health fallback, floating-point ratio, `getPlayers()` | T6 rendering/state handling without changing player max health |
| Enemy count | Stock `_zm_utility::get_current_zombie_count()` plus queued zombies | Uses the map's zombie team and enemy filters |
| Timers | Seed elapsed time for late joiners; stop round watcher/reset on game over | T6 timer behavior; keep frozen timers frozen |
@@ -17,7 +17,7 @@ telemetry and leaderboard modules; neither includes bank or database modules.
| Telemetry | Global `httpPost(url, options)`; T5-parity queue + heartbeat + game_start/end + watchdog + log-level dvar; per-player `guid` comes from the persistent `player.guid` field (T5 uses `player getGuid()` directly); per-match `kills`/`headshots`/`downs`/`revives` read from `player.pers[]`, with missing or negative values reported as `0` | Stock T6 connection initialization populates `.guid` before notifying `connected`; stock `initpersstat` / `incpersstat` maintain match counters in `player.pers[]`, whereas T5 uses `player.stats[]`. Payload keys match T5 for downstream shape parity |
| Join | Port of T5 `tws_t5_join.gsc`; uses `level.spawnplayer` / `level.custom_spawnplayer` (lowercase) and `maps\mp\zombies\_zm::spectator_respawn`; readiness gated on `self.sessionstate == "spectator"` instead of T5's `self.initialized` | T6 stock spectator respawn hook lives in `_zm.gsc`; `self.initialized` is a T5 SP zombiemode marker that T6 stock does not populate the same way |
Common retains the T5 HUD constants, helpers and first-spawn dispatcher.
Common provides matching T5/T6 HUD layout constants, helpers and first-spawn dispatcher.
HUD again owns the `hud_game_over` notification fan-out. Lock again waits on HUD
notifications, applies T5's random password, and clears it on startup/game over.
The added password-preservation dvars and independent lock watcher are gone.
@@ -26,11 +26,30 @@ Common also listens for `.help` through the native `say` notification, independe
of first-spawn initialization so newcomers can view commands while spectating.
Each loaded command module registers its command and description with
`register_help_command()` during `init()`. Lazy registry initialization preserves
registrations regardless of module initialization order. Help uses client HUD
elements below the health bar, sharing the HUD's anchors to avoid overlap with
timers, zombie count and health numbers. Text is created once per connection and
reused; each request restarts a 12-second visibility timer. Disconnect cleanup
is independent of that timer. The command handlers retain their existing listeners.
registrations regardless of module initialization order. Common owns one reusable
service window beneath the fixed core. Help uses four commands per page in stable
order, with 12 seconds per page and automatic dismissal after the final page.
`.help` / `.commands` restart at page one. Help pauses record page time, and a
`.leaders` request during help replaces the pending replay from page one. Service
state prevents old requests from closing newer displays. Disconnect and game-end
cleanup are independent of page timing. The command handlers retain their
existing listeners, and help/records work without the HUD module.
Help reuses two multiline text columns and a muted command-column backdrop.
The service has 19 nonarchived elements independent of command/page count;
core + AFK use 15 + 1 archived elements. Hidden elements still occupy slots.
The [T6 player HUD structure](https://github.com/skiff/t6-gsc-helper/blob/50ff6cb7397c9376894a195f48118d1743812d1d/src/game/structs.hpp#L184)
has 31 slots in each bucket; it does not establish current Plutonium stock HUD
usage. Keep the live overlap/element-budget checks alongside the portable checks.
The core is created on connection for waiting spectators with placeholders, while
timer updates retain the existing spawn/round lifecycle. Connection-time creation
must not seed the match clock. Current/maximum HP remains visible at full health;
the former co-op name row is removed and AFK uses a reserved footer. Opening a
service never changes core position or height. HUD `1.2.0`, leaderboard `1.1.0`
and AFK `1.0.1` require matching common `1.2.0+`; deploy the changed scripts
together and restart the map. This introduces no native-plugin/backend dependency
or full server-process restart requirement.
AFK again listens to the native `say` notification, so it no longer needs plugin
chat registration. The additional T6 controls are only held while AFK; `.back`
@@ -49,7 +68,7 @@ The module is `tws_t6_leaderboard.gsc` in T6 and `tws_t5_leaderboard.gsc` in T5.
Common's existing
connection listener now also dispatches optional connection handlers after a
one-frame yield. Leaderboard waits for player readiness and uses a level-owned
HTTP cache, independent of the first-playable-spawn handlers. T6 spectators keep
HTTP cache, independent of the first-spawn handlers. T6 spectators keep
`hasSpawned` false, so T6 readiness uses session state and the intro-screen flag;
T5 sets `hasSpawned` for both playable and spectator spawns.
@@ -60,9 +79,10 @@ Mode/location combinations follow the
and Electric Cherry's map catalogue. Unknown selections require an explicit API
key instead of falling back to another variant sharing the engine map.
Validation for this change: 135 fixture/static checks pass using the actual
data-handling functions from both scripts with JavaScript engine-value shims.
All seven T6 scripts compile and assemble using a local Intel macOS driver built
Historical validation for the initial leaderboard change: 135 fixture/static
checks passed using the actual data-handling functions from both scripts with
JavaScript engine-value shims. All seven then-current T6 scripts compiled and
assembled using a local Intel macOS driver built
from gsc-tool 1.5.1 sources. PowerShell was unavailable, so `check.ps1` itself was
not executed here. T5 compilation and live plugin/gameplay checks were not run;
gsc-tool has no T5 backend. The production API could not be reached from this
@@ -137,15 +157,17 @@ wait for a normal round-start spawn, die, and verify `.join` is rejected.
Also check a round-1 participant, reconnecting, disconnect during setup, and
game over. Repeat on another T6 map; compile with the checker below first.
Local: `tools/check.ps1` compiles all seven files for T6 PC and checks shared
references and entry points. It requires PowerShell and gsc-tool. The `.help`
change passed the static entry-point/reference checks, but compilation and live
gameplay were not run. Compiler success does not certify runtime linking.
Local: `tools/check.ps1` compiles all eight files for T6 PC and checks shared
references and entry points. It requires PowerShell and gsc-tool. Run the
[shared HUD checks](../../README.md#hud-validation) for core/service behavior and
command regressions. Compiler success does not certify runtime linking.
Live checks after deploying:
1. Join, late-join, die/respawn, and reconnect: one HUD per player, correct corner
position, health/Juggernog changes, zombies remaining, timers frozen at game over.
1. Join, late-join, die/respawn, and reconnect: one core per player, fixed
upper-right position, spectator placeholders without an early clock start,
visible full/damaged HP, health/Juggernog changes, zombies remaining, and
timers frozen at game over. Test safe-area settings and different resolutions.
2. `.afk` blocks movement, shooting and grenades; `.back` restores them. Try rapid
toggles, a round transition, death/respawn and game over.
3. Lock fires at the threshold and clears on game over/restart. HUD must be installed.
@@ -153,12 +175,21 @@ Live checks after deploying:
4. Telemetry sends the initial occupied round and each new round to the existing
endpoint. Check server ID/player count, same-round joins and an unreachable API.
5. Repeat on the actual server maps, especially afterlife and special-enemy rounds.
6. Type `.help` and `.HELP` before first spawn, during play and while AFK: see
`.help`, `.afk`, `.back` and `.join` with descriptions, only on the requesting
player's screen below the health bar. Take damage so health numbers appear
and verify they do not overlap help. Repeat the command before 12 seconds
elapse: one list should remain visible until 12 seconds after the latest
request. Reopen after expiry and reconnect; verify no duplicates or leftovers.
Remove the AFK or Join module, restart the map and confirm its commands are
absent. Restore the modules and confirm `.afk`, `.back` and `.join` still
behave as before.
6. Type `.help`, `.HELP` and `.commands` before first spawn, during play and
while AFK: four commands per page, only on the requesting player's screen,
without moving or resizing the core. Verify 12 seconds per page and dismissal
after the final page; repeat on page two to restart page one. Remove optional
modules and restart the map to confirm their commands are absent. Restore
the modules and confirm their command behavior is unchanged.
7. Interrupt a record with help and check that its remaining page time resumes.
Repeat `.leaders` during help; only the latest replay should start from page
one after help closes. Check long names across pages, no records and
unavailable records. Reopen after expiry, disconnect/reconnect and end the
game during a service; verify no duplicates or leftovers. Repeat without HUD.
The stock T6 [HUD initialization](https://raw.githubusercontent.com/plutoniummod/t6-scripts/main/ZM/Core/maps/mp/gametypes_zm/_hud.gsc)
sets a nominal font height of 12; the corresponding
[font helper](https://raw.githubusercontent.com/plutoniummod/t6-scripts/main/ZM/Core/maps/mp/gametypes_zm/_hud_util.gsc)
uses `int(level.fontheight * fontscale)` for its height. The portable HUD checks
use that nominal box to prevent holder-row and AFK-footer overlaps. Exact glyph
extents and multiline spacing still need live validation, especially on T5.
+39 -18
View File
@@ -7,19 +7,20 @@ private server token.
| File | Role | Dependencies |
| --- | --- | --- |
| `tws_t6_common.gsc` | Shared HUD values, helpers, `.help`, connection and first-spawn dispatchers | Stock T6 |
| `tws_t6_hud.gsc` | Top-left Discord URL, match/round timers, name, zombie count and health bar | Common |
| `tws_t6_afk.gsc` | `.afk` / `.back`, protection, movement and weapon blocking | Common |
| `tws_t6_common.gsc` | Shared HUD values, helpers, paginated `.help`, service window, connection and first-spawn dispatchers | Stock T6 |
| `tws_t6_hud.gsc` | Fixed upper-right core: branding, timers, zombie count, current/maximum HP and health bar | Common 1.2.0+ |
| `tws_t6_afk.gsc` | `.afk` / `.back`, protection, movement and weapon blocking | Common 1.2.0+ |
| `tws_t6_lock.gsc` | Lock at round 20; clear password on game over | Common, HUD |
| `tws_t6_telemetry.gsc` | Async queued game reports (game_start/heartbeat/round_change/game_end) | tws-t6-gsc-utils |
| `tws_t6_join.gsc` | `.join` chat command lets a spectator newcomer enter mid-match once | Common |
| `tws_t6_leaderboard.gsc` | Private map high-round record and every tied holder on connection | Common, tws-t6-gsc-utils |
| `tws_t6_leaderboard.gsc` | Private map high-round record and every tied holder on connection | Common 1.2.0+, tws-t6-gsc-utils |
| `tws_t6_bank.gsc` | Persistent shared GUID bank | Common, telemetry, TWS plugin 1.2.0 |
## Install
1. Copy all eight `tws_t6_*.gsc` files into
`Plutonium/storage/t6/scripts/zm/`. Update common along with leaderboard.
`Plutonium/storage/t6/scripts/zm/`. Update common along with HUD, leaderboard
and AFK when those modules are installed.
2. For telemetry, leaderboard or bank, install the [tws-t6-gsc-utils build](../plugins/README.md), based on upstream v3.1.1,
in `Plutonium/plugins/` and restart the server process. The other five scripts
do not require that plugin.
@@ -67,14 +68,24 @@ changing points. Stock T6
populates that field before the `connected` notification. Follow the shared
[identity and deployment checks](../../README.md#bank-identity-validation).
## Persistent Discord text
## Core HUD and service window
The HUD shows `https://discord.tws.lol` in small muted-gray text
at the top-left, including for newcomers waiting in spectator mode. The label
is created once per connection and persists across death and respawn. The
gameplay HUD starts one line lower, keeping timers, help and records clear.
Install HUD `1.1.2` with common `1.1.0` or later, then restart the map; no plugin
update or full server-process restart is required.
The fixed upper-right core shows `TWS ZOMBIES`, `discord.tws.lol`, side-by-side
match/round timers, zombie count, current/maximum HP and a full-width health bar.
HP stays visible at full health. A reserved footer holds the AFK indicator;
there is no co-op name row. The core is created once per connection, including
for spectator newcomers with placeholders until values are available. Creation
does not seed the match clock. It persists across death and respawn.
Clocks, health and zombie-count displays freeze at game over. Health fallbacks
only affect the display and never modify gameplay max health.
Common provides one fixed-height service window beneath the core for help or
records. Services never move or resize the core. They remain private and work
without the HUD module installed. See the [shared layout and validation guide](../../README.md#core-hud-and-service-window-t5-and-t6).
Install HUD `1.2.0`, leaderboard `1.1.0` and AFK `1.0.1` with common `1.2.0+`.
Update the installed scripts together and restart the map; this change requires
no new plugin/backend dependency or full server-process restart.
## Map record announcements
@@ -99,8 +110,10 @@ apply to both versions. All T6 script filenames use the `tws_t6_` prefix.
Type `.help` or `.commands` in chat to see the commands supplied by the loaded TWS modules and
a short description of each. The list is shown only to the requesting player,
including spectators who have not spawned. Commands are case-insensitive.
Help appears below the health bar for 12 seconds, clear of the timers, zombie
counter and health display. Typing either command again restarts that display time.
Help uses the service window below the core. It shows four commands per page,
advances automatically every 12 seconds and closes after the last page. The
panel retains its height on short pages. Typing either command again returns to
page one with a fresh timer.
| Command | Description |
| --- | --- |
@@ -109,20 +122,25 @@ counter and health display. Typing either command again restarts that display ti
| `.back` | Return from AFK |
| `.join` | Join mid-round (newcomers only) |
| `.leaders` | Show the map record again (leaderboard module required) |
| `.b` | Check bank balance (bank module required) |
| `.d <amount\|all>` | Deposit points (bank module required) |
| `.w <amount\|all>` | Withdraw points (bank module required) |
AFK and Join register their commands during `init()` through
`tws_t6_common::register_help_command(command, description)`. If a module is
omitted, its commands are omitted from `.help`. Register new commands alongside
their module's initialization so the list stays current.
omitted, its commands are omitted from `.help`. Commands follow the order above,
independent of initialization order. Register new commands alongside their
module's initialization so the list stays current.
The enabled leaderboard module registers `.leaders`, which replays the latest
cached map record privately. Repeating it restarts the record from the first page;
help temporarily hides the record until its own display ends.
help pauses the record's remaining page time and resumes it after the final
help page. `.leaders` during help replaces the pending record replay from page one.
## Defaults, matching T5
- HUD values live in `tws_t6_common::common_config()`. That function and
`ensure_config()` came from T5; they initialize in-script values and do not
load a config file. The requested fullscreen corner alignment is retained.
load a config file. Core and service panels use fullscreen upper-right anchors.
- AFK uses T5's native `level waittill("say", message, player)` listener.
`.back` restores movement and weapons immediately, then ends protection after
two seconds. The T6 control/weapon fix remains in place.
@@ -211,6 +229,9 @@ another mod installed one first.
## Validation
Run the shared [portable and live HUD checks](../../README.md#hud-validation)
for core placement, service pagination, record interruptions and command regressions.
To compile all eight scripts for T6 PC with gsc-tool:
```powershell
+3 -3
View File
@@ -48,9 +48,9 @@ afk_spawn()
self.hud_afk_on = false;
self.tws_afk_protected = false;
self.tws_afk_controls_locked = false;
elem = scripts\zm\tws_t6_common::make_text_elem(self,
level.hud_x + 42, level.hud_row_match, "left",
level.hud_font_small, level.hud_c_afk);
elem = scripts\zm\tws_t6_common::make_panel_text(self,
level.hud_pad, level.hud_row_afk, "left",
level.hud_font_afk, level.hud_c_afk);
elem SetText("[AFK]");
elem.alpha = 0;
self.hud_afk_elem = elem;
+404 -68
View File
@@ -13,6 +13,9 @@ init()
common_config();
register_help_command(".help", "List available commands");
level thread service_game_over_via("end_game");
level thread service_game_over_via("game_ended");
level thread service_game_over_via("intermission");
level thread help_chat_listener();
level thread on_player_connect_dispatch();
}
@@ -22,41 +25,50 @@ common_config()
if (isDefined(level.hud_x))
return;
// Fullscreen coordinates; reserve the top line for the Discord URL.
// Existing generic helpers retain their screen-anchor conventions. Panels
// use their own right-edge origin and never push stock HUD areas around.
level.hud_x = 10;
level.hud_y = 30;
level.hud_row_match = level.hud_y;
level.hud_row_round = level.hud_y + 15;
level.hud_row_name = level.hud_y + 32;
level.hud_row_count = level.hud_y + 54;
level.hud_row_bar = level.hud_y + 84;
level.hud_font_small = 1.4;
level.hud_font_large = 2.0;
level.hud_font_mid = 1.6;
level.hud_bar_width = 120;
level.hud_bar_height = 8;
level.hud_col_count = level.hud_x + 90;
level.hud_col_name = level.hud_x + 60;
level.hud_col_health = level.hud_x + level.hud_bar_width + 12;
level.hud_rate = 0.1;
// green/amber/red ramp is health-only
level.hud_c_label = (0.85, 0.85, 0.85);
level.hud_c_dim = (0.55, 0.55, 0.55);
level.hud_c_count = (1, 1, 1);
level.hud_c_name = (0.4, 0.9, 0.5);
level.hud_c_high = (0.2, 1, 0.4);
level.hud_c_mid = (1, 0.8, 0);
level.hud_c_low = (1, 0.2, 0.2);
level.hud_c_afk = (1, 0.8, 0.2);
// numbers fade in below this fraction of max hp
// Retain the legacy fields for consumers of the original common config.
// The panel renderers below use dedicated row/column offsets instead.
level.hud_row_match = level.hud_y;
level.hud_row_round = level.hud_y + 15;
level.hud_row_name = level.hud_y + 32;
level.hud_row_count = level.hud_y + 54;
level.hud_col_count = level.hud_x + 90;
level.hud_col_name = level.hud_x + 60;
level.hud_col_health = level.hud_x + 120 + 12;
level.hud_health_threshold = 1.0;
level.hud_panel_right = 10;
level.hud_panel_top = 42;
level.hud_panel_width = 220;
level.hud_core_height = 100;
level.hud_service_y = 108;
level.hud_service_height = 124;
level.hud_pad = 10;
level.hud_row_header = 10;
level.hud_row_timers = 34;
level.hud_row_stats = 59;
level.hud_row_bar = 80;
level.hud_row_afk = 86;
level.hud_font_small = 1.1;
level.hud_font_large = 1.6;
level.hud_font_mid = 1.25;
level.hud_font_afk = 1.0;
level.hud_bar_width = 200;
level.hud_bar_height = 4;
level.hud_rate = 0.1;
level.hud_c_panel = (0.07, 0.10, 0.08);
level.hud_panel_alpha = 0.72;
level.hud_c_label = (0.72, 0.77, 0.74);
level.hud_c_dim = (0.65, 0.70, 0.67);
level.hud_c_count = (0.93, 0.96, 0.94);
level.hud_c_name = (0.65, 0.85, 0.70);
level.hud_c_high = (0.65, 0.85, 0.70);
level.hud_c_mid = (1, 0.8, 0);
level.hud_c_low = (1, 0.2, 0.2);
level.hud_c_afk = (1, 0.8, 0.2);
if (!isDefined(level.tws_spawn_handlers))
level.tws_spawn_handlers = [];
@@ -112,58 +124,356 @@ help_chat_listener()
}
}
// A single per-player controller owns service priority, pages and expiry.
show_help()
{
// Cache the text per connection; repeated SetText calls consume config strings.
if (!isDefined(self.tws_help_elems))
{
elems = [];
// Use the same anchors as the HUD, with room below the health numbers.
y = level.hud_row_bar + level.hud_bar_height + 20;
title = make_text_elem(self, level.hud_x, y,
"left", level.hud_font_mid, level.hud_c_afk);
title SetText("Commands");
elems[elems.size] = title;
if (isDefined(level.tws_service_ended))
return;
self service_ensure();
state = self.tws_service;
service_advance(state, getTime());
state.generation++;
state.help = service_request("help", service_page_count(state.commands.size, 4), state.generation);
service_render(state);
}
// An undefined snapshot is the explicit unavailable view for manual requests.
show_record(snapshot)
{
if (isDefined(level.tws_service_ended))
return;
self service_ensure();
state = self.tws_service;
service_advance(state, getTime());
count = 0;
if (isDefined(snapshot))
count = snapshot.lines.size;
state.generation++;
state.record = service_request("record", service_page_count(count, 3), state.generation);
state.record.snapshot = snapshot;
service_render(state);
}
service_page_count(count, rows)
{
return int((max(count, 1) + rows - 1) / rows);
}
service_request(kind, pages, generation)
{
request = spawnStruct();
request.kind = kind;
request.generation = generation;
request.page = 0;
request.pages = pages;
request.remaining = 12000;
return request;
}
service_current(state)
{
if (isDefined(state.help))
return state.help;
return state.record;
}
service_advance(state, now)
{
elapsed = max(0, now - state.updated_at);
state.updated_at = now;
request = service_current(state);
if (!isDefined(request) || state.closed)
return;
// Only the visible request consumes time. Help leaves the record untouched.
request.remaining -= elapsed;
if (request.remaining > 0)
return;
request.page++;
request.remaining = 12000;
if (request.page >= request.pages)
{
if (request.kind == "help")
state.help = undefined;
else
state.record = undefined;
}
}
// Stable order is independent of module initialization order; absent commands
// stay absent. Unknown future commands follow the built-in ones in registry order.
help_rank(command)
{
if (command == ".help") return 0;
if (command == ".afk") return 1;
if (command == ".back") return 2;
if (command == ".join") return 3;
if (command == ".leaders") return 4;
if (command == ".b") return 5;
if (command.size >= 3 && getSubStr(command, 0, 3) == ".d ") return 6;
if (command.size >= 3 && getSubStr(command, 0, 3) == ".w ") return 7;
return 8;
}
help_entries()
{
entries = [];
if (!isDefined(level.tws_help_commands))
return entries;
for (rank = 0; rank <= 8; rank++)
{
for (i = 0; i < level.tws_help_commands.size; i++)
{
entry = level.tws_help_commands[i];
elem = make_text_elem(self, level.hud_x, y + 22 + i * 18,
"left", level.hud_font_small, level.hud_c_count);
elem SetText("^3" + entry.command + "^7 - " + entry.description);
elems[elems.size] = elem;
if (help_rank(entry.command) == rank)
entries[entries.size] = entry;
}
self.tws_help_elems = elems;
self thread destroy_on_disconnect(elems);
}
for (i = 0; i < self.tws_help_elems.size; i++)
{
elem = self.tws_help_elems[i];
elem.alpha = 1;
}
// Only the expiry timer is replaced; the say listener and cleanup stay alive.
self notify("tws_help_refresh");
self thread hide_help_after_delay();
return entries;
}
hide_help_after_delay()
help_command_label(command)
{
rank = help_rank(command);
if (rank == 6) return ".d <n|all>";
if (rank == 7) return ".w <n|all>";
return command;
}
help_description(entry)
{
rank = help_rank(entry.command);
if (rank == 0) return "Show commands";
if (rank == 1) return "Enable protection";
if (rank == 2) return "Return to play";
if (rank == 3) return "Join as newcomer";
if (rank == 4) return "View records";
if (rank == 5) return "Check balance";
if (rank == 6) return "Deposit points";
if (rank == 7) return "Withdraw points";
return entry.description;
}
service_ensure()
{
if (isDefined(self.tws_service))
return;
ensure_config();
state = spawnStruct();
state.elems = [];
state.commands = help_entries();
state.help = undefined;
state.record = undefined;
state.closed = false;
state.updated_at = getTime();
state.rendered = false;
state.generation = 0;
state.last_generation = 0;
state.last_page = -1;
state.record_text = [];
state.help_page = -1;
state.rows = [];
self.tws_service = state;
y = level.hud_service_y;
state.background = make_panel_shader(self, 0, y, level.hud_panel_width,
level.hud_service_height, level.hud_c_panel, level.hud_panel_alpha, 0);
state.elems[state.elems.size] = state.background;
state.help_title = service_text(self, state, 10, 10, "left", 1.1, "COMMANDS", level.hud_c_label);
state.record_title = service_text(self, state, 10, 10, "left", 1.1, "MAP RECORD", level.hud_c_label);
state.help_footer = service_text(self, state, 10, 108, "left", 0.9,
"Four commands per page", level.hud_c_dim);
state.record_footer = service_text(self, state, 10, 108, "left", 0.9,
"Briefly shown - .leaders to view again", level.hud_c_dim);
state.page_number = service_text(self, state, 178, 10, "right", 1.1, "", level.hud_c_dim);
state.page_slash = service_text(self, state, 184, 10, "center", 1.1, "/", level.hud_c_dim);
state.page_total = service_text(self, state, 210, 10, "right", 1.1, "", level.hud_c_dim);
// Two fixed text columns keep the HUD element budget independent of the
// command count. Strings change only at page boundaries, never per tick.
state.command_back = make_panel_shader(self, 10, y + 30, 65, 68,
(0.16, 0.19, 0.17), 0.9, 5);
state.elems[state.elems.size] = state.command_back;
state.command_column = service_text(self, state, 14, 31,
"left", 1.0, "", level.hud_c_name);
state.description_column = service_text(self, state, 81, 31,
"left", 1.0, "", level.hud_c_count);
state.round_label = service_text(self, state, 10, 32, "left", 1.1, "ROUND", level.hud_c_label);
state.round_number = service_text(self, state, 54, 27, "left", 1.9, "", level.hud_c_count);
state.holders_label = service_text(self, state, 10, 52, "left", 1.0, "RECORD HOLDERS", level.hud_c_label);
for (i = 0; i < 3; i++)
state.rows[i] = service_text(self, state, 10, 65 + i * 13,
"left", 1.1, "", level.hud_c_count);
state.empty = service_text(self, state, 10, 40, "left", 1.1,
"No recorded high round yet", level.hud_c_count);
state.unavailable = service_text(self, state, 10, 40, "left", 1.1,
"Map record unavailable", level.hud_c_count);
for (i = 0; i < state.elems.size; i++)
{
state.elems[i].alpha = 0;
// Keep temporary private services out of the archived HUD bucket.
// Hidden elements still occupy slots; do not allocate one per page.
state.elems[i].archived = false;
}
self thread service_loop(state);
self thread service_disconnect(state);
self thread service_end_game(state);
}
service_text(player, state, x, y, align, scale, text, colour)
{
elem = make_panel_text(player, x, level.hud_service_y + y, align, scale, colour);
elem.alpha = 0;
if (text != "")
elem SetText(text);
state.elems[state.elems.size] = elem;
return elem;
}
service_render(state)
{
if (state.closed)
return;
request = service_current(state);
page = -1;
generation = 0;
if (isDefined(request))
{
page = request.page;
generation = request.generation;
}
if (state.rendered && state.last_generation == generation && state.last_page == page)
return;
state.rendered = true;
state.last_generation = generation;
state.last_page = page;
for (i = 0; i < state.elems.size; i++)
state.elems[i].alpha = 0;
if (!isDefined(request))
return;
state.background.alpha = level.hud_panel_alpha;
state.page_number SetValue(page + 1);
state.page_total SetValue(request.pages);
state.page_number.alpha = 1;
state.page_slash.alpha = 1;
state.page_total.alpha = 1;
if (request.kind == "help")
{
state.help_title.alpha = 1;
state.help_footer.alpha = 1;
if (state.help_page != page)
{
command_text = "";
description_text = "";
for (i = 0; i < 4; i++)
{
index = page * 4 + i;
if (index < state.commands.size)
{
if (i > 0)
{
command_text += "\n";
description_text += "\n";
}
entry = state.commands[index];
command_text += help_command_label(entry.command);
description_text += help_description(entry);
}
}
state.command_column SetText(command_text);
state.description_column SetText(description_text);
state.help_page = page;
}
state.command_back.alpha = 0.9;
state.command_column.alpha = 1;
state.description_column.alpha = 1;
return;
}
state.record_title.alpha = 1;
state.record_footer.alpha = 1;
snapshot = request.snapshot;
if (!isDefined(snapshot))
{
state.unavailable.alpha = 1;
return;
}
if (snapshot.round == 0)
{
state.empty.alpha = 1;
return;
}
state.round_label.alpha = 1;
state.round_number SetValue(snapshot.round);
state.round_number.alpha = 1;
state.holders_label.alpha = 1;
for (i = 0; i < 3; i++)
{
index = page * 3 + i;
if (index < snapshot.lines.size)
{
text = snapshot.lines[index];
// Skip identical text when replaying a page or resuming after help.
if (!isDefined(state.record_text[i]) || state.record_text[i] != text)
{
state.rows[i] SetText(text);
state.record_text[i] = text;
}
state.rows[i].alpha = 1;
}
}
}
service_loop(state)
{
self endon("disconnect");
self endon("tws_help_refresh");
wait 12;
for (i = 0; i < self.tws_help_elems.size; i++)
level endon("tws_service_game_over");
for (;;)
{
elem = self.tws_help_elems[i];
elem.alpha = 0;
service_advance(state, getTime());
service_render(state);
wait 0.1;
}
}
// Shared dispatcher: one HUD instance and account load per connection.
service_disconnect(state)
{
self waittill("disconnect");
service_destroy(state);
}
service_end_game(state)
{
self endon("disconnect");
level waittill("tws_service_game_over");
service_destroy(state);
}
service_destroy(state)
{
if (state.closed)
return;
state.closed = true;
state.help = undefined;
state.record = undefined;
for (i = 0; i < state.elems.size; i++)
{
if (isDefined(state.elems[i]))
state.elems[i] Destroy();
}
state.elems = [];
}
service_game_over_via(event)
{
level endon("tws_service_game_over");
level waittill(event);
level.tws_service_ended = true;
level notify("tws_service_game_over");
}
// The only connected listener; modules use the shared registries.
on_player_connect_dispatch()
{
for (;;)
@@ -240,6 +550,32 @@ make_shader_elem(player, x, y)
return elem;
}
// Panel x/y are local to the fixed upper-right core origin. A right screen
// anchor keeps the panel on-screen across aspect ratios; negative offsets grow
// left from that edge. Keep each engine's existing vertical anchor convention.
make_panel_text(player, x, y, align_x, scale, colour)
{
elem = make_text_elem(player, x - level.hud_panel_width - level.hud_panel_right,
level.hud_panel_top + y, align_x, scale, colour);
elem.horzAlign = "right";
elem.sort = 20;
elem.archived = true;
return elem;
}
make_panel_shader(player, x, y, width, height, colour, alpha, sort)
{
elem = make_shader_elem(player, x - level.hud_panel_width - level.hud_panel_right,
level.hud_panel_top + y);
elem.horzAlign = "right";
elem.color = colour;
elem.alpha = alpha;
elem.sort = sort;
elem.archived = true;
elem SetShader("white", width, height);
return elem;
}
destroy_on_disconnect(elems)
{
self waittill("disconnect");
+99 -158
View File
@@ -1,4 +1,4 @@
/* tws_t6_hud.gsc - top-left Discord URL, timers, zombie count and health bar. */
/* tws_t6_hud.gsc - fixed upper-right core HUD, visible from connection. */
#include maps\mp\_utility;
#include common_scripts\utility;
@@ -15,36 +15,90 @@ init()
level thread round_watcher();
level thread game_over_watcher();
scripts\zm\tws_t6_common::register_connect_handler(::hud_connect);
scripts\zm\tws_t6_common::register_spawn_handler(::hud_start);
scripts\zm\tws_t6_common::register_connect_handler(::hud_discord);
}
// One static label per connection, including newcomers waiting to spawn.
hud_discord()
// Connection construction never seeds clocks or reads player gameplay state.
// The first-spawn fallback also handles a spawn before the connect callback.
hud_connect()
{
self endon("disconnect");
label = scripts\zm\tws_t6_common::make_text_elem(
self, 10, 10, "left", 1.2, (0.65, 0.65, 0.65));
label SetText("https://discord.tws.lol");
if (isDefined(self.tws_hud_elems))
return;
elems = [];
elems[elems.size] = label;
self thread scripts\zm\tws_t6_common::destroy_on_disconnect(elems);
self.tws_hud_elems = [];
background = scripts\zm\tws_t6_common::make_panel_shader(
self, 0, 0, level.hud_panel_width, level.hud_core_height,
level.hud_c_panel, level.hud_panel_alpha, 0);
self.tws_hud_elems[self.tws_hud_elems.size] = background;
self hud_text(level.hud_pad, level.hud_row_header, "left",
level.hud_font_small, level.hud_c_name, "TWS ZOMBIES");
self hud_text(level.hud_panel_width - level.hud_pad, level.hud_row_header,
"right", level.hud_font_small, level.hud_c_dim, "discord.tws.lol");
self hud_text(level.hud_pad, level.hud_row_timers, "left",
level.hud_font_small, level.hud_c_label, "MATCH");
self.tws_hud_match = self hud_text(104, level.hud_row_timers - 2, "right",
level.hud_font_mid, level.hud_c_count, "--:--");
self hud_text(114, level.hud_row_timers, "left",
level.hud_font_small, level.hud_c_label, "ROUND");
self.tws_hud_round = self hud_text(level.hud_panel_width - level.hud_pad,
level.hud_row_timers - 2, "right",
level.hud_font_mid, level.hud_c_count, "--:--");
self hud_text(level.hud_pad, level.hud_row_stats, "left",
level.hud_font_small, level.hud_c_label, "ZOMBIES");
self.tws_hud_count = self hud_text(67, level.hud_row_stats, "left",
level.hud_font_mid, level.hud_c_count, "--");
self hud_text(132, level.hud_row_stats, "left",
level.hud_font_small, level.hud_c_label, "HP");
// Independent numeric elements avoid a new config string on every tick.
self.tws_hud_health = self hud_text(174, level.hud_row_stats, "right",
level.hud_font_mid, level.hud_c_count, "--");
self.tws_hud_slash = self hud_text(181, level.hud_row_stats, "center",
level.hud_font_mid, level.hud_c_count, "/");
self.tws_hud_maxhealth = self hud_text(level.hud_panel_width - level.hud_pad,
level.hud_row_stats, "right", level.hud_font_mid, level.hud_c_count, "--");
track = scripts\zm\tws_t6_common::make_panel_shader(
self, level.hud_pad, level.hud_row_bar,
level.hud_bar_width, level.hud_bar_height, (0.18, 0.22, 0.19), 0.8, 10);
self.tws_hud_elems[self.tws_hud_elems.size] = track;
self.tws_hud_bar = scripts\zm\tws_t6_common::make_panel_shader(
self, level.hud_pad, level.hud_row_bar,
level.hud_bar_width, level.hud_bar_height, level.hud_c_high, 0, 11);
self.tws_hud_elems[self.tws_hud_elems.size] = self.tws_hud_bar;
self thread scripts\zm\tws_t6_common::destroy_on_disconnect(self.tws_hud_elems);
}
hud_text(x, y, align, scale, colour, text)
{
elem = scripts\zm\tws_t6_common::make_panel_text(self, x, y, align, scale, colour);
elem SetText(text);
self.tws_hud_elems[self.tws_hud_elems.size] = elem;
return elem;
}
hud_start()
{
self endon("disconnect");
if (isDefined(level.tws_ended) && level.tws_ended)
self hud_connect();
if (isDefined(self.tws_hud_bound) || is_true(level.tws_ended))
return;
self.tws_hud_bound = true;
self thread hud_timer_row();
self thread hud_zombie_counter();
self thread hud_health_display();
}
// Same game-over notification fan-out as T5.
// Race the map-dependent game-over notifications once at level scope.
game_over_watcher()
{
level thread game_over_via("end_game");
@@ -60,7 +114,7 @@ game_over_via(notify_name)
level notify("hud_game_over");
}
// Poll stock round state; the first player spawn seeds pre-set round 1.
// Pre-set round 1 is seeded on first spawn; only observed transitions seed here.
round_watcher()
{
level endon("hud_game_over");
@@ -93,7 +147,7 @@ hud_timer_row()
{
self endon("disconnect");
// fallback seed for the round-1-already-active case (round_watcher misses it)
// A visible panel for a waiting newcomer must not start a pre-set round 1.
if (!isDefined(level.match_start_time) &&
isDefined(level.round_number) &&
level.round_number >= 1)
@@ -103,58 +157,14 @@ hud_timer_row()
level notify("hud_match_started");
}
match = scripts\zm\tws_t6_common::make_text_elem(
self, level.hud_x, level.hud_row_match,
"left", level.hud_font_small, level.hud_c_dim);
match.alpha = 0; // revealed by match_timer_bind when round 1 opens
round = scripts\zm\tws_t6_common::make_text_elem(
self, level.hud_x, level.hud_row_round,
"left", level.hud_font_small, level.hud_c_dim);
round = self.tws_hud_round;
round SetTimerUp(0);
if (isDefined(level.round_start_time))
round SetTimerUp(max(0, (getTime() - level.round_start_time) / 1000.0));
// name only shows in co-op — your own name is noise in solo
name = scripts\zm\tws_t6_common::make_text_elem(
self, level.hud_x, level.hud_row_name,
"left", level.hud_font_small, level.hud_c_name);
if (isDefined(self.name))
name SetText(self.name);
else
name SetText(self.playername);
name.alpha = 0;
elems = [];
elems[elems.size] = match;
elems[elems.size] = round;
elems[elems.size] = name;
self thread scripts\zm\tws_t6_common::destroy_on_disconnect(elems);
self thread reset_timer_each_round(round);
self thread match_timer_bind(match);
self thread freeze_timers_on_game_over(match, round);
coop = -1;
for (;;)
{
is_coop = 0;
players = getPlayers();
if (players.size > 1)
is_coop = 1;
if (is_coop != coop)
{
name.alpha = is_coop;
coop = is_coop;
}
wait (1);
}
self thread match_timer_bind(self.tws_hud_match);
self thread freeze_timers_on_game_over(self.tws_hud_match, round);
}
reset_timer_each_round(timer)
@@ -171,26 +181,20 @@ reset_timer_each_round(timer)
}
}
// T6 timer seed includes elapsed time for late joiners.
// T6 accepts elapsed seconds, including time before a late joiner's spawn.
match_timer_bind(elem)
{
self endon("disconnect");
level endon("hud_game_over");
if (!isDefined(level.match_start_time))
level waittill("hud_match_started");
if (isDefined(elem))
{
elem SetTimerUp(max(0, (getTime() - level.match_start_time) / 1000.0));
elem.alpha = 1;
}
}
/*
Level-scope trigger only — per-player death/health polling is intercepted
by the zombiemode scripts. Freeze value math relies on the timers being
anchored at first spawn / first round transition, not level init.
*/
// The panel remains visible at game over, with authoritative frozen clocks.
freeze_timers_on_game_over(match_elem, round_elem)
{
self endon("disconnect");
@@ -206,22 +210,9 @@ freeze_timers_on_game_over(match_elem, round_elem)
hud_zombie_counter()
{
self endon("disconnect");
level endon("hud_game_over");
label = scripts\zm\tws_t6_common::make_text_elem(
self, level.hud_x, level.hud_row_count,
"left", level.hud_font_large, level.hud_c_label);
label SetText("Zombies");
count = scripts\zm\tws_t6_common::make_text_elem(
self, level.hud_col_count, level.hud_row_count,
"left", level.hud_font_large, level.hud_c_count);
count SetValue(0);
elems = [];
elems[elems.size] = label;
elems[elems.size] = count;
self thread scripts\zm\tws_t6_common::destroy_on_disconnect(elems);
count = self.tws_hud_count;
last = -1;
for (;;)
@@ -245,108 +236,58 @@ hud_zombie_counter()
hud_health_display()
{
self endon("disconnect");
level endon("hud_game_over");
bar_width = level.hud_bar_width;
// -2 on both axes so the back frames the bar with 2px padding
back = scripts\zm\tws_t6_common::make_shader_elem(self, level.hud_x - 2, level.hud_row_bar - 2);
back.alpha = 0.5;
back.color = (0, 0, 0);
back SetShader("white", bar_width + 4, level.hud_bar_height + 4);
bar = scripts\zm\tws_t6_common::make_shader_elem(self, level.hud_x, level.hud_row_bar);
bar.color = level.hud_c_high;
bar SetShader("white", bar_width, level.hud_bar_height);
/*
"87/160" is three elements, not a rebuilt string. SetText allocates
a config string per call; per-tick rebuilds crash the server.
cur is right-aligned so digits grow leftward and the slash + max
never shift.
*/
cur = scripts\zm\tws_t6_common::make_text_elem(
self, level.hud_col_health + 26, level.hud_row_bar + 3,
"right", level.hud_font_mid, level.hud_c_high);
cur SetValue(self.health);
slash = scripts\zm\tws_t6_common::make_text_elem(
self, level.hud_col_health + 30, level.hud_row_bar + 3,
"center", level.hud_font_mid, level.hud_c_high);
slash SetText("/");
max_hp = scripts\zm\tws_t6_common::make_text_elem(
self, level.hud_col_health + 34, level.hud_row_bar + 3,
"left", level.hud_font_mid, level.hud_c_high);
max_hp SetValue(100);
cur.alpha = 0;
slash.alpha = 0;
max_hp.alpha = 0;
elems = [];
elems[elems.size] = back;
elems[elems.size] = bar;
elems[elems.size] = cur;
elems[elems.size] = slash;
elems[elems.size] = max_hp;
self thread scripts\zm\tws_t6_common::destroy_on_disconnect(elems);
last_width = bar_width;
bar = self.tws_hud_bar;
cur = self.tws_hud_health;
slash = self.tws_hud_slash;
max_hp = self.tws_hud_maxhealth;
last_width = -1;
last_health = -1;
last_max = -1;
last_shown = -1;
last_max = -1;
for (;;)
{
// Display fallbacks must not alter gameplay health values.
maximum = 100;
if (isDefined(self.maxhealth) && self.maxhealth > 0)
maximum = self.maxhealth;
frac = self.health / (maximum * 1.0);
current = 0;
if (isDefined(self.health))
current = max(0, self.health);
frac = current / (maximum * 1.0);
if (frac > 1)
frac = 1;
if (frac < 0)
frac = 0;
width = int(max(frac * bar_width, 1));
if (width != last_width)
{
bar SetShader("white", width, level.hud_bar_height);
last_width = width;
}
colour = level.hud_c_high;
bar.alpha = 1;
if (frac == 0)
bar.alpha = 0;
colour = level.hud_c_high;
if (frac <= 0.25)
colour = level.hud_c_low;
else if (frac <= 0.5)
colour = level.hud_c_mid;
bar.color = colour;
cur.color = colour;
slash.color = colour;
bar.color = colour;
cur.color = colour;
slash.color = colour;
max_hp.color = colour;
// numbers only show once you're hurt
show = 0;
if (frac < level.hud_health_threshold)
show = 1;
if (show != last_shown)
// Health numbers remain visible at full health.
if (current != last_health)
{
cur.alpha = show;
slash.alpha = show;
max_hp.alpha = show;
last_shown = show;
}
if (self.health != last_health)
{
cur SetValue(self.health);
last_health = self.health;
cur SetValue(current);
last_health = current;
}
if (maximum != last_max)
+72 -112
View File
@@ -127,120 +127,17 @@ lb_request(manual)
level endon("game_ended");
level endon("intermission");
snapshot = lb_cached_record();
if (!isDefined(snapshot))
{
if (manual)
self iPrintLnBold("^3Map record unavailable; try .leaders again shortly");
return;
}
// A manual replay replaces any welcome announcement still waiting to run.
// This also applies when the cache is unavailable.
if (manual)
self notify("tws_lb_requested");
self lb_show_hud(snapshot);
}
snapshot = lb_cached_record();
if (!isDefined(snapshot) && !manual)
return;
lb_show_hud(snapshot)
{
// Stop the previous display and its cleanup threads before replacing it.
self notify("tws_lb_hud_done");
if (isDefined(self.tws_lb_elems))
lb_hud_destroy(self.tws_lb_elems);
self endon("disconnect");
self endon("tws_lb_hud_done");
scripts\zm\tws_t6_common::ensure_config();
// Match .help's position, typography and row spacing below the health bar.
y = level.hud_row_bar + level.hud_bar_height + 20;
elems = [];
title = scripts\zm\tws_t6_common::make_text_elem(
self, level.hud_x, y, "left", level.hud_font_mid, level.hud_c_afk);
title.alpha = 0;
if (snapshot.round == 0)
title SetText("No recorded high round yet");
else
title SetText("Record: Round " + snapshot.round);
elems[elems.size] = title;
for (i = 0; i < 3; i++)
{
row = scripts\zm\tws_t6_common::make_text_elem(
self, level.hud_x, y + 22 + i * 18,
"left", level.hud_font_small, level.hud_c_count);
row.alpha = 0;
elems[elems.size] = row;
}
// Cleanup runs independently of the display and ends when it is replaced.
self.tws_lb_elems = elems;
self thread lb_hud_disconnect(elems);
self thread lb_hud_end_game(elems, "end_game");
self thread lb_hud_end_game(elems, "game_ended");
self thread lb_hud_end_game(elems, "intermission");
offset = 0;
for (;;)
{
// Text changes only once per page, never during the visibility loop.
for (i = 0; i < 3; i++)
{
row = elems[i + 1];
if (offset + i < snapshot.lines.size)
row SetText("^3Held by: ^7" + snapshot.lines[offset + i]);
else
row SetText("");
}
remaining = 12;
while (remaining > 0)
{
visible = !self lb_hud_help_visible();
for (i = 0; i < elems.size; i++)
elems[i].alpha = visible;
wait 0.1;
// Pause the page while .help occupies the same area.
if (visible)
remaining -= 0.1;
}
offset += 3;
if (offset >= snapshot.lines.size)
break;
}
lb_hud_destroy(elems);
self.tws_lb_elems = undefined;
self notify("tws_lb_hud_done");
}
lb_hud_help_visible()
{
return isDefined(self.tws_help_elems) && self.tws_help_elems.size > 0 &&
isDefined(self.tws_help_elems[0]) && self.tws_help_elems[0].alpha > 0;
}
lb_hud_disconnect(elems)
{
self endon("tws_lb_hud_done");
self waittill("disconnect");
lb_hud_destroy(elems);
}
lb_hud_end_game(elems, event)
{
self endon("disconnect");
self endon("tws_lb_hud_done");
level waittill(event);
lb_hud_destroy(elems);
self.tws_lb_elems = undefined;
self notify("tws_lb_hud_done");
}
lb_hud_destroy(elems)
{
for (i = 0; i < elems.size; i++)
{
if (isDefined(elems[i]))
elems[i] Destroy();
}
// Common owns pagination, help priority and the single service window.
// Undefined snapshots produce a private unavailable page for manual replay.
self scripts\zm\tws_t6_common::show_record(snapshot);
}
lb_refresh()
@@ -529,22 +426,85 @@ lb_holder_lines(names)
{
lines = [];
line = "";
columns = 0;
for (i = 0; i < names.size; i++)
{
if (line != "" && line.size + names[i].size + 2 > 100)
name = lb_holder_name(names[i]);
width = lb_holder_width(name);
if (line != "" && columns + width + 2 > 16)
{
lines[lines.size] = line;
line = "";
columns = 0;
}
if (line != "")
{
line += ", ";
line += names[i];
columns += 2;
}
line += name;
columns += width;
}
if (line != "")
lines[lines.size] = line;
return lines;
}
lb_holder_name(value)
{
// The service has 200 virtual units at font scale 1.1. Use a conservative
// 16-column bound, counting non-ASCII glyphs twice, pending in-game metrics.
// A long name gets one bounded entry; no tied holder is dropped.
value = lb_display_text(value, 64);
if (value == "")
value = "Unknown player";
if (lb_holder_width(value) <= 16)
return value;
output = "";
columns = 0;
for (i = 0; i < value.size; i++)
{
code = level.tws_lb_bytes[getSubStr(value, i, i + 1)];
width = 1;
if (code >= 128)
width = 2;
if (columns + width > 13)
break;
count = lb_glyph_bytes(code);
output += getSubStr(value, i, i + count);
columns += width;
i += count - 1;
}
return output + "...";
}
lb_holder_width(value)
{
columns = 0;
for (i = 0; i < value.size; i++)
{
code = level.tws_lb_bytes[getSubStr(value, i, i + 1)];
if (code >= 128)
columns += 2;
else
columns++;
i += lb_glyph_bytes(code) - 1;
}
return columns;
}
lb_glyph_bytes(code)
{
if (code >= 240)
return 4;
if (code >= 224)
return 3;
if (code >= 192)
return 2;
return 1;
}
lb_display_text(value, limit)
{
output = "";