Jump to content

Need Access to bSaveOnTravel from SkyrimPrefs.ini In Script


HerrBaron

Recommended Posts

Title says it all. Is there any way to accomplish this in papyrus with or without SKSE?


Thanks in advance,

-HB


(cross-posted to Bethsoft; sorry, I've asked several questions of late, none of which are receiving any replies. I'll post where I may be able to get an answer.)


Link to comment
Share on other sites

 

GetINIBool to get the initial value

SetINIBool to set the new value

 

I have not used these. Merely linking what is on the CK wiki.

 

Thank you, IsharaMeradin! Don't know HOW I missed these!

 

-HB

 

 

Ishara,

 

it states on the wiki page for GetINIBool the following:

 

"This works for Bethesda created settings only, whether in Skyrim.ini, SkyrimPrefs.ini, or YourLoadedPlugin.ini. Note that, in that order, each INI will override the setting(s) of the previous INI file(s)."

 

However, with these lines of code:

Import Debug
Import Utility
...
Bool bSOT = GetINIBool( "bSaveOnTravel:MAIN" )
Notification( "bSOT = " + bSOT )

if ( bSOT )
   Game.RequestAutoSave()
EndIf


And this in SkyrimPrefs.ini:

[MAIN]
bSaveOnTravel=1

the notification line tells me bSaveOnTravel is not set, as if GetINIBool() is not finding it.

 

Shouldn't GetINIBool() be searching Skyrim.ini then SkyrimPrefs.ini and finding the value?

 

Thanks!

-HB

Link to comment
Share on other sites

All I know about the functions is what is on the wiki. I have never used them. But I can tell you that according to your script snippet you are not importing Debug or using it in front of Notification. Without that, that line won't work proper. Might be a reason....

Link to comment
Share on other sites

Sorry; the snippet isn't the complete function; it does import Debug just above Utility.

 

Here's the whole script file:

Scriptname ADVSMEntryTriggerScript extends ObjectReference
Import Debug
Import Utility

Quest Property ADVSMQuest  Auto
ObjectReference Property ADSMEntryMarker  Auto

Event OnTriggerEnter( ObjectReference akActionRef )

	ADVSMQuestScript Mover = ADVSMQuest as ADVSMQuestScript

	if ( akActionRef == Game.GetPlayer() )

		akActionRef.MoveTo( ADSMEntryMarker )
		Mover.MoveFollowers( Mover.DirectionIn )

		Bool bSOT = GetINIBool( "bSaveOnTravel:MAIN" )
		Notification( "bSOT = " + bSOT )

		if ( bSOT )
			Game.RequestAutoSave()
		EndIf

	EndIf

EndEvent
Link to comment
Share on other sites

If I were you, I'd do the save anyway despite the user's settings. Use SaveGame from SKSE and use a custom name so that users will know its tied to your mod.

 

You could try removing some spaces. I've heard some people state that their notifications did not give the correct data when there were spaces between the + and the data being used.

 

Without trying it for myself, I couldn't really tell you what is going on. Like I said, I've never used those functions so I can't say whether they work or not.

Link to comment
Share on other sites

No go; I've since moved the function to a quest, on the off chance that calling GetINI* in an event was an issue. Still no go. As far as I can tell, these functions are simply broken. Does anyone know definitively if they are indeed broken??

 

Thanks in advance.

-HB

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...