SWBFGamers

Modding for the Original SWBF1 and SWBF2 => SWBF1 Modding => Topic started by: Breakdown on June 16, 2009, 06:21:31 AM

Title: Teleporters
Post by: Breakdown on June 16, 2009, 06:21:31 AM
Hi guys

I know this probably isn't the best place to ask (we don't have many modders), but do you think teleporters are posible to make in SWBF1? I've seen it in SWBF2, but I can't think of anything how it could work in SWBF1.

Thanks,
BD
Title: Re: Teleporters
Post by: Hardcore on June 16, 2009, 09:21:34 AM
Can you explain how it was done in SWBF2 if you happen to know?
Title: Re: Teleporters
Post by: MileHighGuy on June 16, 2009, 11:00:17 AM
its handeled in bf2's Zero Editor, and not possible in bf1, but you could possiby make and underground tunnel and skin it like a 'portal'  :shrug: and make it lead to were you want
Title: Re: Teleporters
Post by: Hardcore on June 16, 2009, 02:23:57 PM
I find that most things in SWBF2 that are not thought to be possible in SWBF1 are, they just have to be looked at in a different way, can i get a name for a map with a teleporter in it from SWBF2?
Title: Re: Teleporters
Post by: MileHighGuy on June 16, 2009, 02:40:46 PM
i dont believe it was used in any stock maps, but i know it is used in "games complex" by the itfactor and that map is not released
Title: Re: Teleporters
Post by: Breakdown on June 16, 2009, 02:42:01 PM
Yes, that was where I saw it, wasn't it in another one of his maps?
Title: Re: Teleporters
Post by: Maveritchell on June 17, 2009, 11:07:05 AM
Quote from: "MileHighGuy"its handeled in bf2's Zero Editor, and not possible in bf1, but you could possiby make and underground tunnel and skin it like a 'portal'  :shrug: and make it lead to were you want
It's not done at all in zero editor; it's a lua-only thing. You can use a number of things to make it happen (some of which you can place in ZeroEditor), but it is entirely depended on how different the lua functions are between 1 and 2.

Look at the tutorials on Gametoast for how to do it, I assume you can still do paths and regions in SWBF1 ZE. That is all you need for the simplest version. If the code doesn't work (if you can't grab entity matrices like in 2), then it won't work.
Title: Re: Teleporters
Post by: Breakdown on June 17, 2009, 03:40:10 PM
Thanks Mav, I'll look into it..
Title: Re: Teleporters
Post by: Hardcore on June 17, 2009, 10:09:09 PM
function(regIn,character) I'm pretty sure this line alone would not work in SWBF1 as making units regin is not possible in SWBF without taking a life i'm pretty sure? and i would highly suggest its not possible to keep the current stats/health, meaning it would be a free way to get full ammo/health.
Title: Re: Teleporters
Post by: Maveritchell on June 17, 2009, 11:52:20 PM
Quote from: "Hardcore"function(regIn,character) I'm pretty sure this line alone would not work in SWBF1 as making units regin is not possible in SWBF without taking a life i'm pretty sure? and i would highly suggest its not possible to keep the current stats/health, meaning it would be a free way to get full ammo/health.
"regIn" is not "regen;" it doesn't matter what that's called, it's just a function input.

It's also worth mentioning that the line of code you posted is completely arbitrary because what's going on behind the scenes is a GetPathPoint() and then SetEntityMatrix() for whatever character enters a region.

Like I said, the code is simple. I don't remember exactly what that tutorial says, but the gist of a "teleporter" as it describes (enter region, move to path node) works like this:
1) Define a region in ZE (name and properties are the same, call it "teleregion" or whatever)
2) Make a path in ZE (call it whatever you want; ex "telepath")

All the region serves is the purpose of getting data for the character because OnEnterRegion is an easy way to do that. Some sample code might look like this:

ActivateRegion("teleregion")
teleportbasic = OnEnterRegion(
function(region, player)
if player then
SetEntityMatrix(GetCharacterUnit(player), GetPathPoint("telepath", 0)
end
end,
"teleregion"
)
In the above code:
teleportbasic: arbitrary variable set equal to the function for clarity's sake
"GetCharacterUnit(player)" may just need to be "player", I don't remember offhand and don't have any of my code nearby to check.
GetPathPoint("telepath", 0): first input is path name, second is path node (path node 0 is the default first node in a path)

It's really easy to set up, but if SWBF1 luas don't support the OnEnterRegion() function or any of the other callbacks used above (notably important is SetEntityMatrix); then there's no real effective way to do what you want.
Title: Re: Teleporters
Post by: Breakdown on June 18, 2009, 05:57:15 AM
I tired a quick tutorial Penguin made on GT, but I only really tried it once and it didn't work, though knowing me there was a mistake I didn't bother rechecking because I got sick (No, I really did, not an excuse :P)

I will try out what you have posted Mav, thanks a ton! Very helpful
Title: Re: Teleporters
Post by: Radical_Pi on June 18, 2009, 07:21:18 PM
hey, I came up with an idea for how this could be cool

There is a 3-section battlefield. Each section is completely isolated from the other, with no way to cross the barrier other than by teleport. Each side of the field is identical in shape, but you can have one futuristic, one now, and one in the past. This way it's a time machine. Possibly each one comes out near a CP that is usually the enemy's to symbolize the change in power over time

just an idea
Title: Re: Teleporters
Post by: Unit 33 on June 23, 2009, 01:52:39 PM
Now that's a cool idea Pi, I've always liked the idea of a fractured time and place map...
Perhaps one part of the battlefield could be of one place in some obscure era,
while other two areas are completely different ! Crazy !
EhPortal 1.34 © 2024, WebDev