(sysFindObject not always finding "the Object"

These are old bug reports that have been closed.
Locked
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

I have a simple search for a single object in a system inside a <OnGlobalSystemCreated>, using a station with the attribute "xyz" and using (sysFindObject nil "T:xyz") 4 out of 5 times it finds the object. The object IS being placed 5 out of 5 times. Every time I test I check and it's really there.

What is the reason why sysFindObject would not be able to find an object that is in the system? What can be done about it? I fixed the search by stacking the (sysFindObject code to insure that the object was found EVERY time, but that seems a little bit brutal to me.

Is it vital that an object be used in sysFindObject such as (sysFindObject gSource "T:xyz")?

Nil seems to work fine, and I don't have an object to attach the search to- but there is this little bug with not getting back what is being searched for occasionally.
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Nil is a perfectly valid parameter instead of gSource for "T:xyz". The object is only used when a criteria needs a point of reference (such as "N")

The key is to understand what changes between the time that it finds it and the time that it doesn't.

Is there an ordering problem? Is the object being created (somehow) after OnGlobalSystemCreated gets called? How is the object being created?
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

The object is created in the system <Station type=>

I think it turns out that it was "inheriting" an error.

I have a part of the code looking for gateID and linkID. Whenever <Node ID="EndGame"> is present it throws the whole thing off- even though I wrote in several layers of (if (eq nodeID "EndGame") .. trying to avoid it. For some reason, after the EndGame is handled and avoided as a viable gate link the next cycle seems to have some difficulties. Should I try resetting all the variables for each cycle?
Locked