Does OnInit() fire on save game load?

Post » Wed Jun 20, 2012 11:19 am

Can't really test myself right now as I currently crash on load due to my CPU overheating (damn this terrible thermal paste I just bought..)

I'm curious to know though, does oninit() fire on loading save games, or does it only run when the mod/script is first loaded?

I need to implement a feature that should only ever happen when the script is first loaded. I was wondering if OnInit does this job? Was going to attach it to a player reference in a quest, OR attach it to the quest itself. The quest is simply used as a hub for the scripts I want to be running in the mod I am making, it's not a "real" quest in the gameplay sense.
User avatar
Nana Samboy
 
Posts: 3424
Joined: Thu Sep 14, 2006 4:29 pm

Post » Wed Jun 20, 2012 4:58 am

OnInit() will fire on savegame load, but only the first time or if the owner resets and not upon consecutive loads. SKSE is working on an OnGameLoaded() event which will fire every save load.

Thermal paste: Arctic Silver 5 or IC Diamond are very good, both with great thermal conductivity.
User avatar
Marcin Tomkow
 
Posts: 3399
Joined: Sun Aug 05, 2007 12:31 pm

Post » Wed Jun 20, 2012 9:54 am

So, if I have it so on a hidden quest script that it unequips all items, it will -only- do that the first time the mod/script is loaded? The script I would put this in would only have one fucntion, and it's to establish oninit stuff like unequipping items when a player first loads the mod, and displaying a "Mod Activated!" message.

I don't plan on manually resetting such a script but then again, I have no clue if the game would reset it, and if so, how it gets reset (so I can avoid causing it to reset my script).

Also, I think my heatsink itself somehow became bad because even with fresh thermal paste I still can't run games for more than 30 seconds without causing a hard-freeze anymore :\
User avatar
Rik Douglas
 
Posts: 3385
Joined: Sat Jul 07, 2007 1:40 pm

Post » Wed Jun 20, 2012 5:46 am

OnInit(): Correct, and if you don't reset it, it shouldn't do so on its own.

Heatsink: Hmmm... Make sure you use some rubbing alcohol and a coffee filter or other lint free object to thoroughly clean both the CPU and heatsink surfaces. If using AS5, use the cross pattern as that carp's so viscous. It's likely, however, that if gaming is the cause of your CTD, that your GPU is clogged w/ dust or its fan(s) are malfunctioning (check that first).
User avatar
Melung Chan
 
Posts: 3340
Joined: Sun Jun 24, 2007 4:15 am

Post » Wed Jun 20, 2012 10:18 am

If I remember correctly, scripts will be reset automatically whenever they are started if they are not set to "Run Once", but aside from that they can only be reset directly.

Cipscis
User avatar
Tiffany Castillo
 
Posts: 3429
Joined: Mon Oct 22, 2007 7:09 am


Return to V - Skyrim