Terrain Tags

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by Neon Black, Dec 17, 2012.

  1. Neon Black

    Neon Black The Classy Prostitute Member

    Messages:
    1,149
    Likes Received:
    359
    Location:
    Eastern US
    First Language:
    Sarcasm
    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?

    [​IMG][​IMG]

    [​IMG]

    [​IMG]

    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.

    [​IMG]

    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: Dec 22, 2012
    #1
    Esperia, Galenmereth, q8fft3 and 17 others like this.
  2. hyde9318

    hyde9318 RMC Coordinator Veteran

    Messages:
    2,592
    Likes Received:
    644
    Location:
    Michigan, USA
    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!
     
    #2
  3. ディーノス

    ディーノス Make a new destiny! Veteran

    Messages:
    187
    Likes Received:
    19
    Location:
    Indonesia
    First Language:
    Indonesian
    cool...

    i'm gonna use this script for my project i guess
     
    #3
  4. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    332
    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...
     
    #4
  5. Neon Black

    Neon Black The Classy Prostitute Member

    Messages:
    1,149
    Likes Received:
    359
    Location:
    Eastern US
    First Language:
    Sarcasm
    That's actually a really good idea! Thanks, I'll do that.
     
    #5
  6. Neon Black

    Neon Black The Classy Prostitute Member

    Messages:
    1,149
    Likes Received:
    359
    Location:
    Eastern US
    First Language:
    Sarcasm
    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.
     
    #6
    Archeia likes this.
  7. pinkapinkie

    pinkapinkie Veteran Veteran

    Messages:
    69
    Likes Received:
    6
    First Language:
    Italian
    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
     
    #7
  8. Neon Black

    Neon Black The Classy Prostitute Member

    Messages:
    1,149
    Likes Received:
    359
    Location:
    Eastern US
    First Language:
    Sarcasm
    Most likely the same bug as my bridge bug. I'll fix it after my new laptop arrives.
     
    #8
  9. thecretanhound

    thecretanhound Veteran Veteran

    Messages:
    83
    Likes Received:
    6
    Location:
    Newfoundland
    First Language:
    English
    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?
     
    #9
  10. Neon Black

    Neon Black The Classy Prostitute Member

    Messages:
    1,149
    Likes Received:
    359
    Location:
    Eastern US
    First Language:
    Sarcasm
    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.
     
    #10
  11. thecretanhound

    thecretanhound Veteran Veteran

    Messages:
    83
    Likes Received:
    6
    Location:
    Newfoundland
    First Language:
    English
    No worries Neon Black, its a little sad, but compared to how awesome the script is, its only a super minor thing.  
     
    #11
  12. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,221
    Likes Received:
    3,002
    Location:
    Toronto
    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.

    [​IMG]

    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)

    [​IMG]

    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:

    [​IMG]

    But this doesn't look right.

    Here is the original map in the editor

    [​IMG]

    And here is how I set up the region tiles

    [​IMG]

    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: Mar 3, 2013
    #12
    Hypnotic Paradox likes this.
  13. Neon Black

    Neon Black The Classy Prostitute Member

    Messages:
    1,149
    Likes Received:
    359
    Location:
    Eastern US
    First Language:
    Sarcasm
    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).
     
    #13
  14. Tharis

    Tharis Villager Member

    Messages:
    10
    Likes Received:
    0
    First Language:
    English
    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.

    [​IMG]
     
    Last edited by a moderator: May 26, 2013
    #14
  15. Zebtal

    Zebtal Warper Member

    Messages:
    1
    Likes Received:
    0
    First Language:
    French
    Just a quick post to say that your script is great, but I have this issue :

    (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: May 31, 2013
    #15
  16. Merancapeman

    Merancapeman Veteran Veteran

    Messages:
    39
    Likes Received:
    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!
     
    #16
  17. Eatorl

    Eatorl Warper Member

    Messages:
    3
    Likes Received:
    0
    First Language:
    Español
    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.

    [​IMG]
     
    2.- Now with the Script working:
    [​IMG]
    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

    [​IMG]
    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: Aug 16, 2013
    #17
  18. Shaz

    Shaz Veteran Veteran

    Messages:
    35,082
    Likes Received:
    9,624
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    You need to use [] to enclose tags, not <>
     
    #18
  19. cityshrimp

    cityshrimp Villager Member

    Messages:
    13
    Likes Received:
    15
    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.
     
    #19
  20. KitsuneKokuen

    KitsuneKokuen Villager Member

    Messages:
    5
    Likes Received:
    0
    First Language:
    English
    I'm having a problem where not all the cover tiles I have marked allow the character to pass under. [​IMG]

    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: Dec 26, 2013
    #20

Share This Page