Page 1 of 1

How do I transport vehicles? [Solved]

Posted: Thu Sep 16, 2010 8:49 am
by linksith
Hi, I've added a transporter to my map to make sure it will work for what I want. The infantry will transport but vehicles won't get transported. Is there any way I can get the region to transport vehicles? Thanks.

NOTE: In case you don't know what I'm talking about when I say "transporter", you'll find the answer here

Re: How do I transport vehicles?

Posted: Thu Sep 16, 2010 11:15 am
by Jendo7
This is from
Ace_Azzameen_5: bottom of page 2

http://www.gametoast.com/forums/viewtop ... 4&start=20

"I got in-vehicle teleporting working, just had to GetCharacterVehicle instead of GetCharacter Unit.

Code: Select all

--
-- MoveEntitytoNode for Star Wars Battlefront II Copyright (c) Sometime, Penguin et Al, All rights reserved.
-- Star Wars Battlefront II and Zero Engine Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
function MoveEntityToNode(entIn,pathIn,nodeIn)
if not entIn then
print("Warning!: Entity not specified for move")
return false
elseif not pathIn then
print("Warning!: Path not specified for Entity " .. entIn .. " move")
return false
end

local node
if nodeIn then
node = nodeIn
else
node = 0
end

local locDest = GetPathPoint(pathIn,node)
local charUnit = GetCharacterUnit(entIn)
local charVeh = GetCharacterVehicle(entIn)
if charVeh then
SetEntityMatrix(charVeh,locDest)
elseif charUnit then
SetEntityMatrix(charUnit,locDest)
return true
end
return false
end
This script will teleport people or vehicles.

This is from a "Do file" setup so put it in its own lua. add it to data_abc\common\mission.req and put Script_CBDoFile("teleportLUAFILENAME") at the top of your mission LUA. Also, this:

Code: Select all

 --Teleporter Set up and Call
OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"TeleportNode")
end,
"TeleportRegion"
)
ActivateRegion("TeleportRegion")
needs to be added to ScriptPostLoad. Please refer to Penguin's instructions what else needs to be down to install.

Credits to all who worked on the original MoveEntitytoNode function + Me. Thanks also to Penguin if the above doesn't include her."

Re: How do I transport vehicles?

Posted: Fri Sep 17, 2010 1:42 am
by [TFA]Padawan_Fighter
Interesting, I didn't know you could teleport vehicles.

Re: How do I transport vehicles?

Posted: Sat Sep 18, 2010 2:05 pm
by linksith
Thanks a ton! It works like a charm. I had no idea they had added that to the same thread, I just kept looking at Penguin's post instead of looking at the other pages.