• 🏆 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!

Multi Language System 1.2

Multi Language System
V. 1.2

Make your map support Multilanguage.

An GUI made system, easy to understand and to Import...



About..

History: I wanted to make my map support 2 main Languages, English & German. (or even more.. but later..)

Using for what?:You can show every player a message (ex. a hint) in his own language (you just have to set the message in the varriable)
It may be good in RPG games, because i cant understand good english^^.. so the mapmaker could add german or even other languages.

Code: GUI , MPU
Creator: Cr4ck4r


How it works?
(Warning: This will only work if the NAME of "hf00" (footman) was NOT changed)
Well, creating a unit on startup, taking its name, compare it with strings and output a language.
example:

If name of unit:
Soldat = set to German
Footman = set to English
You can also take an other Unit for that (ex below..)
Fleisch Wagen = set to German
Meat Wagon = set to English
( I just took footman, becuase its easy to search on google for french and spain name :D )



In this map:
Features

-Language: English, german, french, spain
-with some examples for them ;)
-documentation!

I only upload the "main" system trigger
Examples you can find in the map.


  • MultiLanguageSystem
    • Ereignisse
      • Map initialization
    • Bedingungen
    • Aktionen
      • -------- ---------------------------------------------------------------------------------- --------
      • -------- DELETE THIS MESSAGE --------
      • -------- DELETE THIS MESSAGE --------
      • -------- DELETE THIS MESSAGE --------
      • Spiel - Display to (All players) for 4.00 seconds the text: Test commands: -fr...
      • -------- ---------------------------------------------------------------------------------- --------
      • -------- ---------------------------------------------------------------------------------- --------
      • -------- settings varriables, the Languages --------
      • -------- You can add more Languages here --------
      • -------- ---------------------------------------------------------------------------------- --------
      • Set GERMAN = 1
      • Set English = 2
      • Set French = 3
      • Set Spanish = 4
      • Set UnsupportedLanguage = 5
      • -------- ---------------------------------------------------------------------------------- --------
      • -------- settings for all players --------
      • -------- Language will be set to: 1-5 (integer) --------
      • -------- ---------------------------------------------------------------------------------- --------
        • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
          • Schleifen - Aktionen
            • -------- ---------------------------------------------------------------------------------- --------
            • -------- Creating a constant Unit, save it in a varriable --------
            • -------- and compare names later --------
            • -------- WARNING: Works only if you DONT have changed the NAME of "hf00" (footman) --------
            • -------- ---------------------------------------------------------------------------------- --------
            • -------- okay, TempPoint to avoind leaks ;) --------
            • Set TempPoint = (Center of (Playable map area))
            • -------- Create "hf00" (footman) and save it as varriable --------
            • Einheit - Create 1 Soldat for (Player((Integer A))) at TempPoint facing Vorgabe für Gebäude-Ausrichtung (270.0) degrees
            • -------- Lets save the unit NAME as a varriable (for every player) --------
            • -------- to compare it later --------
            • Set TestUnitNAME[(Player number of (Player((Integer A))))] = (Name of (Last created unit))
            • Einheit - Remove (Last created unit) from the game
            • Custom script: call RemoveLocation (udg_TempPoint)
            • -------- ---------------------------------------------------------------------------------- --------
            • -------- GERMAN --------
            • -------- ---------------------------------------------------------------------------------- --------
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • TestUnitNAME[(Player number of (Player((Integer A))))] Gleich (==) Soldat
                • 'THEN'-Aktionen
                  • -------- If name = xxx => then set "Language" to "german/french/spain/english/or not supported language yet(integer)" --------
                  • Set Language[(Player number of (Player((Integer A))))] = GERMAN
                • 'ELSE'-Aktionen
                  • -------- ---------------------------------------------------------------------------------- --------
                  • -------- English --------
                  • -------- ---------------------------------------------------------------------------------- --------
                    • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • 'IF'-Bedingungen
                        • TestUnitNAME[(Player number of (Player((Integer A))))] Gleich (==) Footman
                      • 'THEN'-Aktionen
                        • -------- If name = xxx => then set "Language" to "german/french/spain/english/or not supported language yet(integer)" --------
                        • Set Language[(Player number of (Player((Integer A))))] = English
                      • 'ELSE'-Aktionen
                        • -------- ---------------------------------------------------------------------------------- --------
                        • -------- French --------
                        • -------- ---------------------------------------------------------------------------------- --------
                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • 'IF'-Bedingungen
                              • TestUnitNAME[(Player number of (Player((Integer A))))] Gleich (==) Fantassin
                            • 'THEN'-Aktionen
                              • -------- If name = xxx => then set "Language" to "german/french/spain/english/or not supported language yet(integer)" --------
                              • Set Language[(Player number of (Player((Integer A))))] = French
                            • 'ELSE'-Aktionen
                              • -------- ---------------------------------------------------------------------------------- --------
                              • -------- Spain --------
                              • -------- ---------------------------------------------------------------------------------- --------
                                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                  • 'IF'-Bedingungen
                                    • TestUnitNAME[(Player number of (Player((Integer A))))] Gleich (==) Soldado Raso
                                  • 'THEN'-Aktionen
                                    • -------- If name = xxx => then set "Language" to "german/french/spain/english/or not supported language yet(integer)" --------
                                    • Set Language[(Player number of (Player((Integer A))))] = Spanish
                                  • 'ELSE'-Aktionen
                                    • -------- ---------------------------------------------------------------------------------- --------
                                    • -------- What?... not supported? well.. --------
                                    • -------- ---------------------------------------------------------------------------------- --------
                                    • Set Language[(Player number of (Player((Integer A))))] = UnsupportedLanguage


Changelog

-1.0 first release
-1.1 removed that player number things,
made little bit clearer,
now compare string=string
added 2 new examples: message on kill, -from
and even more documentation ;)
-1.2 using Map initialization..
-
Give me credits if using this =)
cr4ck4r

Keywords:
language multi test choose cr4ck4r english german french spain
Contents

Multi Language System (Map)

Reviews
19th July 2011 Maker: Could be useful for someone.

Moderator

M

Moderator

19th July 2011
Maker:
Could be useful for someone.
 
Level 4
Joined
Jul 22, 2010
Messages
74
post the triggs?
done.

Checking...

edit

Btw, nice idea ^^ (I thought of it 2 weeks ago, but I realized that I can't support more than 1 language since the grammer would be an epic fail)

edit

As A system, I wouldn't give it a high rating, but as a concept, it's great :D
You could change all your strings to string arrays ^^
.. 2/5 :(
:p i think system It is similar to a concept, and conversely^^
the message-string? i will try your suggestion :p
 
Level 14
Joined
Nov 23, 2008
Messages
512
hmm my version because you need the GetLocalPlayer() as i know
JASS:
// this returns the language of a player (you can add more :P)
function GetPlayerLanguage takes player p returns string
    local unit u = CreateUnit(Player(15),'hfoo',0,0,0)
    local string s
    local string ss = "English"
    if GetLocalPlayer() == p then
        set s = GetUnitName(u)
    endif
    call RemoveUnit(u)
    set u = null
        if s =="Soldat" then
            set ss= "German"
        //elseif s == "???" then
            //set ss="???"
        //........
        endif
    return ss
endfunction

with the condtion that the name of the soldier is not changed els you have to change it
 
Top