It seems that Begin OnLoad doesn't run if you save in the cell the script it in. For instance, an NPC is set to a restrained state in a begin onload block. If you save in that cell, exit the game, then reload that save, the NPC will no longer be restrained.

What complicates things worse for me is that I have an object that I am using setrigidbodymass, and pms ghosteffect. Now I could move these commands to a game mode block, but I need to use a variable to keep them from looping (maybe having them loop won't be a problem, I'll test this soon). Now the object plays the effect, and has its mass set, but if I save near the object and reload the game, yep you guessed it, the rigidbodymass, and the effect are back to default...Well we'll fix that, just set the variable back to 0 in the onload block, ....but wait the onload block doesn't run when loading a save, and there is no command to check if an effect is playing, or what the rigidbodymass is.....

Does anyone else find this annoying, or am I the only one.
QUOTE(b3w4r3 @ Feb 28 2007, 04:06 PM) *

It seems that Begin OnLoad doesn't run if you save in the cell the script it in. For instance, an NPC is set to a restrained state in a begin onload block. If you save in that cell, exit the game, then reload that save, the NPC will no longer be restrained.

What complicates things worse for me is that I have an object that I am using setrigidbodymass, and pms ghosteffect. Now I could move these commands to a game mode block, but I need to use a variable to keep them from looping (maybe having them loop won't be a problem, I'll test this soon). Now the object plays the effect, and has its mass set, but if I save near the object and reload the game, yep you guessed it, the rigidbodymass, and the effect are back to default...Well we'll fix that, just set the variable back to 0 in the onload block, ....but wait the onload block doesn't run when loading a save, and there is no command to check if an effect is playing, or what the rigidbodymass is.....

Does anyone else find this annoying, or am I the only one.


That must be annoying, i haven't had it happen too me but it probably will sooner or later... sad.gif

Thanks for the heads up tongue.gif
QUOTE
If you save in that cell, exit the game, then reload that save

It won't run even if you completely exit the game before reloading? Hmm.
I actually avoid using onLoad blocks because I thought they would, so that's helpful for me.
In your case, you might want to use OBSE's getGameLoaded in addition to onLoad.
I may not have been accurate in my findings. The pms plays when loading a save, but the setrigidbodymass doesn't. Needs more testing to determine exactally what's happening.
Submit a Thread