Tile Changer (Copy Tiles and Change Tiles)

adamspecial

Veteran
Veteran
Joined
Mar 21, 2018
Messages
34
Reaction score
6
First Language
Italian
Primarily Uses
RMMV
Perfect, thank you! Well, I'll just have to come up with some way to draw good looking maps without parallaxes or doodads...
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,714
Reaction score
13,992
First Language
English
Primarily Uses
RMMV
You can still use them. Doodads can be conditioned by switches (and maybe variables), so at the time you want the map to change, execute the change/copy tiles plugin command and turn on (or off) the switch for the appropriate doodads.

And you can also use this with parallax maps - as long as the parts you want to change are done by tiles and the before/after tiles all fit in with the parallax.
 

adamspecial

Veteran
Veteran
Joined
Mar 21, 2018
Messages
34
Reaction score
6
First Language
Italian
Primarily Uses
RMMV
You can still use them. Doodads can be conditioned by switches (and maybe variables), so at the time you want the map to change, execute the change/copy tiles plugin command and turn on (or off) the switch for the appropriate doodads.
this is interesting. I didn't realize that. I'm trying to make psuedo random dungeons with your plugin. In one map, I have the rooms which will be randomly chosen and then copied by the plugin to the actual dungeon map. I could place doodads from every room in each section of the dungeon map, return which room occupies that section, and then activate its doodads-related switch. Seems a lot of work though.
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,714
Reaction score
13,992
First Language
English
Primarily Uses
RMMV
Do you want them to randomize each time you enter the dungeon, or each time you go from one room to another, or just once per game and they'll stay fixed for the entire game? You can just make up each room as a separate map, then use variables to determine how they all link together and do your transfers according to the variables. No need for the plugin at all.
 

adamspecial

Veteran
Veteran
Joined
Mar 21, 2018
Messages
34
Reaction score
6
First Language
Italian
Primarily Uses
RMMV
Nope, that really is not what I need. What I have done with your plugin is this:

You enter the dungeon floor. The whole floor becomes randomly mapped and stays that way the whole game.

Exploring the dungeon and finding the way to treasures and the next floor is a big deal in the game. It's not really a labyrinth, but you have to go around to find what you need. Doing separate maps for each room would become a tad too much tiresome for the player (for me, really! I would hate that), having them either memorize or physically draw the map. I would rather have it just like diablo. In fact, I'm integrating a minimap plugin too!
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,714
Reaction score
13,992
First Language
English
Primarily Uses
RMMV
I thought you meant you were copying rooms from other maps that you'd already made.

Anyway, sounds like you've got what you need. You could potentially get someone to write a patch to make it also copy doodads. Just start a thread in Plugin Requests or Plugin Support with links to mine and Yanfly's if you want to look into that.
 

adamspecial

Veteran
Veteran
Joined
Mar 21, 2018
Messages
34
Reaction score
6
First Language
Italian
Primarily Uses
RMMV
I thought you meant you were copying rooms from other maps that you'd already made.

Anyway, sounds like you've got what you need. You could potentially get someone to write a patch to make it also copy doodads. Just start a thread in Plugin Requests or Plugin Support with links to mine and Yanfly's if you want to look into that.
I will. Thanks again!
 

Chef

yeet
Veteran
Joined
Oct 13, 2017
Messages
286
Reaction score
136
First Language
Dutch
Primarily Uses
RMMV
Is there a maximum of tiles we can copy per map?
And can we also remove tiles that are copied?

I'm making a random generated race game but I can't copy more than 2 or 3 30x30 map pieces from a template map, so I hoped I could make space by copying empty tiles over from a blanco map. But that doesn't really seem to work :/
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,714
Reaction score
13,992
First Language
English
Primarily Uses
RMMV
There is no limit to how many you can copy, but be aware that copying a large number in one hit might affect performance for a little bit. To remove tiles that are copied, you could either use ChangeTile to change them back individually to what they originally were, or just make a copy of your original map then use CopyTiles again to copy that section back, or if you just want to remove ALL tiles for a given map, you could try this in a script call:

