ok so you MUST know the vehicle (e) number and you MUST place the 12 characters around it straight after you place the vehicle
note i placed them from top left in a clockwise fashion
(the back 3 will be placed at the front as well however - see pic)
picture for layout
edit, this is my example path (i have now hit an error with my testing - collision isnt working as it did before - it keeps kicking me out of the space rather than keeping me inside it)
vehicleN = 2
barrierN = vechileN + 1
--resize the vechile
Scale(vehicleN, 400); --wooden pallet
waypoint = {}
endwaypoint = 10
for a = 1, endwaypoint do
waypoint[a] = 0
end
function transportpath_main(e)
------
--player enters transport
if nextwp == 1 then
if waypoint[nextwp] == 0 then
distance = 1
settransport(e)
end
end
-----
-------
--move forward 100
if nextwp == 2 then
if waypoint[nextwp] == 0 then
distance = 100
waypoint[nextwp] = 1
end
transportforward(e)
end
-------
-------
--turn left 45
if nextwp == 3 then
if waypoint[nextwp] == 0 then
turnleft = 45
waypoint[nextwp] = 1
end
transportleft(e)
end
--------
-------
--move forward 300
if nextwp == 4 then
if waypoint[nextwp] == 0 then
distance = 300
waypoint[nextwp] = 1
end
transportforward(e)
end
-----
-------
--turn right 90
if nextwp == 5 then
if waypoint[nextwp] == 0 then
turnright = 90
waypoint[nextwp] = 1
end
transportright(e)
end
------
---------
--move forard 300
if nextwp == 6 then
if waypoint[nextwp] == 0 then
distance = 300
waypoint[nextwp] = 1
end
transportforward(e)
end
-------
if nextwp > endwaypoint then
nextwp = endwaypoint + 1
end
Prompt("distance remaining = " .. distance .. " nextwp = " .. nextwp .. " gateshut = " .. gateshut)
nextwaypoint(e)
end
and this requires some functions from inside globals
----
distance = 0
turnleft = 0
turnright = 0
gateshut = 0
nextwp = 0
----
--------
function settransport(e)
--hide the characters around the transport from veiw (invis barriers)
--for N = barrierN, barrierN + 11 do
-- Hide(N)
--end
--check player location
PlayerDX = g_Entity[e]['x'] - g_PlayerPosX; PlayerDY = g_Entity[e]['y'] - g_PlayerPosY; PlayerDZ = g_Entity[e]['z'] - g_PlayerPosZ;
PlayerDist = math.sqrt(math.abs(PlayerDX*PlayerDX)+math.abs(PlayerDY*PlayerDY)+math.abs(PlayerDZ*PlayerDZ));
--if player enters the vehicle
if PlayerDist < 80 then
--lock player into vehicle
if gateshut == 0 then
--moves rear barrier(back 3 characters) into place
MoveBackward(vehicleN + 7, 130); MoveBackward(vehicleN + 8, 150); MoveBackward(vehicleN + 9, 130);
gateshut = 1
distance = 0
waypoint[nextwp] = 1
end
end
end
--------
--------
distance = distance * 10
function transportforward(e)
if distance > 0 then
for N = vehicleN, barrierN + 11 do
MoveForward(N, 1)
end
distance = distance - 1
end
end
--------
--------
distance = distance * 10
function transportbackward(e)
if distance > 0 then
for N = vehicleN, barrierN + 11 do
MoveBackward(N, 1)
end
distance = distance - 1
end
end
--------
--------
function transportleft(e)
if turnleft > 0 then
for N = vehicleN, barrierN + 11 do
MoveForward(N, 2)
RotateY(N, -1)
end
turnleft = turnleft - 1
distance = turnleft
end
end
----------------
----------------
function transportright(e)
if turnright > 0 then
for N = vehicleN, barrierN + 11 do
MoveForward(N, 2)
RotateY(N, 1)
end
turnright = turnright - 1
distance = turnright
end
end
--------
--------
function nextwaypoint(e)
if distance < 1 then
nextwp = nextwp + 1
end
end
--------
let me know if you get it working or can help expand it... i think this could be useful until real transport gets included (looks like it'll be a couple months yet)
life's one big game
windows vista ultimate
i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11