Detection of NULL cells when going through load doors - how?

Post » Sun Feb 22, 2015 11:31 pm

Anyone know how to detect when a Cell variable becomes NULL?

I'm finding that when moving from an exterior to an interior cell, the Cell variable becomes NULL while maintaining a valid Cell form.

For e.g., I'm using GetNthRef () to find 10 activators at a time during an OnUpdate () interval. And when moving from an exterior to an interior cell, and vice-versa, the Cell becomes invalid and GetNthRef () fails.

Here's a snippet of the log. Note the output for Debug.Trace () of "kuSMFPlayerFindTrapsS.layDownMarkers currentCell [Cell ]" in the first line. The GetNthRef immediately after results in an "Unable to call GetNthRef" error, in the next line, because the cell has become "[ (0000964A)]" as displayed in the second line and in the error message immediately after. As shown in the logs, once the dungeon loads, the cell variables becomes a valid cell, "[Cell ]".

Because [ (0000964A)] is still a valid cell as shown by the Debug.Trace output of "(currentCell as Cell) [Cell < (0000964A)>]", my condition to check for valid cells of "If currentCell as Cell" accepts "[Cell < (0000964A)>]" as a valid and allows my code to run "GetNthRef ()" on it which produces the error.

Does anyone else have any way to checking if a form is an actual valid form?

[02/22/2015 - 07:46:34PM] kuSMFPlayerFindTrapsS.layDownMarkers [Cell ] (currentCell as Cell) [Cell ][02/22/2015 - 07:46:38PM] kuSMFPlayerFindTrapsS.layDownMarkers [Cell < (0000964A)>] (currentCell as Cell) [Cell < (0000964A)>][02/22/2015 - 07:46:38PM] error: Unable to call GetNthRef - no native object bound to the script object, or object is of incorrect typestack:[ (0000964A)].Cell.GetNthRef() - "" Line ?[alias Player on quest kuSMFQ (2F000D62)].kusmfplayerfindtrapss.layDownMarkers() - "kuSMFPlayerFindTrapsS.psc" Line 706[alias Player on quest kuSMFQ (2F000D62)].kusmfplayerfindtrapss.OnUpdate() - "kuSMFPlayerFindTrapsS.psc" Line 32[alias Player on quest kuSMFQ (2F000D62)].kusmfplayerfindtrapss.OnPlayerLoadGame() - "kuSMFPlayerFindTrapsS.psc" Line 12THEN FURTHER DOWN[02/22/2015 - 07:46:39PM] error: Unable to call GetNthRef - no native object bound to the script object, or object is of incorrect typestack:	[ (0000964A)].Cell.GetNthRef() - "" Line ?	[alias Player on quest kuSMFQ (2F000D62)].kusmfplayerfindtrapss.layDownMarkers() - "" Line ?	[alias Player on quest kuSMFQ (2F000D62)].kusmfplayerfindtrapss.OnUpdate() - "kuSMFPlayerFindTrapsS.psc" Line 32[02/22/2015 - 07:46:39PM] kuSMFPlayerFindTrapsS.layDownMarkers [Cell ] (currentCell as Cell) [Cell ]
For completeness, here's my code that produces the error above:

Debug.Trace ("kuSMFPlayerFindTrapsS.layDownMarkers " + currentCell + " (currentCell as Cell) " + (currentCell as Cell))If currentCell as CellactivatorRef = currentCell.GetNthRef (lastGetNth, 24);24 = activatorEndIf
User avatar
Teghan Harris
 
Posts: 3370
Joined: Mon Mar 05, 2007 1:31 pm

Return to V - Skyrim

cron