How to? Custom INI files for Mods?

Post » Wed May 23, 2012 6:15 am

I'm hoping someone here can answer this...because I feel like this was implemented half way...

Bethesda mentioned that mods would be able to support having their own INI files, and the Creation Kit site even mentions the possibility http://www.creationkit.com/INI_files.

Mod Defined
Mods can define INI files to override settings from Skyrim.ini. Mod defined INI files should have the same name as the plugin file and are only applied if the plugin is loaded by the game.

And then the http://www.creationkit.com/SetINIFloat_-_Utilitypage hints at adding your own custom fRandomSetting to a custom [CoolSettings] section in an .ini file via papyrus.

; Set the "fRandomSetting" in the "[CoolSettings]" section to 10
Utility.SetINIFloat("fRandomSetting:CoolSettings", 10.0)

But I see no mention of how you might USE that value. So what good is it being able to set custom ini settings in custom sections if there's no way to actually read those values out in papyrus scripts?

Am I missing something?

Please... no posts that say all I have to do is save the .ini file out with the same name as the mod + .ini as the extension. If you say that, you have no idea what I'm asking. I need to know how to READ values out of the .ini file. The Utility script obviously allows you to SAVE values, but no mention of being able to read them ANYWHERE.

-MM
User avatar
Rach B
 
Posts: 3419
Joined: Thu Mar 08, 2007 11:30 am

Post » Wed May 23, 2012 1:50 pm

It's quite possible that they are brought in as globals? The last part of each is 'native global'. Please note that I'm guessing at this.
User avatar
Trey Johnson
 
Posts: 3295
Joined: Thu Oct 11, 2007 7:00 pm

Post » Wed May 23, 2012 10:42 am

It's quite possible that they are brought in as globals? The last part of each is 'native global'. Please note that I'm guessing at this.

There's a thought... that's more input than anyone else has provided on the subject! :) I'll give it a go and see what happens.

-MM
User avatar
matt white
 
Posts: 3444
Joined: Fri Jul 27, 2007 2:43 pm

Post » Wed May 23, 2012 3:42 am

Well, I can't find that it saved the value to ANY .ini file so I wonder if this was deprecated but still written up on the wiki. I know for a fact there's not a single script in the 10,008 scripts that ship with Skyrim that uses this or the SetINIString or SetINIint functions in the utility script so....in fact the wiki page on utility script doesn't even mention these functions although they're defined in their own spaces. MUST be deprecated. That stinks... oh well, guess I'll stick to GlobalValues that people can change to tweak the mod...would be nice to have custom .ini files for mod tweakage.

-MM
User avatar
Samantha Wood
 
Posts: 3286
Joined: Sun Oct 15, 2006 5:03 am

Post » Wed May 23, 2012 10:34 am

Just to confirm;

1) You have a plugin with a script
2) You have the ini file with the same name as the plugin
3) the ini file has several variables
4) the script calls the SetINI function to change those?

It's possible that you might need to create the extras - ie, create a global value for the ini function..

Honestly, I really don't know, but I'm throwing out stuff in case it helps. :P I use an ini file setup through the SkyProc lib, so.
User avatar
Trista Jim
 
Posts: 3308
Joined: Sat Aug 25, 2007 10:39 pm

Post » Wed May 23, 2012 5:31 am

Plugin INIs allow you to have an INI with the same name as your plugin, which will override settings in Skryim.ini, check out http://www.creationkit.com/INI_files#Mod_Defined and http://www.gamesas.com/topic/1345724-important-bsas-and-you/page__view__findpost__p__20290392.
User avatar
Jessie Butterfield
 
Posts: 3453
Joined: Wed Jun 21, 2006 5:59 pm

Post » Wed May 23, 2012 5:37 am

First let me say, I really appreciate the response. Second, yes... I'm well aware. I linked to, one, of the same links on the wiki in the OP. The point is, the second link in the op, http://www.creationkit.com/SetINIFloat_-_Utilityprovides the following example.




Examples;Set the "fRandomSetting" in the "[CoolSettings]" section to 10Utility.SetINIFloat("fRandomSetting:CoolSettings", 10.0)


Which one would infer that you could write your own custom ini settings since 1) There is no [CoolSettings] section in the .ini files, and 2) there's no fRandomSetting float variable in any .ini files. Please don't interpret this as disrespect. I really appreciate the input on this. Maybe it was just not the best example they could of used, considering I tried the EXACT same example in a script and it didn't work (and my Debug.MessageBox did fire).

I think at this point, I'm just more frustrated that this wasn't taken that EXTRA step to be able to support READING and WRITING custom values to an .ini file. It would make things so much easier for modders who want to allow their users to customize certain aspects of their mod without having to rely on, say, java patches, like Plutoman's continued work with "Realistic Lighting" has had to do.

-MM
User avatar
Flash
 
Posts: 3541
Joined: Fri Oct 13, 2006 3:24 pm

Post » Wed May 23, 2012 1:18 pm

Just to confirm;

1) You have a plugin with a script
2) You have the ini file with the same name as the plugin
3) the ini file has several variables
4) the script calls the SetINI function to change those?

It's possible that you might need to create the extras - ie, create a global value for the ini function..

Honestly, I really don't know, but I'm throwing out stuff in case it helps. :tongue: I use an ini file setup through the SkyProc lib, so.

Hey Plutoman, Yep... you have that right. I also created GlobalVariables with the same names just in case. But no luck. Thank you as well for your time!

-MM
User avatar
leigh stewart
 
Posts: 3415
Joined: Mon Oct 23, 2006 8:59 am

Post » Wed May 23, 2012 9:31 am

Ah, sorry, I misunderstood exactly what you were asking/already understood.

Yeah, reading the wiki link for for SetINIFloat, it says it can only be used for existing entries in Skyrim.ini or SkyrimPrefs.ini, so I think you're SOL on custom settings.
User avatar
Chantelle Walker
 
Posts: 3385
Joined: Mon Oct 16, 2006 5:56 am

Post » Wed May 23, 2012 1:32 am

Yeah, reading the wiki link for for SetINIFloat, it says it can only be used for existing entries in Skyrim.ini or SkyrimPrefs.ini,

Yeah, I was hoping that meant if SOMEONE defined SOMETHING in the .ini file before the game module loaded, not necessarily that it only supported the ones that, well, the game supports. There is no "fRandomSetting" in the "[CoolSettings]" section supported by the game.

so I think you're SOL on custom settings.

LOL, yes, I'm SOL it seems.

-MM
User avatar
sara OMAR
 
Posts: 3451
Joined: Wed Jul 05, 2006 11:18 pm


Return to V - Skyrim