• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Mapping] How to save maps in localized Warcraft 3 ROC v1.00 (Code error message)

Level 19
Joined
Jan 3, 2022
Messages
320
Russian for search results: Как сохранить карту в русской локализации Варкрафт 3 Reign of Chaos v1.00 (Ошибка с кодом)

Earlier I stumbled upon this bug that prevented me from saving an empty map in Reign of Chaos v1.00 as it came off CD. I didn't know what the issue was and gave up. Today I hit it again and through sheer luck (and because I'm working on jassdoc, pjass) I now knew what the issue was.

The retail game was localized, most languages probably did not have any problems but for Russian, every single character was a problem. Look at this generated Jass trigger for melee, it's the failing map (to export this, in WE: File -> Export code):
JASS:
globals
    // Generated
    trigger             gg_trg___________________________ = null
endglobals
You don't see a problem yet? That's because you don't know the Jass syntax, names must not begin or end with an underscore _ !!!

Строка 3: Expected '='
Строка 3: Expected '='
Строка 21: Отсутствует 'takes'
Строка 22: Отсутствует название переменной
Строка 23: Отсутствует название
Строка 23: Отсутствует оператор кода
Триггер 'Иниц. сражения' был заблокирован из-за ошибок.
empty-map-scenario-error-message.png

Строка 20: Expected '='
Строка 20: Expected '='
Строка 49: Отсутствует 'takes'
Строка 50: Отсутствует название переменной
Строка 51: Отсутствует название
Строка 51: Отсутствует оператор кода
Строка 54: Отсутствует оператор кода
Строка 56: Отсутствует название функции
Строка 56: Отсутствует оператор кода
Строка 59: Отсутствует оператор кода
Строка 61: Отсутствует название
Строка 61: Отсутствует оператор кода
Строка 69: Отсутствует оператор кода
Строка 78: Отсутствует оператор кода
Строка 80: Отсутствует оператор кода
Строка 84: Отсутствует оператор кода
Строка 93: Отсутствует оператор кода
Строка 102 Отсутствует название функции
Строка 103: Отсутствует название функции
Строка 104: Отсутствует оператор кода
Строка 112: Отсутстеует оператор кода
Строка 123: Отсутствует название функции
empty-map-post-save-error.png
empty-map-correct-triggers.png

Here's the easy fix: rename the MeleeInitialization ("Иниц. сражения") trigger yourself, so it no longer has cyrillic or any other special characters that the game will replace with underscores. To rename, select the trigger file and then press F2. Result:

JASS:
globals
    // Generated
    trigger             gg_trg_MyMeleeInit         = null
endglobals
Much better. The editor thinks so too.

This was fixed with v1.01b or earlier.

PS: Looks like this is how it was fixed, from TFT 1.07 editor output:
JASS:
globals
    // Generated
    trigger                 gg_trg___________________________u = null
    trigger                 gg_trg_CustomCodeNative    = null
endglobals
It just appends a "u" symbol at the end in that case... I don't know if it's possible without hacks to enter non-english characters as trigger names, because if it were possible, you'd probably have a name clash at some point. I mean two names replaced to the same length underscore ___u name. Such spaghetti code, very cool.
 
Last edited:
Level 19
Joined
Jan 3, 2022
Messages
320
// offtopic
The game is indeed covered very well for something developed through 1999-2002. They had the foresight to choose UTF-8 (I know of .wts with UTF-8 + BOM) rather than any of the God-forsaken UTF-16 (UCS-2) etc. options.

Only Reforged has shown to me that they didn't program the rest of the game engine to be "Unicode-aware" in WinAPI terms, so locales stayed system-dependent in some cases (not Unicode). From that mistake stems the issue with Asian, Russian maps. And the chosen fonts didn't have good character coverage, neither any fallback. Today you can still see Korean characters in lobby, but not in game (same for Russian characters if you play in another localization).

For whatever it's worth, my ROC install CD says "Windows NT not supported" this tells you how confident they were in their own code... I'm not sure what the deal was with early Windows XP (without service packs) but it happened to work alright. And still does. Maybe through Microsoft's shim magic.
 
Top