Moderator
M
Moderator
19th July 2011
Maker:
Could be useful for someone.
Maker:
Could be useful for someone.
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)
In this map:
Features
-Language: English, german, french, spain
-with some examples for them
-documentation!
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..
-