SetNumericGameSetting (NVSE v1 [beta 6])

Post » Sat Feb 05, 2011 10:18 pm

Okay, so I've gotten my heartbeat Quest/Script up and running, but I have run into a minor snafu while trying to add some initialization functionality I never bothered with in Fallout 3 and its Script Extender. (Note: The rest of the script works fine, including my various NVSE-specific IsKeyPressed calls.)

Long story short, I am trying to apply Game Settings changes via script instead of the non-script way, i.e., change the value via the Gameplay-->Settings... and then save the mod.

1.) Will "console" commands work when executed from inside a script?
2.) Is SetNumericGameSetting broken?

For (2) above, I've tried it both in my script and also by typing it directly into the console, but neither had any effect. (In the console, the command was recognized, i.e., I got no error. It just had no effect.)

The setting I am trying to tweak (for testing purposes) is the following:

SetNumericGameSetting fMoveRunMult 8.0


I also tried the following (since the documentation does not state if quotes are required or not for string parameters):

SetNumericGameSetting "fMoveRunMult" 8.0


If I create a mod "the normal way" changing that setting to 8.0, the player runs twice as fast. If I try to set that setting via SetNumericGameSetting, there is no change in movement speed. (And, yes, in the script, I am ensuring that the game is loaded first before making that call.)
User avatar
Lyd
 
Posts: 3335
Joined: Sat Aug 26, 2006 2:56 pm

Post » Sat Feb 05, 2011 11:56 pm

Does the speed update if you crouch/uncrouch?
User avatar
Suzy Santana
 
Posts: 3572
Joined: Fri Aug 10, 2007 12:02 am

Post » Sat Feb 05, 2011 2:52 pm

Well, sneak mode just uses an additional variable (fMoveSneakMult), but to answer your question, um, of course, but it's just the normal (slower) sneak mode speed. Was this a trick question? :biggrin:
User avatar
Amber Ably
 
Posts: 3372
Joined: Wed Aug 29, 2007 4:39 pm

Post » Sat Feb 05, 2011 3:29 pm

New Slant on Problem:

Okay, using only the console, I am able to set fMoveRunMult via SetNumericGameSetting and verify that it got set via GetNumericGameSetting. When I exit out of the console, though, my move (run) speed is unaffected.

Conclusion: Game settings, at least not this one, can't be modified for the current game session.
Verification: After setting the new value, exiting to the main menu, and then reloading, voila! I am now running around twice as fast.

Any way around this?

And for what it's worth, sticking the following in my script has the same effect (i.e., first run [from desktop] --> no effect, but then exiting to main and reloading enables the change):

;;---------------------------------------;;	Alter Game Settings;;---------------------------------------if( (GetGameLoaded == 1) || (GetGameRestarted == 1) )	SetNumericGameSetting fMoveRunMult 8.0	;;[Default: 4.0]endif


Edit: Actually, exiting to main is not required. Simply reloading a savegame does the trick. Meh, I guess that's not so bad. I can live with that, I suppose.
User avatar
dell
 
Posts: 3452
Joined: Sat Mar 24, 2007 2:58 am

Post » Sat Feb 05, 2011 9:03 pm


Conclusion: Game settings, at least not this one, can't be modified for the current game session.


May just be the settings you are changing. I know the one for PerkRate changes just fine in the current game session. I tested it after adding the FO1/2 "Skilled" perk and altered the perk rate to 3.
User avatar
Oceavision
 
Posts: 3414
Joined: Thu May 03, 2007 10:52 am


Return to Fallout: New Vegas