Teleport between map copies?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
Conmon
Posts: 79
Joined: Thu Aug 14, 2008 9:18 pm

Teleport between map copies?

Post by Conmon »

I felt particularly inspired by TNT's "Wormhole" map, and I'm looking to do a similar sort of design -

HOWEVER, rather than just using teleporters to jump to a copy of the level, but a handful of map units away, I want to have a weapon that will do the same thing, BUT it will teleport you to the corresponding location in the map copy.

(e.g. you're walking through a junction in some sci-fi hallway, fire your Teleport weapon, and you teleport to the "dilapidated past" version of the same place, but in your exact same location)

I hope that makes sense ~ I'm just seeing in what way that would be feasible, or where to start :)
Mordeth
Posts: 20
Joined: Wed Dec 03, 2003 6:13 am
Contact:

Re: Teleport between map copies?

Post by Mordeth »

I have something similar, although I'm still not quite sure if it will make the final cut. This initiated not by a weapon, but by a monster's projectile. But the principle is more or less the same.

It works by using an attack (in your case, self-inflicted by your own weapon firing) with a custom damagetype, and using the corresponding painstate for that damagetype to invoke a script. This script does a SetActorPosition for the calling actor (ie your player), using his current position and adding x/y/z so he ends up in the map copy in the same relative position. To get the player back, the script remembers his original coordinates and transports him back after a certain amount of time has lapsed.

The big hurdle lies not with this script, but in crafting that map copy. The map copy should have exactly the same collision boxes as in the original, otherwise you'll risk your player getting stuck in architecture. Iit should have at least the same amount of moving space as the original map section. Even adding rubble to a now crumbled hallway might result in getting the player stuck. This gets even more complicated if you want to set up a 2-way teleportation. And there's the issue of roaming monsters which may or may not inhabit the exact coordinates you want to teleport your player to.
User avatar
Conmon
Posts: 79
Joined: Thu Aug 14, 2008 9:18 pm

Re: Teleport between map copies?

Post by Conmon »

Yeah, I'm now coming to grips with how many problems that kind of gameplay would create - why bother using bullets when you can just telefrag everything in the map? Interesting point about the collision, too. Argh!

Maybe some kind of ACS execution that triggers a map warp - visually appealing but a lot of work. Floors shift, walls change textures, monsters teleport away, etc.

I might just stick with static teleports at this point :|
Post Reply

Return to “Scripting”