Jump to content
Vlue

Copy/Paste Map Data

Recommended Posts

Copy/Paste Map Data v1.0
By Vlue

Introduction
Ever wanted to make a house appear out of nowhere? Or anything even remotely like that? Yes? YES? No? Oh.. Well, I did and really... that's a lot of events. So here, have this little snippet that allows you to copy tile data from one map and paste it whereever you want on the current map. I'm sure some of you will think of more features I can do with this, so always feel free to comment.

Features
- Copy a rectangle's worth of tile data from one map and paste to another. That's it! How simple!
- Also copy events from any map to the current!

- You can have autotiles autotile when pasted, by placing this snippet by KilloZapit below this script:
http://www.rpgmakervxace.net/blog/121/entry-454-autotile-update-script/

How to Use
Details in the script itself. It's header specifically. It's all there.

Script
Grab it here, I likes my pastebin: http://pastebin.com/T5wYHRVS

Credit and Thanks
- By Vlue
- Free to use in any project, commercial or non-commercial, go crazy.

Author's Notes
Doodleladoodladoodleldoo Edited by Vlue

Share this post


Link to post
Share on other sites

Any chance you're still working on this script and taking suggestions?

 

Two features that would make this script perfect for my projects.  :)

 

1. Include Shadow Data in the copy/paste process.  I have a wall on the left side of the room that, after throwing a switch, blows open and creates a passageway.  Using your script, I replace the wall area, and the area around it, with a copy of the map where the wall now has a passage and various rubble lying around.  That's great - works fine.  The problem is that there are still shadows lying on the ground where the hole now is (even though there is no shadow on the part of the map I'm copying from...)

 

2. Allow us to paste into a different map than the one that the player is currently in.  The aforementioned blown up hole occurs in a castle in the middle of the game, and should stay blown up throughout so the player always has a way through.  However, after beating the final boss at the end of the game, before saving the New Game+ data, I need to revert the map to the way it was at the beginning the game so that the passage is no longer there the next time through.

 

Regardless, great script so far.  Thanks.  :)

Edited by Apostrophe

Share this post


Link to post
Share on other sites

There is a chance indeed! Pastebin updated, you can now specify to paste the shadow layer as well! And added a new function to paste to a map that you aren't on either. Same as usual just with an added variable: map_paste_ex(id,x,y,l1,l2,l3)

Share this post


Link to post
Share on other sites

In one of my games I'm planning a player purchase city, where the player has to pay to buy shops, crafting areas, market places, etc.

 

This script is absolutely perfect for my needs, been looking for ages for the easiest way to do this, thanks Vlue!

Edited by halrawk

Share this post


Link to post
Share on other sites

Hey there.  Well, I seem to have encountered an issue using map_paste_ex...  It doesn't like to paste on a map ID if you're currently standing on that particular map ID.

 

I have a Common Event script which is set to do several map changes across various maps.  Sometimes I'm standing on one of the maps that will be changed, sometimes I'm not, so using the regular map_paste wouldn't work.  But in this scenario, let's say I'm standing on Map 001, and I call the following script from a common event:

 

map_copy("002",1,2,7,1)
map_paste_ex("001", 11,10,false,true,true,false)

 

In this situation, the map_paste_ex simply doesn't work at all.  But if I'm standing on Map 003, then it will...

Edited by Apostrophe

Share this post


Link to post
Share on other sites

Edited the pastebin to fix that. If you use map_paste_ex while in the same map, it should work now.

Share this post


Link to post
Share on other sites

This script is so awesome I'm having trouble grasping exactly what I COULDN'T do with it.

 

Seems really good for those who have active time or real time battle systems where you can effect changes in the map, such as blowing up a wall or something.

 

Superawesomefantastic job as usual Vlue.

Share this post


Link to post
Share on other sites

Finally got a chance to test version 1.2.  Works great, thanks.  :)

 

At first, I thought 1.2 wasn't working at all, then I discovered that, unlike the map_copy function, which requires the map_id to be in quotes, the map_paste_ex function will only work if the map_id is not in quotes.  Was driving me up a wall, but I figured it out.  :)

Share this post


Link to post
Share on other sites

I have encountered a bug, Vlue.

 

When I try to copy/paste an event using a button press conditional branch, it pops this error...

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Script 'Game_Interpreter' line 1411: RuntimeError occurred.

 

can't add a new key into hash during iteration.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

It runs fine when simply calling the script from a plain event, though.

Share this post


Link to post
Share on other sites

Hi. I found a weird bug. (I'm not using other scripts in the project I noticed it)

I have a map with a house (and a door, lol) and, when I copy an event in that map, I enter the house, when I go out, the door remains black (It doesn't have its graphic)

Z5hHSyE.pngThat happens.

Is there a way to solve it? 

Thanks.

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.

×