Teleport

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
azambuja
Posts: 2
Joined: Sun Jan 14, 2018 4:38 pm

Teleport

Post by azambuja »

Hi, i recently started learning. I want the player to get teleported after crossing one of those lines but only once. For example if they crosses line 1 they gets teleported and after it, if they crosses one of the other lines he won't get telported again. Any suggestions?
Attachments
Clipboard01.jpg
User avatar
ramon.dexter
Posts: 1529
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Teleport

Post by ramon.dexter »

Activate when player crosses without any repeat. Basically, rightclick the linedef and select correct activation from activation tab.

Not that you are not able to find this yourself...
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

Re: Teleport

Post by cocka »

Not that you are not able to find this yourself...
LOL, you didn't understand his problem.

azambuja:

There are two ways to do that.

1. I can see that you were using the UDMF format, so you can set the same line id for all those lines and then use a script on the teleport lines instead of just the Teleport special. In this way you can "turn off" the special of the inactivated lines.

2. I can see that there is a yellow key there. So you needn't have drawn all those lines because you can set a special for the key itself as well.

See the example in my test wad:
teleportonce.wad
(3.86 KiB) Downloaded 47 times
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: Teleport

Post by Nevander »

For UDMF, I would always advise cocka's method 1. Set your 4 lines to execute a script to teleport the player and then immediately after, set the special of all 4 lines to 0 (no action).

Also test it a lot by running into it and doing straferunning to make sure you can't cheese it. You may need to move the lines out until it's impossible to grab early.
azambuja
Posts: 2
Joined: Sun Jan 14, 2018 4:38 pm

Re: Teleport

Post by azambuja »

Thank you :D, i did the setlinespecial thing and it worked.
Post Reply

Return to “Scripting”