teleporters...or whatever they are called... (FAQ)

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

BountyHunterV

Post by BountyHunterV »

thanks a bunch, penguin! it works fine now
Ace_Azzameen_5
Jedi
Jedi
Posts: 1119
Joined: Sat Apr 23, 2005 8:52 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by Ace_Azzameen_5 »

SetEntityMatrix, eh?

With this, we could do space heros with hero fighters.

REplace the OnEnter Region with OnCharacterSpawnCLass....end, hero_odfname) Send em to a secret area with their ship + one way collision and voila!

*EDIT*
I need help. How could I teleport vehicles as well as units? Is there some kind of CharacterVehicle function? I also need help just executing functions on a specific spawned vehicle, so you'd be killing two birds for me.

I'd settle for spawning a new vehicle at the destination path (via a VehicleSpawn) and forcing players out of the old vehicle and into the new one but I don't know how to do this either.

Looking at the functions list, all I see that looks close is ForceAIOutOfVehicles, maybe it could be modifed. OR is there a more obscurely named function?
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:

Post by [RDH]Zerted »

You can force units to enter vehicles. Its in this forum somewhere...

Why send them to a secret area with their ship, when you could just spawn the ship outside and force them in it?

I assume forcing a unit to enter a vehicle when its already in a different vehicle would still work. The code wouldn't change.
BountyHunterV

Post by BountyHunterV »

Ace_Azzameen_5 wrote:With this, we could do space heros with hero fighters.

REplace the OnEnter Region with OnCharacterSpawnCLass....end, hero_odfname) Send em to a secret area with their ship + one way collision and voila!
if we can do that, then we can completely organize the spawning of units...all troopers + heavy troopers spawn near the front lines, all engineers spawn near vehicles, all snipers spawn in elevated areas away from combat...
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:

Post by [RDH]Zerted »

Yup, completely doable. If you ever play a Deathmatch map (mode is in the SWBF1 map pack), you will notice that you respawn as soon as you die, no waiting for the respawn counter. If you are going to take it as far as only allowing units to spawn at certain areas, you might as well go around the 15 second counter too. Human players can always change units at a CP.
User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

Post by trainmaster611 »

Maveritchell wrote:
1z2x3c wrote:I
want to know what maps tooooooooo
Uncalled for. Just don't.
Ugh, we already said Pwnfest. So is teleporters the correct term for that? Someone needs to contact ITfactor and ask him how he did it or ask him who taught him.

[EDIT] Oh, so Penguin did. Nice tutorial!
Last edited by trainmaster611 on Fri Aug 17, 2007 6:09 pm, edited 2 times in total.
1z2x3c
3rd Warning
3rd Warning
Posts: 259
Joined: Mon Jul 16, 2007 3:22 am

Post by 1z2x3c »

if you look up you will see the tut!!!! he he did you miss it!!!
Ace_Azzameen_5
Jedi
Jedi
Posts: 1119
Joined: Sat Apr 23, 2005 8:52 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by Ace_Azzameen_5 »

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.
Penguin
Jedi Admin
Jedi Admin
Posts: 2541
Joined: Sun Mar 05, 2006 12:00 am
Location: Australia

Post by Penguin »

All I did was write the tutorial, I never made the script, It was archer07 and zerted(i think) who did it.
Post Reply