Using Terrain Tags

Terrain Tags are a new feature introduced in Ace. They can be accessed in the Tileset tab of the Database, on the right side list of buttons. A single tileset can have up to 8 different terrain tags set. On their own, these tags don’t do anything, and the command Get Location Info: Terrain Tag must be used in events. What you can do with these tags is far more versatile than they appear. Terrain Tags can do many of the functions of Regions, but on a larger scale and with less busy work for the game maker. I have two examples that illustrate what you can do with them:

*Note: this tutorial assumes you have basic understanding of writing events, using conditional branching, variables, ect*

TILE-BASED RANDOM BATTLES

This one is simple: changes random battles to only occur on specific tiles, such as bush tiles, in a similar vein as how random battles work in the Pokémon series.

The first step is to create a common event named Random Battles (or whatever you want) with a Trigger: Parallel Process and a Condition Switch: Random Battles. You will need to set three variables: one for the player’s X value, one for the player’s Y value, and the last to hold the location info value. The code inside the event should be as follows:

Control Variables: [0001:X] = Players Map X
Control Variables: [0002:Y] = Players Map Y
Get Location Info: [0003], Terrain Tag, Variable [0001][0002]
Conditional Branch: Variable [0003:Location Info] == 1
                Change Encounter: Enable
Else
                Change Encounter: Disable
Branch End

And that’s the entire code! Now you have two more steps, but they are relatively easy. The first is to go to tileset -> terrain tag and denote whatever tiles you want to have encounters in as terrain tag 1 (just click on them once if they’re at the default of 0). I used the bush tiles in the A tab. The second step is for when you place random battles in the map properties: make sure you have the troop ranges to be the whole map, not by region. And that’s it! Now wherever you place the designated tiles and have troops enabled, random battles will only occur in that location. This save you a lot of time having to place regions by hand over all your maps. If you want random encounters to occur anywhere on the map, such as in a cave or dungeon, simply flip the Condition Switch: Random Battles off.

CHANGE ACTOR GRAPHIC DEPENDING ON LOCATION

This event is just as simple as the previous one. What it does is change the actor’s graphic depending on their location – so if they are swimming it will automatically change to a swimming graphic, and back to a walking graphic if they go on land.

The first step is to create a common event named Swimming (or whatever you want) with a Trigger: Parallel Process and a Condition Switch: Swimming. You will need to set three variables: one for the player’s X value, one for the player’s Y value, and the last to hold the location info value (you can reuse the ones in the previous code if you’re using them both). The code inside the event should be as follows:

Control Variables: [0001:X] = Players Map X
Control Variables: [0002:Y] = Players Map Y
Get Location Info: [0003], Terrain Tag, Variable [0001][0002]
Conditional Branch: Variable [0003:Location Info] == 1
     Change Actor Graphic: [Eric], 'swimming eric', 0, 'Actor4', 0
Else
     Change Actor Graphic: [Eric], 'Actor4', 0, 'Actor4', 0
Branch End

And that’s the entire code! Now you have two more steps, but they are relatively easy. The first is to go to tileset -> terrain tag and denote whatever tiles you want to change the graphic while on. I used the coast tiles in the A tab. The second step is for you to change the passage setting for those tiles so the player can freely enter and exit them. And that’s it! You can use the darker ocean tiles as a border to keep the player from swimming too far into the water, and If you want to keep the player from swimming entirely, simply flip the Condition Switch: Swimming off.

CLIFF JUMPING

This one is a bit more complex, but allows you to do something that would otherwise require and endless number of events per map: jump down cliffs! Again using the Pokemon series as an example, this common event will allow you to jump down one tile cliffs just as is common in that game. Useful for creating puzzles or easy ability to leave dungeons or limit the ability for player’s to backtrack.

The first step is to create a common event named Cliff Jumping (or whatever you want) with a Trigger: Parallel Process and a Condition Switch: Jumping. You will need to set three variables: one for the player’s X value, one for the player’s Y value, and the last to hold the location info value (you can reuse the ones in the previous codes if you’re using them all). The code inside the event should be as follows:

Conditional Branch: The C Button is Being Pressed 
#Note: the C button is the trigger button for me 'z'#
     Control Variables: [0001:X] = Players Map X
     Control Variables: [0002:Y] = Players Map Y
     Conditional Branch: Player is Facing Down
          Control Variables: [0002:Y] += 1
          Get Location Info: [0003], Terrain Tag, Variable [0001][0002]
          Conditional Branch: Variable [0003:Location Info} == 2
               Set Move Route: Player (Wait)
                    Jump: +0,+2
                    SE: 'Jump1', 80, 100
               Branch End
          Branch End
     Conditional Branch: Player is Facing Up
          Control Variables: [0002:Y] += -1
          Get Location Info: [0003], Terrain Tag, Variable [0001][0002]
          Conditional Branch: Variable [0003:Location Info} == 3
               Set Move Route: Player (Wait)
                   Jump: +0,-2
                   SE: 'Jump1', 80, 100
               Branch End
          Branch End
     Conditional Branch: Player is Facing Right
          Control Variables: [0002:X] += 1
          Get Location Info: [0003], Terrain Tag, Variable [0001][0002]
          Conditional Branch: Variable [0003:Location Info} == 4
               Set Move Route: Player (Wait)
                    Jump: +2,+0
                    SE: 'Jump1', 80, 100
               Branch End
          Branch End
     Conditional Branch: Player is Facing Left
          Control Variables: [0002:X] += -1
          Get Location Info: [0003], Terrain Tag, Variable [0001][0002]
          Conditional Branch: Variable [0003:Location Info} == 5
              Set Move Route: Player (Wait)
                   Jump: -2,+0
                   SE: 'Jump1', 80, 100
              Branch End
          Branch End
Branch End

And that’s the entire code! Now you have two more steps. The first is to find a cliff sprite that is one tile in total such as the small cliffs made by Mack. This code does not work with the RTP cliffs, at best you can use it to jump down but not in the other directions. Once you have the new sprites, set them in any tab other than A of a tilesheet and go to Tileset -> Terrain Tag. Set the bottom tile as 2, the upper tile as 3, the leftmost tile as 4, and the rightmost tile as 5. Basically, make sure you set it as the direction the player is facing when they are jumping downhill. That’s it! Now just place those tiles on a map and make sure Condition Switch: Jumping is set to on. One last word of advice though: make sure wherever you place these cliffs, that you actually want the player to jump down them! If a non-passable tile is set where a player can jump, they will get stuck, so map with care!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s