Variables You Need To Know
ID is going to be a number that represents that particular teleport.
tarID is target ID. As you can imagine it represents the identity of the target teleport.
Changing these variables
To change this, go into the map editor and right click the teleport object. Click edit. You can change ID and tarID there.
How This Works
When the game begins it finds the teleport with the target ID you set and remembers it. So when you step onto the teleport and it sends you to the remembered target teleport.
Use this how you like, that's just how I use it.
The Code
/*
Author: Zecronious
Terms: Free To Use
*/
// Optional frozen mechanic if you don't have it already.
mob
var/frozen = 0
Move()
if(frozen) return
return ..()
// The actual teleporting objects
# define teleportTime 10
obj/Mechanic/Teleport
icon_state = "Teleport"
var
ID
tarID
obj/Mechanic/Teleport/partner
proc
getPartner()
for(var/obj/Mechanic/Teleport/someTP)
if(someTP.ID == tarID)
partner = someTP
Cross(var/atom/someAtom)
spawn(1)
if(istype(someAtom, /mob))
var/mob/someMob = someAtom
if(someMob.isPlayer)
someMob.frozen = 1
sleep(teleportTime)
someMob.loc = partner.loc
someMob.frozen = 0
return ..()
New()
spawn(4)
getPartner()
return ..()