beornblackclaw Posted February 18, 2016 Share Posted February 18, 2016 (edited) Hello, I'm having trouble reading/writing from/to a setting file for my mod. So far I have set my class to use a config file.In the project I've added an empty file with just a section header.Now I'm having a few problems:If I set the section as [XComGame.<classname>], the file gets written but is not read upon loading If I set the section as [<modname>.<classname>], the file gets read but is not written when I call SaveConfig() Follow up from (2), one of my setting is actually an array of strings, however it only ever reads the last value.When, I had a . (dot) in front of the second line it works fine. However, when looking at the result of (1), the config file is not written with any dot.So, if I ever manage to read AND write, I'll still have a problem with my array only ever getting the last value (unless I missed something). The only documentation I've found so far is from the Configuration Files UDK but it doesn't say anything about arrays. Any help would be appreciated. Thanks. EDIT: More details: The code itself is kind of an unrealscript construct. The relevent parts are just this (the config keyword):class UIModdedShell_BLCK extends UIFinalShell config(ModProfiles);var config array<name> ModNames;My config file in ModBubby should be empty but I added some values for testing (this is case 2):[ModProfiles.UIModdedShell_BLCK]ModNames=DebugName1ModNames=DebugName2In one of my test button, I have this code:ModNames.Remove(0, ModNames.Length);ModNames.AddItem('DebugName3');ModNames.AddItem('DebugName4');SaveConfig();Case 1 gives me this after clicking the test button:A file in the mod config with the exact content of what I defined in ModBuddy (see above)An empty ModNames array (even after the first start)A file in "my games" when I click the test button containing this:[ModProfiles.UIModdedShell_BLCK]ModNames=DebugName3ModNames=DebugName4BufferSpace=20.000000bPlayAnimateInDistortion=TruebPlayIdleDistortion=TrueIdleDistortionAnimationLength=1.000000IdleDistortionGapMin=5.000000IdleDistortionGapMax=10.000000MaxIdleStrength=0.030000AnimateInDistortionTime=0.500000Note that it says ModProfiles.UIModdedShell_BLCK instead of XComGame.UIModdedShell_BLCK.Case 2:A file in the mod config with the exact content of what I defined in ModBuddy (see above)One entry in the ModNames array containing 'DebugName2' (both if I manually add . in front of the second entry)No file in "my games"No change saved to the ini file despite calling SaveConfig() Edited February 18, 2016 by beornblackclaw Link to comment Share on other sites More sharing options...
Recommended Posts