So at the end of the last post, I said that the two things I’d focus on next are getting glyphs to draw in message boxes, and fixing the timing issues I’d observed in the intro to Love And War. Well, I made the glyphs draw. The timing problem is going to be a bit trickier. It turns out it’s related to another area where RPG Maker does something “magic”.
Basically, there are several places in the intro where it uses this pattern:
Image[1] = New Image (blah blah blah)
Show Screen (Fade In)
And what that does, if the screen is already shown, is fades the image in instead of displaying it all at once. It creates the image, but doesn’t begin to display it before the fade operation starts, so you get a gradual transition. I didn’t know about that trick when I was setting up the Transition code, so it tries to do the sensible thing and just do nothing if told to fade in while the screen is already visible. It’ll take some extra work to get this right.
So I went back to The Frozen World, and I finished it. I found and fixed several bugs, including a fun one where the game would get lost in the middle of a cutscene because it used a Move command to move the party over a square with a teleport command attached. I had to add some code that disables launching scripts by touching a map object like that, while a scene is active.
But the main thing I kept running into, over and over these last few days, was issues with passability: the decision of whether a character can move from one tile to another. This consists of three questions that ought to be very simple:
- Can the character leave the tile it’s on in the direction it’s trying to go?
- Does another tile exist in that direction?
- Can you enter the adjacent tile from the direction you’re coming from?
The second question is very easy to answer. Just check to see if you’re about to step off the edge of the map, and if so, whether wraparound is set for the map in the direction you’re going. But the other two are a lot more complicated, and movement is so fundamental to an RPG that if you get any of the details wrong, a bunch of things stop working.
For example, if there’s no upper-level tile, you just use the passability info from the lower tile. But if there is one, then you use the passability info from the upper tile instead… unless the upper tile is marked with the Star (overhead) attribute, in which case you use the lower tile info afterall. And of course, that’s assuming that there are no other map objects in the square you’re leaving or the one you’re entering. If there are, things get even more complicated…
I think I’ve got it all working now, but I’m still not 100% certain. I fixed all the cases I found in The Frozen World, at least.
I’ve still got a few minor bugs to work out before releasing another build, but right now it’s at the point where it can run through the whole game. Keep watching; there’ll be more coming soon!