now i have an array of checkpoints global and positions as part of a vehicle type
and i have a current and next pointervariable to keep track of where you are in relation to the checkpoints
now that part works for laps and the placing of crashed vehicles etc
1>The problem is there is up to a maximum of 9 positions a player can be at any one time which is a different number to the number of checkpoints
the array positions has an array of position textures and im not sure how i can add that to work preferably update at each checkpoint
2> a minor issue is detecting the wrong way at the bottom of function
function trackCheckpointCheck(vehicle ref as vehicle,id as integer)
p1 as tPoint :i as integer
p1.x=getObjectWorldX(vehicle.hit)
p1.z=getObjectWorldZ(vehicle.hit)
d1 as float:d1 = abs(DistanceXZXZ(p1.x,p1.z,lpaths[0].nodes[vehicle.CurrentCheck.counter].x,lpaths[0].nodes[vehicle.CurrentCheck.counter].z))
d2 as float:d2 = abs(DistanceXZXZ(p1.x,p1.z,lpaths[0].nodes[vehicle.nextCheck.counter].x,lpaths[0].nodes[vehicle.nextCheck.counter].z))
print(vehicle.currentCheck.counter)
if vehicle.checkPoints[vehicle.nextCheck.counter]=0 and d2<d1
vehicle.place = places[vehicle.nextCheck.counter].no[vehicle.laps]
//SetObjectImage(vehicle.position,positions[1],1) //set the texture positions is an array of textures
inc vehicle.place
places[vehicle.nextCheck.counter].no[vehicle.laps] = vehicle.place
dec vehicle.checkPoints[vehicle.currentCheck.counter] //= 1 //now becomes a past checkpoint
//save the location for when you go off track so you can return to previos checkpoint
///////////////////////////////////////////////////////////////////////////////////////////
vehicle.savePos = 1
vehicle.lastGoodX[vehicle.savePos] =GetObjectX(vehicle.hit)
vehicle.lastGoodY[vehicle.savePos] =GetObjectY(vehicle.hit)
vehicle.lastGoodZ[vehicle.savePos] =GetObjectZ(vehicle.hit)
vehicle.lastGoodAY[vehicle.savePos] = GetObjectAngleY(vehicle.hit)
/////////////////////////////////////////////////////////////////////////////////////////
vehicle.currentCheck.counter =vehicle.nextCheck.counter
if vehicle.nextCheck.counter < lpaths[0].nodes.length
vehicle.nextCheck.counter = vehicle.currentCheck.counter+1
else
inc vehicle.laps:vehicle.currentCheck.counter=0: vehicle.nextCheck.counter=1
for i=0 to places.length
vehicle.checkPoints[i]=0
i2 as integer:for i2 = 0 to places[i].no.length
places[i].no[i2]=0
next i2
next i
if vehicle.laps=totalLaps /// loop cutback this way
winner.name= vehicle.Name
winner.flag=1
endif
endif
elseif d1<d2 and vehicle.checkPoints[vehicle.currentCheck.counter]=1
SetObjectImage(vehicle.position,wrongwayImg,1)
//dec vehicle.currentCheck.counter
//if vehicle.currentCheck.counter<=0 then vehicle.currentCheck.counter=vehicle.checkpoints.length
endif
Thanks for any help anyone can give