Teleport Doesn't Work With OPEN/ENTER Scripts?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
ReX
Posts: 1584
Joined: Tue Aug 05, 2003 10:01 am
Location: Quatto's Palace
Contact:

Teleport Doesn't Work With OPEN/ENTER Scripts?

Post by ReX »

Here's what I'm trying to do:

1. I end one map with a fade-to-black
2. I want to start the next map from the fade-to black point. [No matter how much I try, I can't get the map to start from complete blackness. Therefore, I've resorted to the method in Item 3, below. And, no, it's not an option to set all sectors visible at the start to 0 light level.]
3. The player starts in a dummy sector consisting of black flats/textures and 0 light level (i.e., complete blackness).
4. After a brief HUD message, the start of music, and a small delay, the player needs to be teleported to the true start of the map.
5. Upon teleporting to the "true" start, the game fades out of black, and the player can commence playing.

Unfortunately, the teleport part of the instruction [refer to scripts below] is not working. I vaguely recall that I was trying to do something similar many years ago. At that time I believe I had to resort to a scrolling floor, a blocking line that was changed to non-blocking at the correct moment, and the player being carried by the scrolling floor across a teleporting line. Hacky, I know, which is why I was wondering if there is a more elegant way of achieving my objective. Thanks.

[And, yes, there is a map-spot with TID 10, and it's in a sector with tag = 40. I've tried it with both a map-spot and a teleport destination thing.]
Spoiler:
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Teleport Doesn't Work With OPEN/ENTER Scripts?

Post by Graf Zahl »

Can't say what may be wrong, but one suggestion: Have you tried [wiki]TeleportOther[/wiki]?
User avatar
ReX
Posts: 1584
Joined: Tue Aug 05, 2003 10:01 am
Location: Quatto's Palace
Contact:

Re: Teleport Doesn't Work With OPEN/ENTER Scripts?

Post by ReX »

Graf Zahl wrote:Have you tried [wiki]TeleportOther[/wiki]?
I just tried it, and it doesn't work either.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Teleport Doesn't Work With OPEN/ENTER Scripts?

Post by Gez »

Does it work if you puke script 2?
User avatar
ReX
Posts: 1584
Joined: Tue Aug 05, 2003 10:01 am
Location: Quatto's Palace
Contact:

Re: Teleport Doesn't Work With OPEN/ENTER Scripts?

Post by ReX »

Gez wrote:Does it work if you puke script 2?
The rest of the script works; it's just the teleporting that is borked.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Teleport Doesn't Work With OPEN/ENTER Scripts?

Post by Gez »

ReX wrote:[And, yes, there is a map-spot with TID 10, and it's in a sector with tag = 40. I've tried it with both a map-spot and a teleport destination thing.]
I missed that. For the record, you should only have tried with the teleport destination thing. There's a reason they exist.
User avatar
arookas
Posts: 265
Joined: Mon Jan 24, 2011 6:04 pm
Contact:

Re: Teleport Doesn't Work With OPEN/ENTER Scripts?

Post by arookas »

I just tried the given scripts with various combinations of variables. Here's what I found:
  • both tid and tag were set, map spot used: didn't teleport
  • only tag was set, map spot used: didn't teleport
  • only tid was set, map spot used: teleported
  • both tid and tag were set, teleport destination used: teleported
  • only tag was set, teleport destination used: teleported
  • only tid was set, teleport destination used: teleported
It appears when tag is set, the actor has to be a teleport destination -- map spots simply aren't iterated. I would advise using a teleport destination, not using the tag parameter of the Teleport special, or using SetActorPosition to move the player to the map spot directly.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Teleport Doesn't Work With OPEN/ENTER Scripts?

Post by Graf Zahl »

Gez wrote:I missed that. For the record, you should only have tried with the teleport destination thing. There's a reason they exist.

Indeed. The reason being that teleporting to map spots is intentionally limited to the tid-only case, and the only reason that even exists is that Hexen screwed this up. To be honest, I would have guarded this option with 'if (originalHexen)' from the start. There have been far too many maps which had problems due to careless use of improper destination spots here.

I guess I will add this as an error message to developer mode so that it gets reported if it happens.
User avatar
ReX
Posts: 1584
Joined: Tue Aug 05, 2003 10:01 am
Location: Quatto's Palace
Contact:

Re: Teleport Doesn't Work With OPEN/ENTER Scripts?

Post by ReX »

Arookas wrote:I just tried the given scripts with various combinations of variables... I would advise using a teleport destination, not using the tag parameter of the Teleport special ....
Arookas, thanks for systematically checking every combination. I used a teleport destination, removed the sector tag parameter, and it worked.

FYI, I had originally used this:

Code: Select all

	Teleport_NoFog (10, 1, 0);
where 10 is the TID of a teleport destination thing. [I'm not clear why I assigned the second parameter.] This didn't work, which is when I tried various alternatives.

All's well now, and thanks to everyone for their help.
Locked

Return to “Editing (Archive)”