Code:
$gameSystem._mapTiles[mapId] = {};
$gameTemp.setMapDataRefresh(true);
where mapId is the id of the map without any leading zeros, so for map 5, you'd just use [5] instead of [mapId]


I don't really understand what you're trying to do. Your map has to be large enough to put on whatever you want to put on. You can't just enlarge the map by making some blank tiles at runtime.
 

Chef

yeet
Veteran
Joined
Oct 13, 2017
Messages
286
Reaction score
136
First Language
Dutch
Primarily Uses
RMMV
Okay I'll try to explain it as clearly as possible:
With the help of Bblizzard (Ultra Mode 7) I made a race game that looks like F-Zero. The only input the player has are left. right, shift (to pause), and space ("ok"). The player moves automatically forward and when the player presses left or right it changes the YAW. But "moving forward" always stays the same direction in MV, so I have a repeating press input near the top of the screen so the player will always move to "there". That touch-location changes with the YAW.

It's randomly generated. I made 1 big "template" map where I copy all 16 possible pieces of a race track from. Every piece is 30x30 tiles big but not everything is compatible. I made common events so every "next" piece will be compatible with the current one.
In the middle of the actual race track map is a 30x30 starting area. I took the XY values of the top left corner of that starting area, subtracted 30 from the Y-variable, and let the next piece of the race track spawn on the new XY-values' location:
CopyTiles ($gameVariables.value(162)) ($gameVariables.value(163)) 'MapCopier' 94 2 123 31

Note: I also use YEP Event Spawner to spawn events (trees) on Region Tiles on the sides of the road, it works pretty well.

The problem is that only 2, sometimes 3, pieces get loaded after the starting area. It doesn't crash nor give a error in the console. So I thought: "Maybe the Cache is full and can be emptied if I copy tiles from a blanco map." But it turns out to only bring over the properties and doesn't overwrite the previous image.

I was hoping this little project would only take me a week xd

Some screenshots: https://1drv.ms/f/s!AsqbW0RDykVgi7Y6txnuVhsvHTMYdw
 

zousug

Veteran
Veteran
Joined
Mar 4, 2020
Messages
33
Reaction score
2
First Language
english
Primarily Uses
RMMV
Hi Shaz,

I am giving your Plugin a try and running into some issues.

on my main map i have this code, <load:[{"name":"droad","map":8}, {"name":"proad","map":7}]> and in an event I have it running plugin command: CopyTiles 0 0 'droad' 0 0 49 54 0 1 , (not sure if i have the 49, 54 in the right order but have tried swapping them around) the event is attached to a npc on a sub map of the main map.. not 100% sure if this is ok or not..

The way I am hoping to change the map is after an upgrade is purchased.. but this has to happen in a town not the map? Sorry if I am miss-understanding

1583501518483.png

EDIT

Ok so quick update, I fixed the error.. it was my bad so thats all good now. but I have a slightly different issue. When I go out onto the map now no matter what setting is being used (default map no roads, or map with upgrade 1) I can no longer walk.

EDIT 2

I have attached a copy of the map properties and the plugin command im running (its in a event slot on the main map)

1583560605940.png
1583560619600.png

now because the map properties cuts the text off I will include the mapcnote

Code:
<load:[{"name":"droad","map":8},
{"name":"proad","map":7}]>
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,714
Reaction score
13,992
First Language
English
Primarily Uses
RMMV
Okay, I notice you have not given the plugin the correct name, so you need to do that.

If your game is freezing when you enter the world map, then it's likely because you have an autorun event somewhere. I doubt it'd be anything to do with the plugin, unless you'd copies tiles that have an X for passability.
 

zousug

Veteran
Veteran
Joined
Mar 4, 2020
Messages
33
Reaction score
2
First Language
english
Primarily Uses
RMMV
Okay, I notice you have not given the plugin the correct name, so you need to do that.

