How do I transport vehicles? [Solved]

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
linksith
Command Sergeant Major
Command Sergeant Major
Posts: 284
Joined: Mon Jul 12, 2010 12:19 pm
Projects :: Waaay too many projects
Games I'm Playing :: too many
xbox live or psn: me has no xbox
Location: looking for a wifi connection

How do I transport vehicles? [Solved]

Post 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
Last edited by linksith on Sat Sep 18, 2010 2:06 pm, edited 1 time in total.
User avatar
Jendo7
Sith
Sith
Posts: 1304
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Re: How do I transport vehicles?

Post 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."
User avatar
[TFA]Padawan_Fighter
High General
High General
Posts: 806
Joined: Wed Mar 25, 2009 3:37 pm
Projects :: Ha - as if I will ever get back to them
Games I'm Playing :: SWBF2 ARK EliteDngrs
xbox live or psn: No gamertag set
Location: Lost at sea

Re: How do I transport vehicles?

Post by [TFA]Padawan_Fighter »

Interesting, I didn't know you could teleport vehicles.
User avatar
linksith
Command Sergeant Major
Command Sergeant Major
Posts: 284
Joined: Mon Jul 12, 2010 12:19 pm
Projects :: Waaay too many projects
Games I'm Playing :: too many
xbox live or psn: me has no xbox
Location: looking for a wifi connection

Re: How do I transport vehicles?

Post 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.
Post Reply