Forms not unloading from memory upon reloading the game?

Post » Mon Oct 03, 2016 12:48 pm

Experimenting with changing items stats at runtime. The script below doesn't work because at every game reload [without quitting to desktop] the book values aren't restored to vanilla, so they will eventually increase to stellar values. How is this supposed to be done?
Scriptname TEST_ItemsStats extends ReferenceAlias

formlist property TEST_FLSTSpellTomes auto

function OnPlayerLoadGame()
self.SetSpellTomesWeight()
endFunction


function SetSpellTomesWeight()
Int i = TEST_FLSTSpellTomes.GetSize()
while i > 0

i -= 1

TEST_FLSTSpellTomes.GetAt(i).SetWeight(2.000000)

TEST_FLSTSpellTomes.GetAt(i).SetGoldValue( TEST_FLSTSpellTomes.GetAt(i).GetGoldValue() * 3)

endWhile
endFunction
edit: apparently I solved this by taking advantage of this behavior, I've added a weight check on a fake item before running the function. So strange though.
User avatar
Andy durkan
 
Posts: 3459
Joined: Fri Aug 03, 2007 3:05 pm

Return to V - Skyrim