Tile Changer (Copy Tiles and Change Tiles)

● ARCHIVED · READ-ONLY
Started by Shaz 112 posts Page 4 of 6 View original ↗
  1. @joseanjim did you get it to work after redownloading?
  2. @Shaz yes! thank you!
  3. It seems like I am doing something completely wrong here.
    I have 2 maps, Worldmap and Worldmap2.
    I want to copy tiles from Woldmap2 to Worldmap.

    I set NO note on Worldmap2. On Worldmap I set the following note:
    <load:[{"name":"Worldmap2","map":003}]>
    The ID for Worldmap2 is correct.

    I have set a plugin command, but is triggered through an action button, so not automatically.
    When I load Worldmap I get the follow error:


    rpg_managers.js:1919 Uncaught SyntaxError: Unexpected number in JSON at position 28
    SceneManager.onError @ rpg_managers.js:1919
    rpg_managers.js:1920 chrome-extension://odlameecjipmbmbejkplpemijjgpljce/index.html 1
    SceneManager.onError @ rpg_managers.js:1920
    index.html:1 Uncaught SyntaxError: Unexpected number in JSON at position 28
    at JSON.parse (<anonymous>)
    at Function.DataManager.onLoad (Shaz_TileChanger.js:122)
    at XMLHttpRequest.xhr.onload (rpg_managers.js:86)
    MVCommons.js:953 No parameters could be found for 'ShaderTilemap' !!
    $.parameters @ MVCommons.js:953

    ... I am doing something wrong here? :x
  4. Try 3 instead of 003 on the map note.

    If that doesn't help, can you post a screenshot of the event with the plugin call?
  5. @Shaz Do you allow edit of this plugin (for my own use) ?
    I like this plugin but I'm not a big fan of using notetags, so if you don't mind I'd like to modify it to use plugins parameters instead.
  6. @TWings yes, go for it, as long as you still credit me and don't remove my name from the header section.

    Just note that using map notes allows the additional maps to be loaded as part of the map loading process, while putting them in a plugin parameter might result in a delay where you can see the "old" version of the map while the "new" version is loading. But good luck with it :)

    Looking back, I'm not entirely sure why I made the map notes so convoluted. I could have just made it an array of map numbers. If I rewrite it (which I'll surely do for MZ), I think I'll do that to make it more simple.
  7. Nice, I'm gonna give it a try.
    Of course I'm crediting you for it (I mean, I just change the way I'm using it, you're the one who actually did all the hard work).

    I'm currently trying to optimise my project, and make things a bit easier for me.
    Note tags tend to make it harder to keep tracks within the editor (and the maps Note area doesn't help either) compared to have everything in the same place.

    Thanks for the advice. I'll see if I can figure something out.
    If it doesn't go smoothly enough, I'll just give up, I guess.

    EDIT :
    Alright, still gonna need to run a few more tests to make sure, but it looks like I got it working without too much trouble (although I simplified it to only manage one extra map per map). I did manage to keep it within the loading process, so there shouldn't be any delay problem.
    I also kept the name parameter, it does help to keep tracks better than only map ids.
  8. Shaz said:
    @TWings If I rewrite it (which I'll surely do for MZ), I think I'll do that to make it more simple.
    I absolutely love TileChanger. I got rid of a slew of events with this plugin. I'd love to port my game to MZ, so I'm definitely looking forward to the MZ version. Thank you so much for all you do.
  9. I'm also looking forward to a port to MZ.
    I think this plugin can make all kinds of interesting story-telling changes in a game.
    I, for one, just wanna change wallpapers :D

    Thank you for this plugin!
  10. Please, we need a MZ port of this wonderful plugin! :)
  11. Shaz said:
    Tile Changer
    2018.03.24
    by Shaz

    Introduction
    This plugin allows you to copy a block of tiles from another map to the current map, copy a block of tiles from one spot on the current map to another, or to change individual tiles to a specific tile Id.

    How to use
    Add to your plugin folder (call it Shaz_TileChanger.js) and enable in the plugin manager.
    Set up the notes on the current map only if you want to copy tiles from other maps.
    Use the plugin commands to copy or change tiles.

    Map notes must be in the following format - one name/map pair for each map you want to copy tiles from:
    Code:
    <load:[{"name":"pinkroom","map":120},
           {"name":"blueroom","map":121},
           {"name":"greenroom","map":122}]>

    I suggest doing this in a text editor, as the line won't fit in the map note window, so it's hard to see and can be easy to make mistakes.

    When using the CopyTiles command to copy from another map, use the 'name' from the map note box rather than the map id. This does not need to be the same as the display name or the editor name of the map.

    Plugin Commands

    CopyTiles dx dy 'source' sx1 sy1 sx2 sy2 z-list
    Copies tiles from another (or the same) map, where
    dx is the x-coordinate of the top left destination area
    dy is the y-coordinate of the top left destination area
    source is the 'name' of the source map in the map note or 'self' if you want to copy a section of the current map - you need to put quotes around this name.
    sx1 is the x-coordinate of the top left source area
    sy1 is the y-coordinate of the top left source area
    sx2 is the x-coordinate of the bottom right source area
    sy2 is the y-coordinate of the bottom right source area
    z-list is an optional series of z values indicating which layers to copy; if more than one, just use spaces between; if omitted, all layers will be copied

    ChangeTile x y z tileId
    Changes the tile at the specified coordinates and layer to the tileId
    indicated. Note - no auto-formatting of autotiles happens here.

    Z-layers
    0 - ground layer (most A tiles)
    1 - ground cover layer (A1 tiles with transparent areas, and right 4 columns of A2 tiles)
    2 - upper layer 1
    3 - upper layer 2
    4 - shadow layer
    5 - region layer

    All arguments can be script commands that will be evaluated - make sure there are no spaces anywhere within the individual arguments/script commands.

    Example

    CopyTiles 3 3 'destroyed' 5 8 9 12
    copies the area between 5,8 and 9,12 from the 'destroyed' map to the current map, with the upper left at 3,3. All layers are copied

    CopyTiles 3 3 'wilted' 5 8 9 12 2 3
    copies layers 2 and 3 (the upper layers) between 5,8 and 9,12 from the 'wilted' map to the current map, with the upper left at 3,3

    ChangeTile 3 3 2 0
    replaces the tile at coordinate 3,3 on layer 0 (upper layer 1) with tile 0 (which is the 'erase' tile - so this is removing whatever tile may have previously been there)

    Plugin
    Download from pastebin
    make sure to save it as Shaz_TileChanger.js

    Credit
    - Shaz

    Terms
    - free for use in commercial games
    - do not post elsewhere - link back to this page

    Notes
    This plugin changes/copies the tile Id, not the image. So your other maps should use the same tileset, or at least have the the tiles that you want to copy in the same position on both tilesets. Otherwise you could be trying to copy a vase with flowers from one map, and have it turn into a teddy bear on the other.

    [introduced 2018.03.24] This plugin now saves the tile changes. If you leave the map (to another map, the battle screen or a menu) and return, the tile changes will still be there. You do not need to add a parallel process event to re-run the tile changes anymore.

    I have only done basic testing with this plugin. If you have issues, please provide me with a copy/paste, or screenshots of
    1. Your plugin command
    2. Your map note box if you're using the CopyTiles command (copy/paste that one)
    3. The console log, showing the error message and the script name and line number

    Change Log
    2018.03.24 1.10 - tile changes are now saved. Solves issue of tiles reverting when returning from the menu or battle, and an event to re-change the tiles when coming from another map are no longer required.
    This is what I'm looking for. Where's the download?
  12. PeeteyP said:
    Where's the download?

    That would be in the first post, which you quoted, where it says Download from Pastebin.
  13. Hi Shaz,big thanks for this plugin! I have just a little issue, it's possible to put a variable on locations X and Y? exemple:

    Code:
    ChangeTile \V[4] 10 2 5

    Maybe the type of the variable send is false ? I don't know :/
  14. Nadaco said:
    it's possible to put a variable on locations X and Y?

    Shaz said:
    All arguments can be script commands that will be evaluated - make sure there are no spaces anywhere within the individual arguments/script commands.

    You'll have to use $gameVariables.value(4)
  15. Shaz said:
    You'll have to use $gameVariables.value(4)
    Oh all work! Big thanks Shaz!
  16. 1618254579610.png1618254610578.png1618254629388.png1618254656019.png

    Why Unexpected number???
  17. telecrayon said:
    Why Unexpected number???
    It is a plugin command, not a script call.

    You have also given it the wrong name:

    Shaz said:
    How to use
    Add to your plugin folder (call it Shaz_TileChanger.js)


    Shaz said:
    Plugin
    Download from pastebin
    make sure to save it as Shaz_TileChanger.js
  18. 1618300388002.png1618300410793.png1618300434431.png1618300450770.png

    Perfect!!!! Thanks you!!! :D Merci @Shaz
  19. Got MZ and I'm looking forward to getting this ported to it :smile:
  20. Got it working with FossilMZ project found on the forums, works well so far.