I'm putting together a game (simple top down, 8 direction movement) I'm not sure how to get teleports to work in the most efficient way in terms of programming. I know how to mechanically get them working, collide with the TP entrance, set position to TP exit, but the issue is that there's going to be enough teleports that hand coding collide with TP Entrance 1 -> Set Position to TP Exit 1 would take a long time and make adding new teleports later a pain.
So my thinking was, give each set of teleporters (an entrance and an exit) a 3 digit code where the first digit is the level number and the other two are the teleporter number, for example teleport 5 in level 1 would be TP-105. I gave entrances the group TrapDoor and exits the group Target. The entrances have values Destination X, Destination Y, and TP Code, and the exits has the value TP Code. Right now the only event is if the player collides with a TrapDoor (an entrance) it sets the players x and y to the destination X and Y.
My problem is, how do I tell TP-001 Entrance to set it's Destination X and Y to the correct Exit's X and Y?