Very stupid error?

Post » Fri May 27, 2011 8:53 pm

I have this in my script:
Let Temp := GetGameSetting fPCBaseMagickaMultDebugPrint "fPCBaseMagickaMult is %f" TempLet Temp := Settings["fPCBaseMagickaMult"]if eval(Temp != -1)	DebugPrint "fPCBaseMagickaMult should be set to %f" Temp	SetNumericGameSetting fPCBaseMagickaMult TempendifLet Temp := GetGameSetting fPCBaseMagickaMultDebugPrint "fPCBaseMagickaMult is set to %f" Temp


First debugprint shows a value of 1, like it should.
Second debugprint shows a value of 1.5, also like it should.
Third debugprint shows a value of 0, and fPCBaseMagickaMult is also set to 0.

My question: WTF!?

Very stupid error on my side that I've overlooked during the past hours, or a bug in the function SetNumericGameSetting?
User avatar
GabiiE Liiziiouz
 
Posts: 3360
Joined: Mon Jan 22, 2007 3:20 am

Post » Fri May 27, 2011 8:41 pm

Edit:
Nevermind. Still want to see the entire script, but maybe you need to let a frame pass before checking on the global variable again?
User avatar
biiibi
 
Posts: 3384
Joined: Sun Apr 08, 2007 4:39 am

Post » Fri May 27, 2011 5:37 pm

My magicka pool and GetGS calls from the console after a few seconds all confirm that "fPCBaseMagickaMult" is set to 0.

But here is the complete script:
scn 01MrFSESetGameSettingsarray_var Settingsfloat TempBegin Function{Settings}Let Temp := Settings["fPerkLightArmorExpertSpeedMult"]if eval(Temp != -1)	SetNumericGameSetting fPerkLightArmorExpertSpeedMult TempendifLet Temp := Settings["fPerkLightArmorMasterRatingMult"]if eval(Temp != -1)	SetNumericGameSetting fPerkLightArmorMasterRatingMult TempendifLet Temp := Settings["fPerkHeavyArmorExpertSpeedMult"]if eval(Temp != -1)	SetNumericGameSetting fPerkHeavyArmorExpertSpeedMult TempendifLet Temp := Settings["fPerkHeavyArmorMasterSpeedMult"]if eval(Temp != -1)	SetNumericGameSetting fPerkHeavyArmorMasterSpeedMult TempendifLet Temp := GetGameSetting fPCBaseMagickaMultDebugPrint "fPCBaseMagickaMult is %f" TempLet Temp := Settings["fPCBaseMagickaMult"]if eval(Temp != -1)	DebugPrint "fPCBaseMagickaMult should be set to %f" Temp	SetNumericGameSetting fPCBaseMagickaMult TempendifLet Temp := GetGameSetting fPCBaseMagickaMultDebugPrint "fPCBaseMagickaMult is set to %f" TempEnd


This script is called once when the game is loaded.
User avatar
Captian Caveman
 
Posts: 3410
Joined: Thu Sep 20, 2007 5:36 am

Post » Sat May 28, 2011 12:16 am

Is the fPCBaseMagickaMult the only value that is experiencing this problem? It seems like you are using SetNumericGameSetting on several game settings before trying it on fPCBaseMagickaMult.
User avatar
Courtney Foren
 
Posts: 3418
Joined: Sun Mar 11, 2007 6:49 am

Post » Fri May 27, 2011 9:44 pm

They're all experiencing the same problem. I noticed, however, that if I use this line of code:
SetNumericGameSetting fPCBaseMagickaMult 1.5

that it works just like it should.
But I need to set it to a variable, as I cannot change the script itself on the fly...
It doesn't seem to me like it's an error on my side, so I'll bring it up in the OBSE thread.
User avatar
teeny
 
Posts: 3423
Joined: Sun Feb 25, 2007 1:51 am


Return to IV - Oblivion