View Full Version : Track.BeginTracksearchInDirection()

November 2nd, 2015, 06:59 PM
Something has changed in the implementation of this method between TS12 and the current TANE build and I'm tearing my hair out trying to work out just what it is.

The doumentation in track.gs reads:

// Param: direction Direction to perform the search in. The search will include the
// entirety of this stretch regardless of which direction you search in.
// ie. true will search from the beginning of the track stretch toward the end,
// false will search from the end of the track stretch toward the beginning.

Have you changed the way in which the 'beginning' and 'end' of a search are defined?

Incidentally you also have this:

// Obsolete, buggy version. Do not use.
public native GSTrackSearch BeginTrackSearch(bool direction);

I could observe that this is an instance where a message in the log would actually be really helpful. Needless to say we don't get one :o.

November 5th, 2015, 08:13 PM
Have you changed the way in which the 'beginning' and 'end' of a search are defined?


What problem are you actually having?


November 6th, 2015, 05:35 AM
On an SWT junction, I'm searching the track sections between the numbered discs and the end of track to find the lever objects. The order of vertex declaration in the junction-vertex table is manipulated in order to have the levers attach on the correct side of the track.

In TS12, GetFacingRelativeToSearchDirection() on the discovered levers returned true on one of the tracks and false on the other, giving me the information needed to work out which way to animate the levers. In TANE both searches return the same result, hence the question.

Its academic now in this application because I've changed the code to use JunctionNode.BeginTrackSearch(-1) which is giving me the answer I need.