Crashing code question.

Post » Fri Dec 04, 2015 12:47 pm

Hi,

Does anyone know why the following code crashes the game if I run it in an OnPlayerLoadGame event? If I use Utility.Wait(10) it works unreliably. When I have this code run by, for example, equipping an item (OnObjectEquipped event) it works fine.

Anyone any ideas?

Game.UpdateHairColor()Game.UpdateTintMaskColors()NiOverride.ApplyOverrides(thPlayer)NiOverride.ApplyNodeOverrides(thPlayer)
User avatar
Lauren Dale
 
Posts: 3491
Joined: Tue Jul 04, 2006 8:57 am

Post » Fri Dec 04, 2015 7:38 am

Hmm, I don't use these commands myself, so can't say there's any particular issue, but... From personal experience with some other commands, sometimes they do not run properly if ran 'too soon' after another event. For example, spawned furniture will not work properly if you activate it immediately after. It could be that one of the commands is glitching out when the Script actually fires... You could place a ; at the start of three lines, and work through it that way to find precisely which one is triggering the crash?

If it works on Equipping an item, why not assign it to an item, and have the reload equip the item, unequip it, and then remove it? Or maybe see what happens if you put it in a function, and fire the function?

User avatar
Elea Rossi
 
Posts: 3554
Joined: Tue Mar 27, 2007 1:39 am

Post » Fri Dec 04, 2015 3:54 pm

Please post the error from the papyrus.log as that will give a better idea on what is wrong.

Well ninja kinda.

ahh nevermind. A Crash wont report the error.

User avatar
Sandeep Khatkar
 
Posts: 3364
Joined: Wed Jul 18, 2007 11:02 am


Return to V - Skyrim