Thread: Null exception
View Single Post
  #12  
Old 03-18-2012, 10:13 PM
Smokeynz Smokeynz is offline
Approved Member
 
Join Date: Apr 2011
Posts: 106
Default

Think this explains what I am seeing, 3. Don’t kill objects too soon.

http://codebetter.com/raymondlewalle...ses-in-vb-net/

But the problem for CLOD, the Onactorcreated creates an array of objects, actors which are part of play.
If you test those objects later, and they have been destroyed by play or despawning routines, they don't exist, so either the reference of "null" or the actor reference will throw an exception. For null there has to be an array member to state "are you null" .

So with that, incounting exceptions of objects with no reference, it may require double listing arrays. The game creates an internal onactorcreated, you might have to create a second array to test the actors condition upon.

Kinda a test of "are you alive" by comparing existance of that actor in both arrays. In play that actor meets its fate, is despawned or hangs around. In 2 of these you may incounter an object reference error if trying to clear the decks of clutter. With a second array "null" is not important, because you test against the array with array, not the "object actor" which may be automatically cleared from the onactorcreated array.

confused, i am.

if I am on the right track in this, we need a method to avoid object exception when dealing with object/actor tracking over the mission period. Considering that the base mission has potential to be 24/7

in summary

objects/actors can lose references to themselves so that even the "null" test has no reference. this thows an exception object without a reference.
Reply With Quote