If your game is freezing when you enter the world map, then it's likely because you have an autorun event somewhere. I doubt it'd be anything to do with the plugin, unless you'd copies tiles that have an X for passability.
sorry, what do you mean the plugin does not have the correct name?

I am just trying to do the ground tiles (should be the correct code im using.. )
the tiles get copied its just that my character cant walk and i cant open the menu

sorry i meant to say the only autorun event i have is a time event for a day/night cycle.. could that be stopping it?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,714
Reaction score
13,992
First Language
English
Primarily Uses
RMMV
The first post says, twice, that you need to save the file as Shaz_TileChanger.js but your screenshot with the error message shows that you've saved it as tile_changer_(mv).js

You should not have any autorun events that remain on the map unless they are cutscenes. Autorun removes the player's control.
 

zousug

Veteran
Veteran
Joined
Mar 4, 2020
Messages
33
Reaction score
2
First Language
english
Primarily Uses
RMMV
The first post says, twice, that you need to save the file as Shaz_TileChanger.js but your screenshot with the error message shows that you've saved it as tile_changer_(mv).js

You should not have any autorun events that remain on the map unless they are cutscenes. Autorun removes the player's control.
ah.. i had renamed it i just forgot to replace the file in the plugin folder with the updated name.

So the autorun event i was talking about was not the one causing the issue.. on the map i had a autorun event to trigger the plugin command. if i cant use autorun event how do I trigger it to change the map?
If i put the plugin command on the event leaving town i get an error screen again..

EDIT

ok so i got it working.. lol, thank you and sorry for the trouble :)
 
Last edited:

joseanjim

Villager
Member
Joined
Sep 15, 2015
Messages
11
Reaction score
1
First Language
spanish
Primarily Uses
I'm sorry about my newbieness, but I'm testing your plugin and I don't understand what I'm missing...
I'm trying to change a sand tile to grass. I place an event on the 8 8 coordenates and it only have a text to check event activation and a plugin command : ChangeTile 8 8 0 2816
The event is activated but the tile doesn't change...
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,714
Reaction score
13,992
First Language
English
Primarily Uses
RMMV
Can you please show a screenshot of your event (the full event window - don't crop it to just the event commands), and a screenshot of your plugin manager?

Also, after the event runs, hit F8 to open the Developer tools, go to the Console tab, and grab a screenshot of that as well, so we can see if it generated any error messages that weren't severe enough to cause the game to crash.
 

joseanjim

Villager
Member
Joined
Sep 15, 2015
Messages
11
Reaction score
1
First Language
spanish
Primarily Uses
screenshot.png
screenshot2.png
screenshot3.png
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,754
Reaction score
7,861
First Language
German
Primarily Uses
RMMV
looks like you got a damaged file from the download.
the error claims that there is a < in the first line, but there is no such sign in the correct first line of the plugin - and that < that is not supposed to be there throws a syntax error because it is wrong.

you need to redownload the plugin and make sure that you get it correctly this time.
 

joseanjim

Villager
Member
Joined
Sep 15, 2015
Messages
11
Reaction score
1
First Language
spanish
Primarily Uses
You are right. TY so much! This is what I need to create my random map...
 

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

Latest Threads

Latest Posts

Latest Profile Posts

werewolf and his friends added!!

YAY! I just posted my third Guide! Setting up STEAM Integration in RPG Maker MV WITH updated NW.js (huge performance update)
rux
MUCLSES!!! :epicface: :epicface:
If you're reviewing someone else's game, don't focus only on the negative and criticize them. Use positive constructive feedback. As game developers, we need to empower one another; not put each other down.
just posted a song I made for my game a while back... I sampled the HEY from Earthworm Jim's Snot a problem levels lol...

Forum statistics

Threads
107,500
Messages
1,030,110
Members
139,629
Latest member
Beasuce
Top