Sunspot2 Posted August 13, 2020 Posted August 13, 2020 Hello all, I'm trying to make a script to reapply an effect everytime a unique actor is3dloaded and have no idea how to accomplish this. Is for a follower actor I want to reapply skeleton netimmerse changes when the actor is reloaded. The script I have applies the effect correctly, but everytime the actor is reloaded (like when crossing a door) the effect resets. Anybody have any idea how this type of thing can be done?
Monoman1 Posted August 13, 2020 Posted August 13, 2020 Attach a script to the base npc and use event Onload to run your code. https://www.creationkit.com/index.php?title=OnLoad_-_ObjectReference
Sunspot2 Posted August 13, 2020 Author Posted August 13, 2020 Please, I don't want to be a bother, but how do I attacha script to the base npc? 39 minutes ago, Monoman1 said: Attach a script to the base npc and use event Onload to run your code. https://www.creationkit.com/index.php?title=OnLoad_-_ObjectReference
Monoman1 Posted August 13, 2020 Posted August 13, 2020 You can either attach the script to a single reference or the base npc. Depends in whether you want all copies of this npc to have the effect or just a single one. If you want all copies to have it then you attach the script to the base npc under 'character -> Actor'. If you want a single reference to have it then find the reference by navigating to where you placed it in the cell view. Right click on it and edit. Look for the scripts tab.
Sunspot2 Posted August 13, 2020 Author Posted August 13, 2020 Thanks! Would you believe if I tell you I NEVER noticed there was a place to add scripts to the npc there? I will try this asap and say here if it worked. 28 minutes ago, Monoman1 said: If you want all copies to have it then you attach the script to the base npc under 'character -> Actor'.
Sunspot2 Posted August 15, 2020 Author Posted August 15, 2020 On 8/13/2020 at 8:21 AM, Monoman1 said: Attach a script to the base npc and use event Onload to run your code. https://www.creationkit.com/index.php?title=OnLoad_-_ObjectReference Not working. I don't know why.
Monoman1 Posted August 15, 2020 Posted August 15, 2020 You should attach debug.messageboxes to the Onload event before any conditions. And add Event OnUnload with a message box as well. You need to understand when the events are fired. Onload is fairly obvious. Onunload is less so. And load event won't happen until unload. Certain cell transitions won't unload an ObjRef.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.