Teleport activate from rear of the line?

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
Enjay
 
 
Posts: 27026
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Teleport activate from rear of the line?

Post 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.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Teleport activate from rear of the line?

Post by Xaser »

Try using TeleportOther -- it doesn't have any side-checking logic so it ought to work in both cases.
User avatar
Enjay
 
 
Posts: 27026
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Teleport activate from rear of the line?

Post 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?
Post Reply

Return to “Scripting”