| 05-16-2009, 04:39 PM | #1 |
I don't know what languages are supported on warcraft so if anyone wants to help complete this. JASS:library Language globals constant integer LANGUAGE_UNDEFINED = 0 constant integer LANGUAGE_ENGLISH = 1 constant integer LANGUAGE_SPANISH = 2 private integer array PLAYER_LANGUAGE endglobals function GetPlayerLanguage takes player p returns integer local unit u = CreateUnit(p, 'hfoo', 0, 0, 0) local string s = GetUnitName(u) local integer id = GetPlayerId(p) call RemoveUnit(u) set u = null if PLAYER_LANGUAGE[id] != LANGUAGE_UNDEFINED then return PLAYER_LANGUAGE[id] elseif s == "Footman" then set PLAYER_LANGUAGE[id] = LANGUAGE_ENGLISH return LANGUAGE_ENGLISH elseif s == "lacayo" then set PLAYER_LANGUAGE[id] = LANGUAGE_SPANISH return LANGUAGE_SPANISH endif return LANGUAGE_UNDEFINED endfunction endlibrary |
| 05-16-2009, 06:11 PM | #2 |
Anitarf already started something like that before knowing that someone else already did that. Can't wait to some day make a long chain out of this. Btw: German footies are "Soldat"s. |
| 05-16-2009, 06:13 PM | #3 | |
Quote:
Taken from Troll Brains post on the helper. |
| 05-16-2009, 06:28 PM | #4 |
Using the length strings of localised strings is a better idea, however i guess we will never add all the answers to let us finish it. http://www.wc3c.net/showthread.php?t=103915 |
| 05-17-2009, 03:09 PM | #5 |
y not use an initializer on PLAYER_LANGUAGE if its in-game static and youre gonna store it. if it's in-game static then you might as well store the result for future references, so there's PLAYER_LANGUAGE[]. but also, if it's in-game static then why don't you just initialize it instead of running the JASS:if ItIsAlreadyEvaluated then endif |
| 05-17-2009, 03:20 PM | #6 |
It's definitely static. And also creating an unit is totally useless. But anyway unless you force all users of each war3 language to do my test map, we won't be able to finish it. So just forget it ... |
| 05-17-2009, 03:47 PM | #7 |
This return local data, its much more better idia to asq player for his location. i hate russian in games, and system like this with "forced" setting will make me sad. |
| 05-17-2009, 04:07 PM | #8 | |
Quote:
If one day we will get all the needed answers, i would use it for nothing more than simply display the player war3 language installed somewhere in the map. |
| 05-17-2009, 07:07 PM | #9 | |
Quote:
There could be uses as to displaying all game messages in their language, instead of only English. |
| 05-17-2009, 07:14 PM | #10 | |
Quote:
They had multi-language support in risk devolution. |
| 05-17-2009, 07:29 PM | #11 |
But for that you can play with localised .wts (external strings). |
