🏆 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!
Trigger strings are stored in the war3map.wts file. You can add support for multiple localizations by importing a separate war3map.wts for each language. This can be done with Ladislav's MPQ Editor by right clicking your file and choosing "Set File Locale". With this method you can translate much of your map, including the map name and descriptions.
You can also use some JASS tricks to get the clients language:
JASS:
function GetLocalLanguage takes nothing returns string
local string s = GetLocalizedString("CHEATENABLED")
if (s == "Cheat enabled!") then
return "English"
else if (s == "Cheat aktiviert!") then
return "German"
endif
return s
endfunction
The above function checks a localized string to determine what language the client is using. The downside to this you cannot detect locale, only language.
If you want to detect client locale through JASS, you will have to do something like this:
JASS:
function GetLocale takes nothing returns string
local player p = GetLocalPlayer()
local string s = GetPlayerName(p)
local string locale = ""
call StartCampaignAI(Player(PLAYER_NEUTRAL_AGGRESSIVE), "locale\\detect.ai")
set locale = GetPlayerName(p)
call SetPlayerName(p, s)
if (locale == s) then
return "Unknown"
endif
return locale
endfunction
Along with that function, you will need to add "locale\\detect.ai" to the MPQ for each game locale you want to detect. I uploaded a map as an example which can detect enUS or koKR.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.