Actor.Teleport works half the time?

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!)
Heisanevilgenius
Posts: 82
Joined: Wed Dec 15, 2021 8:38 pm
Graphics Processor: nVidia (Modern GZDoom)

Actor.Teleport works half the time?

Post by Heisanevilgenius »

I have a monster that teleports you by touch.

I used the following code:

Code: Select all

	override void Touch (Actor toucher)
	{
		if (toucher.player)
		{
			toucher.Teleport((1024,-3264,256),90,TF_TELEFRAG);
		}
	}
I had it teleport you to specific coordinates on the map, but weirdly it only happens some of the time depending on where the monster is located. Sometimes it will teleport me to the coordinates no problem and other times it will zip me straight up in the air and drop me down, ignoring the X and Y. Weirdly enough, the teleport fog appears at the destination coordinates even if I'm warped straight up instead.

Not sure why it's doing that....
Heisanevilgenius
Posts: 82
Joined: Wed Dec 15, 2021 8:38 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Actor.Teleport works half the time?

Post by Heisanevilgenius »

I did a video to illustrate.

The teleporter actor works when I'm in one area of the map but if I leave that area of the map, it instead jumps me straight up with no fog.

Heisanevilgenius
Posts: 82
Joined: Wed Dec 15, 2021 8:38 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Actor.Teleport works half the time?

Post by Heisanevilgenius »

Nevermind. I replaced with:

Code: Select all

toucher.ACS_NamedExecuteAlways("TeleportMan", 0, 0, 0);
For some reason, toucher.A_Teleport didn't seem to work properly but I just had it call a script instead and now it works fine.
User avatar
Enjay
 
 
Posts: 26874
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Actor.Teleport works half the time?

Post by Enjay »

Thanks for letting us know you found a work-around. I have no idea why you were getting the original behaviour though.

Return to “Scripting”