So I've come a ways since starting my map editor, thanks to loads of help from this forum (mainly R0j0hound.)
I can create a map of any size I choose. The bigger ones don't lag horribly thanks to the technique R0j0hound taught me of cycling through tiles using their private variables. I can put different tiles down and then save my map, and load my maps back. If maps are a different size, it will re size them automatically. If I have a huge map and I want to work on a part on the opposite side, I can teleport there with the mini-map by right clicking on it.
The mini-map shows the tiles that are drawn on it (even if it is kind of glitchy.)
These are all things I'm very proud of. So what's next?
Tilesets!
I want to be able to create custom tilesets inside the map editor during runtime. I have decided to do this using animation frames so I can continue to use the power of private variables, thus I won't be switching to the tiled background technique people talk about.
So here's my current thinking...
I have an array called "Tileset." It is 4 x 25 in size. There is a button where you can click "add tile." this will create a new animation frame with a user selected graphic (I believe this is possible with the image manipulator plugin.) I have a canvas and a scrollbar beside the canvas. For each tile added, there is an entry in the array. For each entry in the array there is a tile into the canvas. The canvas will fit 3 rows of 4 tiles each before scrolling.
The scrollbar will work by an up and down button as well as dragging the middle part. The middle part will have a Y size determined by the size of the array. I believe I can get the scrollbar to work by combining the space between rows and the height of the tiles with the size of the array, and using the lerp function for the scrollbar. This is pretty vague right now but it seems possible.
The tileset array will be saved along with each map. That way there is always something to point to which images each time a map loads. This way every map should be able to have a different tileset.
I realize there are some shortcomings, I would ideally like the tiles to all be saved into each map so no one could screw with them, but right now I am just trying to get the basics down.
Eventually there will also be a system to assign attributes to a given tile (or tile range) so events can be made on each map.
I am making this thread to ask you for feedback and for advice:
- Has anyone tried anything like this before? Is what I'm talking about possible?
- Am I missing any long term considerations?
- How do I start with this? Everything seems to be so intertwined that I'm not actually sure where to start and how to go about this.
I appreciate any and all comments. I realize this is ambitious for my second Construct project, but I have a knack for sticking with it. I'd love to share this with the community when it's finished so others can work with it and learn from it as I have.
Here's my current .cap if anyone wants to take a gander.
*As a disclaimer it is quite messy and full of bugs. I promise I will clean it up after the basic functionality is intact.*
dl.dropbox.com/u/69407974/Map%20Editor%203.cap