The online racing simulator
#1 - sun
ok to leave server without losing cash
Ok. I think you have to set the co-ordinates to the pit garages if you want to leave safely. Or set it. correct me if am wrong. Regards Owen.
#2 - Woz
Quote from sun :Ok. I think you have to set the co-ordinates to the pit garages if you want to leave safely. Or set it. correct me if am wrong. Regards Owen.

You need to work out the bounding rectangle of the garage block and make sure the car is currently in there unless there is an "in garage" message from insim.
Quote from Woz :You need to work out the bounding rectangle of the garage block and make sure the car is currently in there unless there is an "in garage" message from insim.

I have this realisation in luaLFS. Set any points (x,y) of area i may know car into this area or not
#4 - sun
Ok. Cheers

-- x1,y1, x2,y2 - start and end points of line (edge of area)
-- xa,ya - coordinate of car
function across(x1,y1,x2,y2,xa,ya)
local ymax,ymin
if (y1 < y2) then
ymax = y2
ymin = y1
else
ymax = y1
ymin = y2
end

local y = (xa-x1)*(y2-y1)/(x2-x1) + y1

if ((xa == x1) and (ya == y1)) or ((xa == x2) and (ya == y2)) then
return 2
elseif ((x1 == x2) and (xa == x1) and (ya >= ymin) and (ya <= ymax)) then
return 2
elseif ((x1 < x2) and (xa >= x1) and (xa <= x2)) or ((x1 > x2) and (xa <= x1) and (xa >= x2)) then

if (ya >= y) and (ymin <= y) then
return 1
end
end
return 0
end

function in_area(points,x,y)
local trig = 0
local temp

-- #points - number of points
for i=2,#points/2 do
temp = across(points[i*2-3],points[i*2-2],points[i*2-1],points[i*2-0],x,y)
if (temp == 2) then
return true
elseif (temp == 1) then
trig = 1 - trig
end
end
temp = across(points[#points-1],points[#points-0],points[1],points[2],x,y)
if (temp == 2) then
return true
elseif (temp == 1) then
trig = 1 - trig
end
if (trig == 1) then return true else return false end
end


local area = {18379340,2221338, 17468965,1976709, 17309117,2608274, 18208925,2855925}
local into_area = in_area(area, mci.compcar[DRAG.PLIDS[i]].x,mci.compcar[DRAG.PLIDS[i]].y)
if (into_area) then
...
end

#6 - sun
thanks
#7 - sun
Hi

i have another prblem now. The InSim had decided to not load propley so now i cant see my buttons neither my commands.

Can any one help ?

Regards

Owen.
Is this your insim or someone's server insim?

If it's yours trying getting them to restart it, if not then have ago with the server insim port for example, your port number is 11111.

Close the insim
in LFS type /insim=11111
In LFS type again /insim=11111 (This would close the port and reopen it)
Then start your insim back up.

If this doesn't work maybe someone of the coding is corupted?

Hope this helps,

Matty

FGED GREDG RDFGDR GSFDG