This could become tricky. But the basic theory behind it would be to loop through each of the squares you place down. Test each one for objects each direction away from it, and set animations correctly depending on where it is located.
I made something like this for my current project, an isometric game.
Here's basically what you do:
When the objects are loaded from the level editor file, make it check if there's an object to the left,right,above, and below sides of the object. Temporarily store this data in another object (perhaps using an alterable value for each side) and then set the current object's animation accordingly.
Well I can tell you how to code something like that
First make an object for the squares. The script assumes this is 64x64
Then for the walls.
Then in the event editor
[Event(s)] Action(s) (Formula)
[Use clicks] Create square at 0,0. Set X Position (XMouse - (XMouse Mod 64)) Set Y position (YMouse - (YMouse Mod 64))
Create Walls at 0,0. Set X Position (XMouse - (XMouse Mod 64))* Set Y position (YMouse - (YMouse Mod 64))* Set direction to (???) Do this 4 times in the same event
*Needs modification
[Wall collision with wall] Destroy wall
There's another way, but it's much more complex (But better aestheticly)
Actually, i would do something similar to that while loading. But in the creation of levels i would simply do it so you just place down a square and it doesn't create the walls.
Dude, I wrote an article on this like 2 days ago, complete with example file. Look for "Tile Based Games" in the articles section.
One question though;
I've been trying to fastloop my example (and another similar one that would be perfect here), but they don't seem to work. I'm guessing it's probably because the data can't be loaded fast enough from the array (I'm not a newbie - I understand fastloops/arrays so I'm pretty sure it's not bad coding).
Are any of the other array extensions better/faster?