RPG Maker Forums

Tile Swap

Author: Tsukihime



Overview

This script allows you to easily change tiles on the map.

Download

Script: Get it at Hime Works

Tutorial: Easy Tile Swapping. I would recommend reading this to see how this script works.

Extensions

"Swap From" functions - specify tile to swap using an existing tile on the map

Examples:

Making a bridge

A crack in the wall

Credits

KilloZapit, for providing the code for auto-tile generation.

Usage

There are three types of tile swaps

1. Change by tile id

-All tiles on the map with the specified ID will be changed to a new tile

tile_swap(old_tileID, new_tileID, layer, map_id)2. Change by region id-All tiles that are covered by the specified region ID will be changed to a new tile

region_swap(regionID, tileID, layer, map_id)3. Change by position-The tile at the specified position will be changed to a new tile

pos_swap(x, y, tileID, layer, map_id)]You can undo changes by using the following calls 

Code:
tile_revert(tid, layer, map_id)pos_revert(x, y, tid, layer, map_id)region_revert(rid, layer, map_id)revert_all
Understanding tilesThis script uses the concept of a "tile ID", which is a special string

that represents a particular tile on your tileset.

The format of this tile ID is a letter, followed by a number.

The letters available are based on the tileset names

A, B, C, D, E

The number represents the ID of the tile.

So for example, "A3" would be the the third tile in tileset A, whereas

"B12" would be the 12th tile of tileset B.

An example usage would be

tile_swap("A9", "A1", 0)Which will swap all "A9" tiles on layer 0 with "A1" tiles. As usual, because I did not pass in a map ID, it is assumed to be the current map. Please check the new script call format for details.It is very easy to look up the appropriate ID: just look at your tileset and number the top-left tile as 1. Then, numbering left-to-right, top-to-bottom, you would get something like this



For tileset A, it is a little different. This is assuming you have all 5 parts in tileset A.

You will need to skip over any missing pieces appropriately if you do not have all 5 parts.

To avoid all this unnecessary math, simply fill up the empty slots with dummy tilesets to make things easier.

Latest Threads

Latest Posts

Latest Profile Posts

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,017
Messages
1,018,354
Members
137,801
Latest member
topsan
Top