ID:173824
 
Ummmm hmmm I have a big problem...

I am making a game.. I was wondering.. Say I have three maps in my game and I want my person to teleport from one to another by steping on the tile for ex. How do I do this?
turf
Entered(atom/movable/A)
..()
if(copytext(tag, 1, 3) == "T2") //If the tag starts with "T2"
if(istype(A)) //If it is an atom/movable, which is an obj or mob
var/D = copytext(tag, 3)
var/turf/T = locate(D) //Locate a turf with the rest of the tag
if(T)) //If the turf exists...
if(!A.Move(T)) //Attempt to move. If it can't, then display message.
A << "Teleport failed!"
else //If the turf doesn't exist
world << "<font color=red>ERROR: Turf [src] at [src.x], [src.y], [src.z] has a nonexistant target.</font>"


Then, in the map editor, all you have to do is right click on the turf you want to teleport to, go to edit properties, and change the tag variable ("dest1", for the sake of description). Then, for the turf you want to teleport from, change its tag to T2 then the tag of the destination turf, so in our example, it would be "T2dest1". Don't use the same two tags anywhere. This only works one way, not both ways.