I'm trying to think of a way that I could script in teleports between maps in a tile based RPG I'm making. I don't want to hard code all the scripts in, I want it all to be able to be done in a map editor I'm going to make. Currently I'm loading the level from a 2D array of ints, with each int representing the type of tile it is. I'm thinking of having each tile in the map array be a class. In the class I would stick:
-what type of tile it is (grass, tree, dirt, etc)
-an int for what map number it will warp to (0 if there is no warp)
-an x/y coordinate to tell it where to warp the player on the map
Example: The character steps over a tile in map 1 (the world map), which is a cave, and that tile says to load map 2 (the cave), at coordinates (2,5).
Hmm this idea is starting to make more sense just typing it out. What do you guys think of this technique and do you know of any better ways of doing it?