What is wrong with my script?

Post » Thu Apr 08, 2010 2:06 pm

Someone reported a bug with my Experience Control mod. The bug was that any experience settings would be reset to default when Fallout 3 was restarted, something I could have easily prevented had I done a decent search on SetNumericGameSetting. :banghead:

I read in this http://www.gamesas.com/bgsforums/index.php?showtopic=1070450&hl that using FOSE's GetGameLoaded to reset all of the game settings would work. So I attached the following script to a "Start Game Enabled" quest with a 0.1 script delay and it isn't firing. All of my other scripts are working, this one is just acting like it isn't doing anything at all. Here it is:

scn ExpControlResetSettingsQuest01Scriptbegin MenuMode 1007if GetGameLoaded == 0	Returnelse	SetNumericGameSetting iXPLevelKillNPCVeryEasy ExpControlNPCLvlVeryEasyGlobal	SetNumericGameSetting iXPLevelKillNPCEasy ExpControlNPCLvlEasyGlobal	SetNumericGameSetting iXPLevelKillNPCAverage ExpControlNPCLvlAverageGlobal	SetNumericGameSetting iXPLevelKillNPCHard ExpControlNPCLvlHardGlobal	SetNumericGameSetting iXPRewardKillNPCVeryEasy ExpControlNPCVeryEasyGlobal	SetNumericGameSetting iXPRewardKillNPCEasy ExpControlNPCEasyGlobal	SetNumericGameSetting iXPRewardKillNPCAverage ExpControlNPCAverageGlobal	SetNumericGameSetting iXPRewardKillNPCHard ExpControlNPCHardGlobal	SetNumericGameSetting iXPRewardKillNPCVeryHard ExpControlNPCVeryHardGlobal	SetNumericGameSetting iXPLevelKillCreatureVeryEasy ExpControlOpponentLvlVeryEasyGlobal	SetNumericGameSetting iXPLevelKillCreatureEasy ExpControlOpponentLvlEasyGlobal	SetNumericGameSetting iXPLevelKillCreatureAverage ExpControlOpponentLvlAverageGlobal	SetNumericGameSetting iXPLevelKillCreatureHard ExpControlOpponentLvlHardGlobal	SetNumericGameSetting iXPRewardKillOpponentVeryEasy ExpControlOpponentVeryEasyGlobal	SetNumericGameSetting iXPRewardKillOpponentEasy ExpControlOpponentEasyGlobal	SetNumericGameSetting iXPRewardKillOpponentAverage ExpControlOpponentAverageGlobal	SetNumericGameSetting iXPRewardKillOpponentHard ExpControlOpponentHardGlobal	SetNumericGameSetting iXPRewardKillOpponentVeryHard ExpControlOpponentVeryHardGlobal	SetNumericGameSetting iXPRewardHackComputerVeryEasy ExpControlTerminalVeryEasyGlobal	SetNumericGameSetting iXPRewardHackComputerEasy ExpControlTerminalEasyGlobal	SetNumericGameSetting iXPRewardHackComputerAverage ExpControlTerminalAverageGlobal	SetNumericGameSetting iXPRewardHackComputerHard ExpControlTerminalHardGlobal	SetNumericGameSetting iXPRewardHackComputerVeryHard ExpControlTerminalVeryHardGlobal	SetNumericGameSetting iXPRewardPickLockVeryEasy ExpControlLockpickVeryEasyGlobal	SetNumericGameSetting iXPRewardPickLockEasy ExpControlLockpickEasyGlobal	SetNumericGameSetting iXPRewardPickLockAverage ExpControlLockpickAverageGlobal	SetNumericGameSetting iXPRewardPickLockHard ExpControlLockpickHardGlobal	SetNumericGameSetting iXPRewardPickLockVeryHard ExpControlLockpickVeryHardGlobal	SetNumericGameSetting iXPRewardDiscoverMapMarker ExpControlLocationGlobalendifend

What am I doing wrong? I have a feeling it is something obvious.
User avatar
Ilona Neumann
 
Posts: 3308
Joined: Sat Aug 19, 2006 3:30 am

Post » Thu Apr 08, 2010 10:44 am

My guess is that the quest isn't initiated until after the loading screen (i.e. http://geck.gamesas.com/index.php/MenuMode 1007 is over). I'd recommend using a http://geck.gamesas.com/index.php/GameMode block instead. The default script processing delay of 5 seconds should be just fine, and your well-placed early return will prevent it from running needlessly in the background.

Cipscis
User avatar
Killah Bee
 
Posts: 3484
Joined: Sat Oct 06, 2007 12:23 pm

Post » Thu Apr 08, 2010 1:28 pm

My guess is that the quest isn't initiated until after the loading screen (i.e. http://geck.gamesas.com/index.php/MenuMode 1007 is over). I'd recommend using a http://geck.gamesas.com/index.php/GameMode block instead. The default script processing delay of 5 seconds should be just fine, and your well-placed early return will prevent it from running needlessly in the background.

Cipscis

I will try that out as soon as I get the chance. Thank you for anwsering. :)
User avatar
chinadoll
 
Posts: 3401
Joined: Tue Aug 22, 2006 5:09 am

Post » Thu Apr 08, 2010 11:21 am

It works great now, thank you for helping. I will probably update my mod tomorrow with the bug fix.
User avatar
FLYBOYLEAK
 
Posts: 3440
Joined: Tue Oct 30, 2007 6:41 am

Post » Thu Apr 08, 2010 6:26 pm

Also you've got a slightly odd if structure there. Why not just have if(getgameloaded)?
User avatar
Agnieszka Bak
 
Posts: 3540
Joined: Fri Jun 16, 2006 4:15 pm

Post » Thu Apr 08, 2010 11:49 pm

Also you've got a slightly odd if structure there. Why not just have if(getgameloaded)?

I don't know exactly why I did that, I have just gotten into the habit of putting the http://cs.elderscrolls.com/constwiki/index.php/Return scripting command everywhere I can since it seems to be efficient in most cases. My Experience Control mod is filled with it.

I guess it probably doesn't help efficiency here, since there is only one "if" statement. So I might remove it later.
User avatar
natalie mccormick
 
Posts: 3415
Joined: Fri Aug 18, 2006 8:36 am


Return to Fallout 3