Path nodes not accurately teleporting

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
MetalcoreRancor
Brigadier General
Brigadier General
Posts: 628
Joined: Thu Jun 07, 2007 11:13 am
Projects :: No Mod project currently.
Games I'm Playing :: swbf origin
xbox live or psn: No gamertag set

Path nodes not accurately teleporting

Post by MetalcoreRancor »

I have my code and regions/paths set up properly in ZE and everything, but instead of teleporting to the right spot I end up either far away in some cases, or very close to where I entered the region. There is no rhyme or reason to why I cant travel to where the nodes I specify.
Hidden/Spoiler:
Lua teleport coding

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

OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"Room1")
end,
"Room1Region"
)
ActivateRegion("Room1Region")

OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"Room0")
end,
"Room0Region"
)
ActivateRegion("Room0Region")


OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"Room5")
end,
"Room2Region"
)
ActivateRegion("Room2Region")


OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"Room3")
end,
"GotoRoom3"
)
ActivateRegion("GotoRoom3")



OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"Room1")
end,
"gotoroom1"
)
ActivateRegion("gotoroom1")



OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"Room4")
end,
"Gotoroom4"
)
ActivateRegion("Gotoroom4")


OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"Room0")
end,
"gotoroom0"
)
ActivateRegion("gotoroom0")


OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"Room1")
end,
"room1wall"
)
ActivateRegion("room1wall")


OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"Room0")
end,
"room0wall"
)
ActivateRegion("room0wall")
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Path nodes not accurately teleporting

Post by [RDH]Zerted »

Teleporting is a super fast run to the location. It isn't always exact. It seems to work best when you're further away. Every once in a while you won't make it through a wall. Do you ever overshoot the node or are you always stopped before it?
MetalcoreRancor
Brigadier General
Brigadier General
Posts: 628
Joined: Thu Jun 07, 2007 11:13 am
Projects :: No Mod project currently.
Games I'm Playing :: swbf origin
xbox live or psn: No gamertag set

Re: Path nodes not accurately teleporting

Post by MetalcoreRancor »

I think its the combination of that, plus I am referencing nodes more then once. I'm going to try to reference unique spawn nodes for each one and see if it improves.
Post Reply