teleport things with z variable

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
DOOMERO-21
Posts: 1423
Joined: Wed Jan 02, 2008 10:02 pm
Location: Chile

teleport things with z variable

Post by DOOMERO-21 »

i want teleport something to a specific tid destination but changing the z coordenade.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: teleport things with z variable

Post by NeuralStunner »

How about:

Code: Select all

Function Int TeleportToZ (Int DestTID, Int SourceTID, Int DestZOffset, Int UseFog)
{
	DestX = GetActorX (DestTID);
	DestY = GetActorY (DestTID);
	DestZ = GetActorZ (DestTID) + DestZOffset;
	Return SetActorPosition (SourceTID, DestX, Dest&, DestZ, UseFog);
}
Should Return True if the actor is successfully telported, False if not.

I haven't tested this, BTW. It may contain errors, but should get the idea across.
Locked

Return to “Editing (Archive)”