31 posts in this topic

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?

k8eCV.png

fwELr.png

Emn57.png

wjR7v.png

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.

80x15.png

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!

Edited by Neon Black
Kread-EX, Tofuffalo, HK00 and 17 others like this

Share this post


Link to post
Share on other sites

Whoa, this is cool. Very cool. This looks like a must-use for many different games. Awesome work on this!

Share this post


Link to post
Share on other sites

cool...

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

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites

That's actually a really good idea! Thanks, I'll do that.

Share this post


Link to post
Share on other sites

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.

Archeia likes this

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Most likely the same bug as my bridge bug. I'll fix it after my new laptop arrives.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

No worries Neon Black, its a little sad, but compared to how awesome the script is, its only a super minor thing.  

Share this post


Link to post
Share on other sites

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.

transparentTile5.jpg

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)

Find_Passages.png

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:

overhead1.jpg

But this doesn't look right.

Here is the original map in the editor

overhead2.jpg

And here is how I set up the region tiles

overhead3.jpg

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]] = 0x10

Not sure if there is any way to avoid replacing layer 2 stuff.

Edited by Tsukihime
Hypnotic Paradox likes this

Share this post


Link to post
Share on other sites

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).

Share this post


Link to post
Share on other sites

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.

 

Map_Issue_zpsbd0f7092.png

Edited by Tharis

Share this post


Link to post
Share on other sites

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.
Edited by Zebtal

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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.

 


dtyd.jpg
 



2.- Now with the Script working:

 

ypz3.jpg

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

 


tpdf.jpg

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

Edited by Eatorl

Share this post


Link to post
Share on other sites

You need to use [] to enclose tags, not <>

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

I'm having a problem where not all the cover tiles I have marked allow the character to pass under. 5YZcz.png

 

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.

Edited by KitsuneKokuen

Share this post


Link to post
Share on other sites

I was using your script and I really like it.It makes things really simple.The problem I was having though that when trying to make the second floor of my inn passable on the map of the village,the windows and chimneys disappeared when playtesting it.

 

Here one screenshot showing what happened to the window of the Inn's second floor and the chimney after using terrain tags:

http://i.imgur.com/wTYMQvZ.jpg

 

And here a screenshot showing that I was using a star for the window and the chimey (tried it also with a circle and a cross and neither of them worked):

http://i.imgur.com/uZHvkro.jpg?1

 

I'm not sure if there is another way,but if it should be a bug,I'd be most thankful if you'd fix it!

 

Edit: After I've managed to go around it by using some events and tilesets (with the help from a friendly person!),I was trying to use the 18 tag indoors to be able to walk behind walls.Like this:

http://i.imgur.com/Kn1J4jh.png

It worked perfectly,with only one little thing.The 18 tag to the very right was able to be passable from above,but not from the right side which was really weird.It acted kinda like a wall stopping you from being able to walk behind the wall from this side.

 

Do you know a possible solution for this?

Edited by HappyChaos

Share this post


Link to post
Share on other sites

Hello! I love your script. It's awesome. But recently, I keep getting a bug. I keep having this bug when I walked under the regions marked with 18. When I moved on to the next map, the player couldn't get out of the path.

 

Here's a video so that you can see what I mean (since I'm really bad at english :D) It's at 0:37 and so forth when I can't get out of the path.

http://www.youtube.com/watch?v=ztF0VTpofto&feature=youtu.be&hd=1

 

I desperately need your help ;) haha. Thanks in advance :D

Edited by Jiggy

Share this post


Link to post
Share on other sites

How do I get this to work with your star priority passability fix you made, which allows the movement limitations to work with tiles that have the star priority?

 

The code that's like

class Game_Mapdef check_passage(x, y, bit)all_tiles(x, y).each do |tile_id|flag = tileset.flags[tile_id]if flag & 0x10 != 0 # [?]: No effect on passagenext if flag & bit == 0 # [?] : Passable but starreturn false if flag & bit == bit # [×] : Impassableelsereturn true if flag & bit == 0 # [?] : Passablereturn false if flag & bit == bit # [×] : Impassableendendreturn false # Impassableendend
Edited by shiori4me

Share this post


Link to post
Share on other sites

Gonna give this a bump and ask a question: With roof tiles (like those find in Tile Set C) how do I stop the roof from disappearing once I've added the regional ID 18 to it without having to overlay events? The roof tiles are meant to be passed under, but they disappear during game play and I'm left walking under grass tiles instead. Should I try using tiles 21 and 22?

 

I am a colossal idiot. I didnt realize that what I wanted was pre-coded into those sprites. Thanks for the amazing script. I'll be in my corner now.

Edited by CobeSlice

Share this post


Link to post
Share on other sites

A tip for the BRIDGE/CATWALK/UPPER/LOWER regions users: the UPPER region cannot be from Tile_B-E or have tiles from Tile_B-E on top of a Tile_A#, else it will disappear upon walking in the LOWER region tiles. UPPER region must be from Tile_A#.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.