Script doesn't save - any idea why?

Post » Sun Aug 04, 2013 11:44 pm

I'm trying to replace the effect of the Lessons Learned perk with a script for convenience and more flexibility. Any idea why this script doesn't save? Looks good to me.

scn adraeusPerkScriptLessonsLearned int currentLevelint nextLevelfloat gsXPVeryEasyfloat gsXPEasyfloat gsXPNormalfloat gsXPHardfloat gsXPVeryHard ; When the perk is addedbegin ScriptEffectStart   ; Get the player's current level  set currentLevel to player.getLevel    ; Get the player's next level for comparison  set nextLevel to (currentLevel + 1)    ; Get the current XP mults  set gsXPVeryEasy to (getGS fDiffMultXPVE)  set gsXPEasy to (getGS fDiffMultXPE)  set gsXPNormal to (getGS fDiffMultXPN)  set gsXPHard to (getGS fDiffMultXPH)  set gsXPVeryHard to (getGS fDiffMultXPVH)   ; Initially add 1% to each XP mult so the perk takes effect immediately  setGS fDiffMultXPVE to (gsXPVeryEasy + 0.01)  setGS fDiffMultXPE to (gsXPEasy + 0.01)  setGS fDiffMultXPN to (gsXPNormal + 0.01)  setGS fDiffMultXPH to (gsXPHard + 0.01)  setGS fDiffMultXPVH to (gsXPVeryHard + 0.01)    ; Get the newly updated XP mults  set gsXPVeryEasy to (getGS fDiffMultXPVE)  set gsXPEasy to (getGS fDiffMultXPE)  set gsXPNormal to (getGS fDiffMultXPN)  set gsXPHard to (getGS fDiffMultXPH)  set gsXPVeryHard to (getGS fDiffMultXPVH) end ; When the perk effect updatesbegin ScriptEffectUpdate   ; Get the player's current level  set currentLevel to player.getLevel    ; If the player has gained a level  if (currentLevel == nextLevel)    ; Update the player's next level    set nextLevel to (currentLevel + 1)        ; Add 1% to each XP mult    setGS fDiffMultXPVE to (gsXPVeryEasy + 0.01)    setGS fDiffMultXPE to (gsXPEasy + 0.01)    setGS fDiffMultXPN to (gsXPNormal + 0.01)    setGS fDiffMultXPH to (gsXPHard + 0.01)    setGS fDiffMultXPVH to (gsXPVeryHard + 0.01)        ; Get the newly updated XP mults    set gsXPVeryEasy to (getGS fDiffMultXPVE)    set gsXPEasy to (getGS fDiffMultXPE)    set gsXPNormal to (getGS fDiffMultXPN)    set gsXPHard to (getGS fDiffMultXPH)    set gsXPVeryHard to (getGS fDiffMultXPVH)  endif end
User avatar
Roberto Gaeta
 
Posts: 3451
Joined: Tue Nov 06, 2007 2:23 am

Post » Mon Aug 05, 2013 1:21 am

Looks like SetGameSetting and GetGameSetting are strictly console commands, and with NVSE, con_SetGameSetting and con_GetGameSetting don't accept variables.

SetNumericGameSetting and GetNumericGameSetting accept variables though.

Yet, those functions do not work here, too.

User avatar
Jennifer Munroe
 
Posts: 3411
Joined: Sun Aug 26, 2007 12:57 am


Return to Fallout: New Vegas