Removing
If you remove a function that was in the middle of running when a save was made, the old function will be loaded from the save and allowed to finish. A warning will be printed to the script log, and further calls to the removed function (usually because some other changed or removed function is calling it) will fail.
The above is wrong, as illustrated:
This:
event onLoad() on = true while on == true chooser = RandomInt(1,3) rndWaitTimer = RandomFloat(10.0, 30.0) wait(rndWaitTimer) if chooser == 1 self.PlayAnimation("PlayAnim01") mySFX.play(self) wait(0.5) placeAtMe(FallingDustExplosion01) wait(3) self.PlayAnimation("PlayAnim02") elseif chooser == 2 self.PlayAnimation("PlayAnim02") mySFX.play(self) elseif chooser == 3 self.PlayAnimation("PlayAnim03") mySFX.play(self) endif endWhile endEventevent onUnLoad() on = falseendEventWas changed to this in the USKP:
event OnCellAttach() on = true while on == true if( !Is3DLoaded() ) on = False Return EndIf chooser = RandomInt(1,3) rndWaitTimer = RandomFloat(10.0, 30.0) wait(rndWaitTimer) if chooser == 1 self.PlayAnimation("PlayAnim01") mySFX.play(self) wait(0.5) placeAtMe(FallingDustExplosion01) wait(3) self.PlayAnimation("PlayAnim02") elseif chooser == 2 self.PlayAnimation("PlayAnim02") mySFX.play(self) elseif chooser == 3 self.PlayAnimation("PlayAnim03") mySFX.play(self) endif endWhile endEventevent OnCellDetach() on = falseendEventI still see this in every game load:
[06/21/2012 - 02:05:59PM] warning: Function fxDustDropRandomSCRIPT..OnLoad in stack frame 0 in stack 221513 doesn't exist in the in-game resource files - using version from save
Which still throws these all the time:
[06/21/2012 - 02:06:25PM] error: Object reference has no 3Dstack: [ (0001E68C)].Sound.Play() - "" Line ? [ (000EBAA9)].fxDustDropRandomSCRIPT.OnLoad() - "" Line ?
The USKP version of the script was designed to fix this stupidity with the OnLoad() block, but Papyrus has decided to disobey the change outright. This should NOT be allowed to happen.
On new games obviously the change takes effect and these scripts remain silent when you're no longer near the objects. It should be noted that in every case where the game has complained in the logs about the object having no 3D, I'm nowhere near one of these things, which means the code for those scripts is executing continuously in the background - and my level 52 Argonian has encountered dozens of these objects which implies dozens of copies of this script are eating away at active script cycles for no good reason.