davidlallen Posted February 22, 2016 Share Posted February 22, 2016 This has been driving me bonkers for hours now. I have added localization text, basically a new name list for soldiers, but the game isn't picking it up. There are multiple mods that add a country and a set of soldier name lists. I have duplicated this, and I can see in XGCharacterGenerator that my country is being picked up. But the name array from the localization file isn't being picked up. The name array comes up as length zero (which by the way causes the game to go into an infinite loop.) How can I debug when localization files are read? Is there a relationship between the name of the localization file and the contents? For example, is a new localization file required to have the same filename of the mod, or the name of the data inside, or can it use any name? Link to comment Share on other sites More sharing options...
davidlallen Posted February 23, 2016 Author Share Posted February 23, 2016 Solved (but not understood). This mod has the answer:http://steamcommunity.com/sharedfiles/filedetails/?id=618481020The answer is, don't use a localization file. The author has cleverly created a blank localization file with this note: ; For some reason, if I put the names here I get 0 length arrays. It's like the localized array doesn't get populated in time or at all. This is exactly what I found, and lost 3-4 hours debugging. I have no idea why. But, if you put the arrays into your class, they get initialized. Possibly we have both/all missed something about localization files. But, this completely did not work for me, while his approach of putting the array into the class worked great first time. Link to comment Share on other sites More sharing options...
davidlallen Posted February 24, 2016 Author Share Posted February 24, 2016 OK, now it is understood, just nothing I would have ever guessed. http://forums.nexusmods.com/index.php?/topic/3837480-best-practices-with-ini-changes/&do=findComment&comment=34947640 Your localization file for class Xyz must be called exactly XcomXyz.int or it will be silently ignored. Since none of the localization files distributed in the game follow this rule, I am not sure how we would have ever guessed this. Fortunately Amineri knew. Link to comment Share on other sites More sharing options...
Amineri Posted February 24, 2016 Share Posted February 24, 2016 OK, now it is understood, just nothing I would have ever guessed. http://forums.nexusmods.com/index.php?/topic/3837480-best-practices-with-ini-changes/&do=findComment&comment=34947640 Your localization file for class Xyz must be called exactly XcomXyz.int or it will be silently ignored. Since none of the localization files distributed in the game follow this rule, I am not sure how we would have ever guessed this. Fortunately Amineri knew. Partially it was guessing, partially it was looking at how the DLC for XCOM:EU was set up. P.S. It's not the class that has to match, it's the package name. In the linked example, the script package is LW_OfficerPack.u, and the class with the localized variable is LWOfficerUtilities. This means that the localization file has to be named XComLW_OfficerPack.int, and in the localization file the class is specified with : [LWOfficerUtilities] <<config definitions>> Link to comment Share on other sites More sharing options...
Zyxpsilon Posted February 25, 2016 Share Posted February 25, 2016 (edited) Now decrypt this Twilight-Zone linguistic ruleset for me please...(Legit--) Q/A (--Pending) in various popular (or less so) threads on Nexus. :smile: :laugh: PS; Amineri... remember how LW1 went beyond the call of Moddy to provide addressable stacks of Image references using its custom DefaultContent.INI ((MultiplayerLoadoutSlots= spiking at the LongWar.UPK and more)) ? Why-Oh-why didn't Firaxis include (straight into the SDK toolset) such precious control over their "HUD+UI" assets for anyone to replace at will?? I mean, in all logic -- they surely knew what TexMod is capable of hacking. Why limit everyone's power or restricting alternate solutions via complex code acrobatics 95% of the planet don't even understand? Where's the proper HOOK i've been urging for over the last 19 days? XC2 got Voice-Packs, Hundreds of pooled behind the 8-Ball Characters, a few QoL diamonds here & there, Flags diversity exponentially packaged from everyone's opinions of what is a must have... Shall i continue? Edited February 25, 2016 by Zyxpsilon Link to comment Share on other sites More sharing options...
Recommended Posts