I have an object (ship) with a constraint attached. The constraint doesn't seem to keep attached when loading a save under certain conditions. It keeps attached if I save and load the game without exiting the game, but if I exit the game after save, when loading it will not be attached.
I have set up an OnLoad() event that will reattach the constraints when the object's 3D is loaded. So, with this, if the player changes location, saves, exits the game, and returns to my object, the constraints do reattach. The same if he moves a bit away from the object, I have a function that checks for distance and reattaches the constraints. So if the player saves and loads near the object, but at a small distance, it also loads the constraints fine.
Now, the problem is mostly when the player is right by the object. I can't use the distance check, as the player is right on it and in contact. OnLoad() doesn't fire by game load, so it seems that it doesn't unload the object in the save. I could solve this by checking if the game is loaded, but there doesn't seem to be an easy way to check for this yet. Strangely, it works fine if I save and load without leaving the game, but not otherwise.
I know that SKSE was working on such an event sometime ago, but I couldn't find anything new on this.
The script is in one object and is standalone, so I would prefer not to use other scripts at any quests or any other objects. I do have the object to be constrained created by placeatme in the ship's script in the OnInit() event directly, so I could add something in that object's script though...
Any ideas how to solve this? How can I in a somewhat simple way check for game load??? If it's easier to check for saving, that could solve it too for me, as I could use a variable to check in the OnUpdate() event.
Thanks for any help...