Does GetName() honor localized strings?
#1
Posté 03 juin 2012 - 01:27
I tested with following settings:
Language ID of dialog.tlk, dialogF.tlk and my custom TLK is German.
The test objects, a door and a placeable, have been created from scratch by the toolset wizard. I entered an English, a French and a German version in the name field.
According to gffeditor, the name field then contains a CExoLocString where strref = -1 and the 3 versions are embedded with their language ID.
In the game, the German version is displayed as expected. GetName(), however, returns the English version.
This oddity means an obstacle to create scripted console messages about game objects, e.g. "{name} does this or that". Is this a known issue? Who has experience with this. Did I perhaps miss a further language configuration hidden somewhere?
#2
Posté 03 juin 2012 - 02:02
#3
Posté 03 juin 2012 - 04:10
I have some questions however.
Questions:
1) Is this a single player game. Or a multiplayer game, Including a singleplayer game ran via the standalone server?
2) Are you using the TRUE Paramater for bOriginalName.
Thoughts.
The String returned by the GetName Function is a CExoString not a CExoLocString. This neans that in a multi player Envirment only one language can be returned by the function reguardless. If you are trying to do this on a server, The version returned should be the same as the version of the server. As far as I know they have only made an English version of the stand alone server.
If you are using GetName in a multiplayer game. It will never be able to handle multi-language-Clients. It will simply retrive the name from the servers version and pass it on.
This is just the problem you are running into if the function is working for getting the correct channel.
Reguardless, In order for multi-language support in a single instance of a game, The only supported system seems to be the use of the tokens. You could experment with using <FullName> though I do not know if it will work where you are trying to use it at, or not.
Modifié par Lightfoot8, 03 juin 2012 - 04:14 .
#4
Posté 03 juin 2012 - 06:10
As I wrote above, dialog.tlk, dialogF.tlk and my custom.tlk are all configured with language ID "German". I looked up the value in Axe Murderers Killer TLK editor.
bOriginalName is FALSE (the default). The name has not been altered by SetName(); the test objects have simply been placed in the area in the toolset.
This is a single-player module that has been started immediately from the client.
I'm just checking the .ini files. It seems that some registry entries are missing that are indicated in nwnconfig.ini group [Registry]. I'm going to investigate this issue further.
#5
Posté 03 juin 2012 - 06:23
#6
Posté 03 juin 2012 - 07:02
lovellin wrote...
bOriginalName is FALSE (the default). The name has not been altered by SetName(); the test objects have simply been placed in the area in the toolset.
Correct, You will want to set it to TRUE, To have any chance of getting the language version. SetName was added in the 1.69 update. It was also an english only update if memory serves me correctly. So setting the value to TRUE will give you a chance of reverting back to the original functions.
lovellin wrote...
It seems that the installer didn't set the registry entries in Windows 7. I'd like to add them by hand. The values are supposedly those in nwnconfig.ini, but I don't know the data types. In order to achieve a regular installation, would anyone look up the registry keys in HKEY_LOCAL_MACHINESOFTWAREBiowareNWNNeverwinter?
I have not had any regestry entrys for NWN in a verry long time. My understanding on them is that they are only needed for the patches to be able to find the correct directories. But then again I am running an english version and you may have just found a Place where we did not know they where used.
EDIT: I guess I still do have some.
Note: Your GUID will be differant and of cource you will need to change the language channel. 0 is english.
Modifié par Lightfoot8, 03 juin 2012 - 07:14 .
#7
Posté 03 juin 2012 - 07:25
Extra Information for Language ID's Copied from the file format.
2. Embedded Strings with Language IDs
If the StrRef is invalid (ie., 0xFFFFFFFF), then the talk table is not used, and instead, the localized
text must be embedded within the CExoLocString. A CExoLocString may contain zero or more
embedded strings, each paired with a language ID that identifies what language the string should
be displayed for. The talk table file itself stores the user's language ID.
The following is a list of languages and their IDs:
Table 2: Language IDs
Language ID
English 0
French 1
German 2
Italian 3
Spanish 4
Polish 5
Korean 128
Chinese Traditional 129
Chinese Simplified 130
Japanese 131
3. Gender
In addition to specifying a string by Language ID, substrings in a LocString have a gender
associated with them. 0 = neutral or masculine; 1 = feminine. In some languages, the text that
should appear would vary depending on the gender of the player character, and this flag allows the
application to choose an appropriate string.
BioWare Corp.
http://www.bioware.com
4. LanguageID and Gender combination
Internally, LocStrings store LanguageID and Gender as single combined ID that is equal to double
the LanguageID, plus 0 for male strings and 1 for female strings. This is the same format in which
LocStrings are saved out (refer to the Generic File Format document, section 4.6).
#8
Posté 03 juin 2012 - 07:25
A third test object, which has a German name only, is handled correctly.
This issue is not a showstopper for me, because I'm currently working on a test module intended only for script development. I'll check whether ConvertLangID.exe can eliminate strings that get in the way. If that works, I could treat the actual game as follows:
- keep all translations in a "master" module
- before release, create a copy for each supported language and clean them up with ConvertLangID.exe.
Do you think that could work?
Modifié par lovellin, 03 juin 2012 - 07:33 .
#9
Posté 03 juin 2012 - 07:33
#10
Posté 03 juin 2012 - 11:58
Perhaps Shadow will have an Idea, He has worked more with the language thing then I have.
Perhaps a Mass leto Edit would be able to make the adjustment you want.
Funkys thread may help with that. How to Mass Edit and Data Mine your Module
#11
Posté 04 juin 2012 - 08:19
#12
Posté 04 juin 2012 - 07:12
#13
Posté 04 juin 2012 - 08:08
lovellin wrote...
ConvertLangID.exe can be found in the NWN utils directory.
Interesting, It does not come with the English version of the game. At least It did not come with my version.





Retour en haut






