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