teleporters...or whatever they are called... (FAQ)
Moderator: Moderators
-
- Jedi
- Posts: 1119
- Joined: Sat Apr 23, 2005 8:52 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
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?
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?
- [RDH]Zerted
- Gametoast Staff
- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
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.
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.
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...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!
- [RDH]Zerted
- Gametoast Staff
- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
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.
- trainmaster611
- Sith Lord
- Posts: 1779
- Joined: Thu Aug 24, 2006 5:22 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Building a railway to Coruscant
- Contact:
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.Maveritchell wrote:Uncalled for. Just don't.1z2x3c wrote:I
want to know what maps tooooooooo
[EDIT] Oh, so Penguin did. Nice tutorial!
Last edited by trainmaster611 on Fri Aug 17, 2007 6:09 pm, edited 2 times in total.
-
- 3rd Warning
- Posts: 259
- Joined: Mon Jul 16, 2007 3:22 am
-
- Jedi
- Posts: 1119
- Joined: Sat Apr 23, 2005 8:52 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
I got in-vehicle teleporting working, just had to GetCharacterVehicle instead of GetCharacter Unit.
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:
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.
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 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")
Credits to all who worked on the original MoveEntitytoNode function + Me. Thanks also to Penguin if the above doesn't include her.