Mirrored Teleporation

Hello everyone,

I just wanted to post here as well. I have found a way to implement mirrored teleportation into a map. What I mean by that, is that I’ve found out how to teleport you to the opposite side of a mirrored map keeping your relative position, velocity, and angle you’re looking. Here is a video show casing it.

https://www.youtube.com/watch?v=jnMGXmbs680

The map I designed is a reimagining of a Halo 3 map I made, and wasn’t designed with this concept in mind, so it is meant to be played without the teleportation, and as such it’s not used very creatively here. But I do plan to implement this technique into a map that makes better use of it in the future. The following paragrahs all detail how it works. The exact scripting can of course be found in the map itself which I’ll link to.


How it works


To start with you’ll need to set up either one teleporter as a sender and one as a receiver if you want custom equipment to be a player pickup. Eight senders and eight receivers if you want every player to have the custom equipment and the map to work in 4v4. Or 24 senders and receivers if you want the map to work in big team. Receivers should be invisible teleporters. Senders can be invisible or not. I set mine senders to visible. You put the senders outside the map so players should never see them, but if there’s some lag I’d figured visible was better.

The tricky part with teleportation in a mirrored map like this is that you can’t just shift someone’s position, you have to also change the direction they’re looking and their relative velocity. To change velocity and position involves reflecting about a plane, which normally you could do with a reflection matrix. To make this process simple I recommend centering your map around the point (0,0,0) and having your mirrored sections only differ in x coordinate. This way the teleportation would simply involve multiply the x coordinate for position and velocity by -1. By using (0,0,0) as your center and only changing your x coordinate you also make the map easier to design, as to get objects to be perfectly aligned you’d just create two of the same object and have their x coordinates inverted.

Now onto the trickiest part of the teleportation, keeping the players aim intact. To do this you’ll need your teleportation to be handled by teleporters. In A Light in the Black I handled teleportation by just shifting the players x coordinates over directly with the equipment. Unfortunately, I could not find anyway to directly change a players aiming vector. However, teleporters themselves can change your aim. So what did I do to handle this? instead of directly shifting the x coordinates, one equipment use a receiver is teleported to where you want to send the player. Then the teleporter is rotated to where you want the player to look.

Now onto how to rotate the teleporter. The Y rotation coordinate of the teleporter corresponds to where the player is looking up or down, and the Z rotation coordinate corresponds to where the player is looking side to side. The X rotation coordinate of the teleporter can be ignored. To setup the Z coordinate of the teleporter’s rotation. What you’ll want to do is setup it to the players Z coordinate but reflected about 90. How I did this was

(90-([Player Z Rotation Coordinate] -90))

Now to set the Y coordinate of the teleporter’s rotation vector you need to access the players aiming vector. The Z coordinate of the aiming vector corresponds to the up down direction of where a player is looking. I haven’t gotten any confirmation this, but it appears this is in radians. So, what you what to set the Y coordinate of the teleporters rotation vector to is

57.3*[Z coordinate of Players Aiming Vector)

57.3 isn’t perfect, but it’s as close as we can get to 180/pi. Unless there is a specific command to convert radians to degrees I missed. Anyways. Once you set the Y and Z coordinates as I specific the receiver teleporter should be in the correct direction.

The last step, warp the player to the sender teleporter. This step can be done easily if you want the custom equipment to just be a player pickup. As you’ll only have one sender and one receiver involved in this process. However, it gets tricky if you want it to work for every player.

To get this process to work for every player, there may be a more efficient way to handle this, but what I did was add all the receiver teleporters to a list and all the sender teleporters to a list. I added them to a list one by one, which is important, as you want to know the exact position of every teleporter. You’ll want to make sure that the nth receiver and nth sender in your lists are linked. So, if the 23rd receiver is zulu, the 23rd sender should be zulu, and these should be the only zulu teleporters.

After your teleporters are synced up and in their lists. I made it so the custom equipment runs a for every player script. For each player it checks if the given player is the one who activated the equipment. Once it finds the right player, then it uses the position of that player to get the correct sender and receiver teleporters and sets them to the positions and rotations I mentioned earlier. This step is crucial as otherwise you might have two players using the same receiver which would be a problem.

Specific code for all of this is in the imgur link below.

https://imgur.com/a/30OVN2M


Map Links


Map Without Teleporting (Original) - https://www.halowaypoint.com/halo-infinite/ugc/maps/f66df9f6-1cb1-4ca0-ba7f-62a4bf7ab1ae

Map with Teleporting - https://www.halowaypoint.com/halo-infinite/ugc/maps/3a7d4413-3cfc-4f33-8de5-8d1e01c44e75

1 Like

Thank God we have geniuses to figure these things out for us! (will definetely use this if I make a forge map ever) Also does it work for projectiles?

Not the way I have it scripted. I haven’t tried much with them yet. Do you know if you can change their rotation directly? If so it might be easier than getting the player to face the right direction.

Also, sorry I haven’t been appearing online in Xbox. My connection is pretty bad right now. I haven’t been playing anything online, it’s just not fun. Been sticking to forging and games I can play offline til I get home at the start of next semester. Hope you’re doing well.

Thx, Likewise! also, i am absolutely horrible at forge in HI but I am trying super hard to get better rn so I guess when I get better I could help on light in the black and other maps.