Page 1 of 1

Teleport activate from rear of the line?

Posted: Thu Aug 30, 2018 3:55 pm
by Enjay
Specifically, I want to do this in a script. When a teleport function is used in a script, it behaves just like it does if the special is applied directly to the line - i.e. if you cross from the front of the line, you get teleported, if you cross from the back, you don't. That's fine and it's exactly how it should be. However, in this case, I have a script that changes the camera and then teleports the player away to a small room. A cutscene plays out and then the player is teleported again, roughly back to where he crossed the line.

The reason for teleporting the player to the small room is twofold. #1 it puts him somewhere that he can't be seen by enemies and so isn't vulnerable while he can't see the game (and doesn't come out of the cutscene surrounded by bad guys - which might happen if he was just stood in the original position but invulnerable) and #2 the small room has walls that optionally run a script that allow the player to skip the cutscene.

The problem is that the player can approach the line from either side and if he does so from the back, the script starts, the camera changes, the custscene runs, but the player is not teleported. So, he's just left where he was, vulnerable, blind and unable to skip the cutscene.

So, I was just wondering if there was a "teleport from either side of the line" flag (I'm using Teleport_NoFog) I don't see anything in the Wiki.

I know this is something of a simple question and I can easily script my way around it, or just put another line in back-to-back with the first line, but when I noticed the problem happening, it got me wondering if there was such a flag/whatever for teleport specials.

Re: Teleport activate from rear of the line?

Posted: Fri Aug 31, 2018 12:07 pm
by Xaser
Try using TeleportOther -- it doesn't have any side-checking logic so it ought to work in both cases.

Re: Teleport activate from rear of the line?

Posted: Fri Aug 31, 2018 1:27 pm
by Enjay
Thanks, I'll see if it works later. That feature requires the thing being teleported to have a tid. Any idea if I will need to give the player a tid for this to work, or will it work by passing tid 0 as the teleportee tid and the engine assuming activator=teleportee tid?