Terrain Tags Script v1.1

What is it?
This scripts adds a few region tags to the maker that cause certain regions to affect movement on that particular tile on the map.  These are some simple changes like roofs and slopes, and a few more complex ones like bridges.  These changes are designed to make maps more dynamic and interesting as well as simplify things that would have had to be created using events previously.

How can I use it?
There are are 3 main types of terrain options each with their own uses.

  • Slopes – Regions 16 and 17 by default.  Slopes grant the player diagonal movement when they are walked into and off of.  To use these, simply place the region on top of ALL tiles that have diagonal stairs on them.  Passability is slightly modified on these to allow thin staircases to be created requiring less room to pass than normal diagonal movement.  By default region 16 refers to stairs that go up and to the left while region 17 refers to stairs that go up and to the right.
  • Cover – Cover or ceiling tiles are tiles that the player can walk under but cannot walk over.  By default these tiles are tagged with region 18.  Since autotile passabillity gets messed up when you make certain autotiles passable, I also added blocking terrain tags.  By default these are region 19.  These prevent all movement onto them.
  • Bridge – This is the most complex set of tags to work and the reason I added a demo to mess around with.  Bridges get tagged with region 20.  These can be walked under or over.  Since using bridges and cover tags will erase upper layer images when used, I also added a “catwalk” tag.  This tag can be used to tag bridges that use the upper layer.  In this case the player will ALWAYS be ABOVE the lower tile, and the UPPER tile will act as a bridge you walk over and under.  There are two other region tags that determine if a bridge is currently in upper or lower mode and that are also used to prevent the player from stepping off of a bridge to somewhere they’re not supposed to.  Region 22 by default is the lower tag.  If the player steps on this, all bridges and catwalks will be changed to the player and events walk UNDER them.  Region 23 switches it so that the player and events walk OVER them.  One more thing to note, the player can only step off of a bridge or catwalk tile onto another bridge, catwalk, or similar switching region.  This means if the player is UNDER the bridge, they can only walk on tiles marked with 20, 21, or 22.  Once they step on region 22, they can walk around normally.  The same applies to region 23 while they’re on top of bridges.

What does it look like?

What does it work with?
This should work with most other scripts.  Considering it overwrites a movement method and a passage method it probably will not work with scripts that affect movement.

How can I get the code?
Version 1.1 (base script, 12.3.2012) is available from my pastebin account here or my mediafire account here.

I would like to use this code.
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
Permissions beyond the scope of this license may be available at https://cphouseset.wordpress.com/liscense-and-terms-of-use/.

Author’s Disclaimer:
This is a script I made in an afternoon and forgot about.  I did this because I wanted a way for players to walk up diagonal stairways easily, but I ended up wanting to add a bit more.  So I did.  It took a bit of tweaking to get everything adjusted right, but I think I’ve finally got everything down.  I know the bridge tags are a bit hard to use, but if you skip those and just use the other tags it’s still a pretty awesome script.  As always, enjoy!

  1. The Mediafire Demo is no longer valid. And I’m having a lot of trouble with this.
    And then, I think you said cover tiles can be made to walk both under and below. I can’t get that to work.

  2. I’ve found a weird bug where some wall tiles become impassable even with no tags on them. To reproduce:
    1. Place a region id 18 on a wall tile (like the top of a hill or roof)
    2. Actor can walk around the top of the hill or roof
    3. Transfer out of the map
    4. Transfer back into the map
    5. All tiles that look exactly like that wall tile becomes impassable even though they were fine previously.

    After hours of research, it appears the problem is that Terrain Tags script will mess with the tileset flags. Upon loading the map a second time, the tileset flags will be messed up for some tiles.

    To fix this, you need to reload the tileset file every time a map is loaded. The easy way to do that is add a line to Game_Map.setup, as such:

    def setup(map_id)
    $data_tilesets = load_data(“Data/Tilesets.rvdata2”) #Add this line
    @map_id = map_id
    @map = load_data(sprintf(“Data/Map%03d.rvdata2”, @map_id))
    @tileset_id = @map.tileset_id
    @display_x = 0
    @display_y = 0
    referesh_vehicles
    setup_events
    setup_scroll
    setup_parallax
    setup_battleback
    @need_refresh = false
    end

    I don’t know how many people care to walk on top of hills or roofs, but this may end up fixing some other weird problems when the map is loaded a second time.

    • Fartoholic

      Thank you so much! I had no idea what was causing the problem and came so close to giving up. thankyouthankyouthankyouthankyou

  3. Jang Hae Joo

    Hey! Looks cool! Have to try it out.

  4. I see this script overwrite check passage method. So, this script overwrite that star passability fix too, right?

  5. When I use a shadow, the one that comes in four spots per tile in the drawing the map phase, and use a cover terrain tag on the same tile, the shadows disappear, and I think they go under the tile, where the character goes as well. Could this be fixed? Because it’s really annoying when using it in dark areas like caves or a Ravenholm sorta map.

  6. Hello NeonBlack.. I wonder if you intend to make a plugin for MV following the functions of the CP Terrain .. which by the way is wonderful! Thank you.

  1. Pingback: New Sunday Script « CP House Set

Reply to this post

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: