scn EBxOnGameLoad int i int n int bImmersivePickupSounds ref rItem ref rEntry ref rBottleUp ref rBottleDown int iCounter begin function { i } ; Runs on entering GameMode ; Using a callback here sometimes throws the exception, probably destroyed prematurely: ; 14154707 h 0FD78A00 8B4E0485 nvse_1_4.dll (10068A00) ; 14154707 ^ 005E234B 00000081 FalloutNV.exe CallAfterSeconds 0.1 EBxOnGameMode if EBxCanteenSipsMax > 0 let rEntry := ListGetNthForm EBxCanteenEffects EBxCanteenDrink if IsFormValid rEntry LNSetName ($rEntry) EBxVault13CanteenEffect else let EBxCanteenDrink := ListGetFormIndex EBxCanteenEffects WaterPurified endif endif if GetGameRestarted == 0 return endif ; The following code can run fine from EBxBootstrap, ; running it in PostLoadGame provides support for scripted injections ; from MenuMode 4 and JIP gr_* scripts. let bImmersivePickupSounds := FileExists "sound\fx\pickup sounds\bottles" 1 if bImmersivePickupSounds let rBottleUp := rBottleDown := EBxPickUpEmptyBottle else let rBottleUp := EBxSoundBottleUp let rBottleDown := EBxSoundBottleDown endif let i := 0 while rItem := ListGetNthForm NVDLC03AllEmptyBottlesLIST i SetWeight EBxBottleWeight rItem ; Set bottle weight SetBaseItemValue rItem EBxBottlePrice ; Set bottle price SetPickupSound rItem rBottleUp SetPutdownSound rItem rBottleDown ListAddForm EBxUpgradableToDirtyList rItem ListAddForm EBxUpgradableToPuraList rItem ListAddForm EBxUpgradableToPurifiedList rItem let i += 1 loop ; Upgradeable drinks ListAddForm EBxUpgradableToPuraList WaterUnpurified ListAddForm EBxUpgradableToPurifiedList WaterUnpurified ; Broken Steel drinks if EBxTTW set rItem to GetFormFromMod "BrokenSteel.esm" "4C7A" ; DLC03WQ03WaterHoly if IsFormValid rItem ListAddForm EBxUpgradableToDirtyList rItem 1 ListAddForm EBxUpgradableToPuraList rItem 1 ListAddForm EBxUpgradableToPurifiedList rItem 1 endif set rItem to GetFormFromMod "BrokenSteel.esm" "6F62" ; DLC03WQ02AquaCura if IsFormValid rItem ListAddForm EBxUpgradableToDirtyList rItem ListAddForm EBxUpgradableToPuraList rItem ListAddForm EBxUpgradableToPurifiedList rItem endif set rItem to GetFormFromMod "BrokenSteel.esm" "104F" ; DLC03AquaPura if IsFormValid rItem ListAddForm EBxUpgradableToPurifiedList rItem endif endif if bImmersivePickupSounds let rBottleUp := rBottleDown := EBxPickUpDrink else let rBottleUp := ITMBottleUp let rBottleDown := ITMBottleDown endif let i := 0 while rItem := ListGetNthForm EBxDrinkLists i SetOnUseAidItemEventHandler EBxOnDrink 1 rItem if GetType rItem == 85 ; form list let n := 0 while rEntry := ListGetNthForm rItem n if GetPickupSound rEntry == 0 SetPickupSound rEntry rBottleUp endif if GetPutdownSound rEntry == 0 SetPutdownSound rEntry rBottleDown endif let n += 1 loop elseif GetType rItem == 47 if GetPickupSound rItem == 0 SetPickupSound rItem rBottleUp endif if GetPutdownSound rItem == 0 SetPutdownSound rItem rBottleDown endif endif let i += 1 loop end