Let’s revisit for a moment a topic that we discussed in our first tutorial, adjusting encounters so that they also happen while riding in the boat (or ship, or airship, for that matter). We saw how it was fairly easy to get this change in place, by only adjusting a few lines of code. But, we might notice there’s a slight problem… unless we craft dozens of different areas to perfectly match the contours of our water and land, we will end up with land dwellers attacking us while on the high seas, and sharks attacking us on land. Needless to say, this is kind of inadequate. Unfortunately, out of the box, there is no way to specify that troops only appear on certain types of tiles. So, we need to write a bit of script in order to make this work.
Before diving into how to do this, it’s worth digressing for just a brief moment to point out that a new feature in VX Ace, known as Regions, averts this issue. Though still impossible to define encounters based on tiles, rectangular areas have been replaced by regions, which can have any arbitrary shape by essentially painting them onto the map. So, the obvious solution would be to simply draw out separate land and water regions as needed, and assign appropriate troops to each. But until the English release, let’s continue looking at VX… Continue reading