Terrain Tags

Neon Black

The Classy Prostitute
Member
Joined
Mar 17, 2012
Messages
1,149
Reaction score
369
First Language
Sarcasm
Primarily Uses
Terrain Tags Script V1.2




Created by Neon Black


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?







The screenshot above demonstrates most of the setup. Notice how bridges (region 20) and catwalks (region 21) are hugged on the sides with lower regions (region 22) and at the ends with upper regions (region 23).
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.2 (base script, 12.22.2012) is available from my pastebin account here or my mediafire account here.

I would like to use this code.



This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.

Permissions beyond the scope of this license may be available athttp://cphouseset.wo...d-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!
 
Last edited by a moderator:

hyde9318

RMC Coordinator
Veteran
Joined
Apr 1, 2012
Messages
2,593
Reaction score
680
First Language
English
Primarily Uses
RMMV
Whoa, this is cool. Very cool. This looks like a must-use for many different games. Awesome work on this!
 

ディーノス

Make a new destiny!
Veteran
Joined
Jul 3, 2012
Messages
187
Reaction score
19
First Language
Indonesian
Primarily Uses
cool...

i'm gonna use this script for my project i guess
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,033
Reaction score
338
First Language
indonesian
start downloading the demo.... perhaps screenshot of how you set the terrain tag to set the bridge will be helpful information.

i'm curious how to set that thus i download the demo :D . finish downloading...
 

Neon Black

The Classy Prostitute
Member
Joined
Mar 17, 2012
Messages
1,149
Reaction score
369
First Language
Sarcasm
Primarily Uses
That's actually a really good idea! Thanks, I'll do that.
 

Neon Black

The Classy Prostitute
Member
Joined
Mar 17, 2012
Messages
1,149
Reaction score
369
First Language
Sarcasm
Primarily Uses
UPDATE version 1.1 to version 1.2:

  • Fixed an issue where maps returned to by loading a game do not always function properly. If this issue persists, please post details and I will get it resolved.

You can get the new version in the main post.
 

pinkapinkie

Veteran
Veteran
Joined
Mar 30, 2012
Messages
69
Reaction score
6
First Language
Italian
Primarily Uses
I encountered a bug. Try placing the cover region on a normally passable tile, or a walltop, and in the same map put the same tile but without the cover region. Now save over that particular tile, and reload. You should be actually stuck in place
 

Neon Black

The Classy Prostitute
Member
Joined
Mar 17, 2012
Messages
1,149
Reaction score
369
First Language
Sarcasm
Primarily Uses
Most likely the same bug as my bridge bug. I'll fix it after my new laptop arrives.
 

thecretanhound

Veteran
Veteran
Joined
Apr 7, 2012
Messages
83
Reaction score
6
First Language
English
Primarily Uses
Great script! I did encounter a problem though, if a npc sprite is walking on the bridge when you walk under it, they fall through to the ground level.  The quick fix is to not have any sprites on the bridge, but is there a way to have them not fall through?
 

Neon Black

The Classy Prostitute
Member
Joined
Mar 17, 2012
Messages
1,149
Reaction score
369
First Language
Sarcasm
Primarily Uses
Yeah, there's sadly nothing that can be done about this.  Events and the player are always on the same level, it's actually the bridge that moves.  Sorry.
 

thecretanhound

Veteran
Veteran
Joined
Apr 7, 2012
Messages
83
Reaction score
6
First Language
English
Primarily Uses
No worries Neon Black, its a little sad, but compared to how awesome the script is, its only a super minor thing.  
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,230
Reaction score
3,076
First Language
English
Two things while I tested this script.

Summary

1: allow users to specify an array for each type of terrain. Maybe regions 18,19,20 should be cover tiles, because one region is not enough when it comes to tile swapping.

2: layer 0 tiles are replacing layer 2 tiles when they are treated as cover tiles. Would it be possible to have the layer 2 tiles remain on top?

Anyways here are the details.

1. I just used this script to create secret corridors with the "cover" region with basically no effort required.



Using the Tile Swap script in conjunction with this, you can do a region swap on the cover tiles

to display hidden paths (like how it was done in final fantasy 5 if you have the appropriate ability/class)



However, a single map may have a lot of cover regions, but not every covered region is necessarily a hidden path.

I would suggest changing the configuration to support an array of region ID's, and possibly have it local for each map. This way, I might assign 18 and 19 as my cover tiles, and then quickly do a region swap on 18 to "show" hidden paths, while 19 will just be the regular cover tiles that don't change.

2. Here is another issue.

I loaded up the sample "Snow Castle (exterior)" map and wanted to "walk through the gates into the courtyard" as follows:



But this doesn't look right.

Here is the original map in the editor



And here is how I set up the region tiles



I guess it would be this part

