AEBS Weather Fix

If you liked this item, please rate it up on Steam Workshop page.

Author: movin

Last revision: 19 Mar at 02:52 UTC

File size: 1.86 KB

On Steam Workshop

Description:
AEBS Weather Broadcast Display Fix

Fixes a bug introduced in Build 42.15 where AEBS (Automated Emergency Broadcast System) weather broadcasts display raw format placeholders "%s" instead of actual temperature, humidity, and wind values.

Before:

Today, average temperature %s. Minimum: %s. Maximum: %s. Humidity: %s%…

After:

Today, average temperature 15.2 °C. Minimum: 10.5 °C. Maximum: 20.1 °C. Humidity: 65%…


Features
  • Self-disabling — Automatically switches to passthrough mode once the bug is fixed upstream. No harm if you forget to unsubscribe, but unsubscribing is recommended.
  • All languages — Works with every language. This mod fixes the escaping at display time without modifying any translation data.
  • Lightweight — Minimal implementation that overrides a single game function.


Compatibility
  • Requires: Build 42.15+
  • Singleplayer and Multiplayer
  • No conflicts with other mods (only overrides getRadioText)


Verification

Check your console or log file for one of the following messages:

AEBSWeatherFix: double-escape bug detected, fix active AEBSWeatherFix: bug not detected, passthrough mode


Technical Details
Root Cause

In Build 42.15, the translation system was refactored and the file format migrated from .txt (Lua-style key = "value") to .json. As part of this change, Translator.java now applies percent-escaping (% → %%) to all loaded values for use with Java’s String.format.

This works correctly for most translation categories processed on the Java side. However, AEBS weather broadcast texts (DynamicRadio category) are passed directly to Lua via getRadioText() and processed by Lua’s string.format. Since the Java-side unescaping is never applied, %%s is interpreted as a literal %s by Lua, causing the raw placeholders to appear in broadcasts.

How This Mod Fixes It

Overrides getRadioText() to unescape %% back to % before returning values to Lua. On the first call, it uses a canary key (AEBS_temperature) to auto-detect whether the double-escape bug is present. If the bug is not detected, the original function is used as-is.

Affected Texts
  • AEBS_temperature (temperature and humidity)
  • AEBS_wind_0 (wind direction and speed)
  • AEBS_weather_warning (severe weather alerts)
  • AEBS_weather_0_a / _c (weather forecast periods)
  • AEBS_random_0–3 (random AEBS transmissions)


Links

Workshop ID: 3687634406
Mod ID: AEBSWeatherFix