PDA

View Full Version : Driving Line Index not the same as Driving Line Position?



rlmergeuser
04-29-2012, 11:41 PM
Hi all,

I think this question may not have an answer, but I am going to try anyways, maybe the devs can shed some light?

I am working on a track where I need to reset the rider. At a point in the track, a checkpoint trigger freezes the rider and upon a button press, the rider is unfrozen. I don't want to keep motion upon unfreeze, and I also don't want to keep position. The reason is that I wouldn't want to freeze the rider if they are in some awkward position, like almost vertical or in a 'worm' or something, and then unfreeze them and have them crash due to the freeze.

I tried the 'reset to checkpoint' feature but it is not ideal, because resetting to checkpoint costs the rider a 'Fault' on the track.

At this point I will veer a little bit - Is there a way to count faults using the scripting? I can only see player crash event, but that does not increase when the player hits 'B' to reset. I would like to know because if I could simply deduct a fault from the total faults when the reset it made, then no harm no foul. I was able to set my own 'Fault' count by using a combination of logic, crash events, and hit triggers located directly after checkpoints, but this would get extremely tedious to do for each checkpoint.

Back on topic:

I then tried the 'Reset to Driving Line' and placed a dummy object at the spot I wanted the rider to be placed. When using the driving line position of this object as my driving line index in the reset event, I found that I was not at all near the dummy object. My dummy object had a driving line position of ~11 and through trial and error, I found that a driving line index of 4 was roughly the same position as the dummy object. What gives?

Also, when resetting to driving line index, the position I want to be is on an obstacle that is not at ground level, the reset puts the driver at exactly ground level and this causes him to be reset inside an object and the bike explodes.

Is there any good workaround for this?

Thanks in advance.

rlmergeuser
05-02-2012, 06:56 PM
Answer to part of my own question:

The Driving Line index is a value from 0-100 and it represents the entire driving line broken into 100 segments.

If your driving line is 100m long then each meter is 1 index.

To use this, take the value of your driving line distance at the very end of the driving line (Might be your finish checkpoint) and store it to a data source

Then, any position on the driving line from an object info data source can be divided by this to find it's driving line index.

For example, if your track is 500 meters long and you have an object 20 meters in the track.

500/20 = 4

The driving line index would be 4 for this object.