data[x, y, 2] = data[x, y, 0]data[x, y, 0] = 0tileset.flags[data[x, y, 2]] = 0x10Not sure if there is any way to avoid replacing layer 2 stuff.
 
Last edited by a moderator:

Neon Black

The Classy Prostitute
Member
Joined
Mar 17, 2012
Messages
1,149
Reaction score
369
First Language
Sarcasm
Primarily Uses
For issue 2, currently there's not.  I do have a project I just decided I wanted to take on, so I may be able to fix that issue soon.

I'm going to add a few more tags in version 1.3, so I can add those things in for you.  This is my next project (I hope).
 

Tharis

Villager
Member
Joined
Jan 2, 2013
Messages
10
Reaction score
0
First Language
English
Primarily Uses
Currently I have to say I love this script, there is just one problem I am coming across with it and it's the same issue Tsukihime is having.

Hopefully there is a work around soon. Hopefully there is a work around soon.

 
Last edited by a moderator:

Zebtal

Warper
Member
Joined
May 9, 2013
Messages
1
Reaction score
0
First Language
French
Primarily Uses
Just a quick post to say that your script is great, but I have this issue :

UPDATE version 1.1 to version 1.2:

  • Fixed an issue where maps returned to by loading a game do not always function properly. If this issue persists, please post details and I will get it resolved.
You can get the new version in the main post.
(concern for don't loading the script after loading the game) so I have to change any of the maps in which I can have this bug (eg maps of houses with a small tile to cover the character on the entrance and look pretty) otherwise at game loading the game character still stuck in the map : (

 

I hope version 1.3 is nearly done, and that still receive messages will motivate you to quickly post this version :)

 

Again thank you for this script and good luck for the rest.
 
Last edited by a moderator:

Merancapeman

Veteran
Veteran
Joined
Jun 9, 2013
Messages
39
Reaction score
17
First Language
English
This is unfortunate, I was hoping there was a fix for that issue. As it stands my ladder looks funky when walking under it and half of it disappears, heh. However, I love this script all the same, and appreciate your work. Hope you fix this soon!
 

Eatorl

Warper
Member
Joined
Aug 9, 2013
Messages
3
Reaction score
0
First Language
Español
Primarily Uses
Hello.

I see this Script as a powerful tool to complement the integrated functions of RPG maker Vx Ace! Thank you for develop it :)

However, there are certain issues as Tsukihime mentioned. The most visual and alarming problem would be the one of Issue 2 (I believe)
So I decided to take a look on that and try to contribute with some ideas:


Here is what I came with:


1.- Here you can see the Region distribution of a normal map.


 
2.- Now with the Script working:
Note: As you can see there are more elements than the first picture. Thats because:


3.- The Event Editor mode in the Rpg maker vx ace window

So basically what I am doing to solve the problem (kind of) is use Events as Tiles.

I do not know if this would cause a tremendous lag but if it's used moderately it could make the job.


You can spot the difference of the event and the tile with the big dragon statue, as a tile it looses its presence but the small dragon statues as events (above the player) remain visible.

I hope I could help!

Keep it on Neon Black. I would love to see an improved version of this great script!

Bye
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,832
Reaction score
12,240
First Language
English
Primarily Uses
RMMV
You need to use [] to enclose tags, not <>
 

cityshrimp

Villager
Member
Joined
Aug 17, 2013
Messages
16
Reaction score
19
First Language
English
Primarily Uses
N/A
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've tested this on my game, and it doesn't cause any performance issues when loading maps.  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.
 

KitsuneKokuen

Villager
Member
Joined
Dec 26, 2013
Messages
5
Reaction score
0
First Language
English
Primarily Uses
I'm having a problem where not all the cover tiles I have marked allow the character to pass under.


I have the tiles that are blank in that "T" Shape marked as 18 like all the rest when I playtest. But I still cant manage to pass under them. My goal is just to have the player be able to look like he goes behind the building. Any help is appreciated. Thanks.

Edit: Nevermind, I figured it out. I had event's on the roof that werent visible without realising it. Opps lol. Great script.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Pft... people think the moon landing is fake. Nonsense. The moon doesnt even exist in the first place, it's just the reflection of the earth on the surface of space.
I don't know if anyone will get my old pop culture references. Item: Empty Basket. Description: Don't worry. Yogi Bear won't try to steal it.
My second childrens book is finally uploaded and approved and available to buy! I am so happy!
I just realized I passed 1,000 likes. I'm amazed you people actually like this crap. It's no surprise you'd like my high quality content. :kaopride:
Running on a creative high right now. Expanding my Redwood tile D with doors, windows, and some other odds and ends today.

Forum statistics

Threads
95,752
Messages
931,609
Members
126,146
Latest member
Watson2345
Top