Tile Changer (Copy Tiles and Change Tiles)

● ARCHIVED · READ-ONLY
Started by Shaz 112 posts Page 5 of 6 View original ↗
  1. JavaScript:
    CopyTiles 1 1 'layout' $gameVariables.value(6) 1 ($gameVariables.value(6) += 15) 11
    returns the error "Invalid or unexpected token." How can I get this to use the incremented variable without returning an error message?
  2. Alador said:
    JavaScript:
    CopyTiles 1 1 'layout' $gameVariables.value(6) 1 ($gameVariables.value(6) += 15) 11
    returns the error "Invalid or unexpected token." How can I get this to use the incremented variable without returning an error message?
    use a script call instead of a plugin command - plugin commands don't evaluate inputs (so it is trying to read the text string '$gameVariables.value(6)' instead of the value of game variable 6.)

    Code:
    changeTile(1,1,'layout', $gameVariables.value(6), 1, ($gameVariables.value(6) += 15), 11)
    should probably work
  3. Restart said:
    plugin commands don't evaluate inputs

    this one does, but

    Alador said:
    ($gameVariables.value(6) += 15)
    this isn't valid. The plugin uses spaces to delimit terms, not parentheses. And what is the += for? That's an assignment operator and shouldn't be used here at all. If you want to increment the value, do it either before or after the plugin command. If you just want that value plus 15, get rid of the =.


    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.

    Change it to
    Code:
    $gameVariables.value(6)+15
    (with no spaces)
  4. I stand corrected!
  5. @patternBlue I doubt that would work because that editor uses a different tileset structure
  6. Andar said:
    @patternBlue I doubt that would work because that editor uses a different tileset structure
    Yeah I kinda thought so, thanks for your reply!
  7. Hey @Shaz, is there an option to copy tile depending on player posiotion? For example you can draw a road under player while walking.
  8. @fizzly you pinged the wrong person...

    @Shaz is the programmer of this plugin...
  9. fizzly said:
    is there an option to copy tile depending on player posiotion? For example you can draw a road under player while walking.
    You'd have a parallel process on the map that is checking for the player to have moved - do a Google for events for footstep sounds or walking, you'll get many examples you can copy.

    Then, inside a conditional branch for the player position having changed, you'd make the appropriate plugin command for this to change the tile image.

    Note that drawing a road is kind of complicated, because they're typically an autotile that looks different depending on the tiles around it. This plugin won't handle that, because you're choosing a specific square from the tileset to place on the map, so if you want an autotile road to look right, you're going to have a pretty complex set of nested conditionals to see what's around it and place the appropriate road image.
  10. Andar said:
    @fizzly you pinged the wrong person...

    @Shaz is the programmer of this plugin...
    Sorry... edited that.
  11. What @ATT_Turan said.

    The coordinates are easy enough - the plugin command will take things like $gamePlayer.x and $gamePlayer.y as arguments. It's telling it what tile to use that's going to be complicated.
  12. Hi ! What a amazing script !

    ChangeTile work perfectly ! But i just can't make CopyTiles work i just dont understand what im doing wrong :/

    I want to copy 3 tile from the map 005 to the map 004

    I keep getting ''build is not defined''

    not defined.png
    test.png

    Code:
    <load:[{"name":"build","map":5}]>
    test2.png
  13. RadicalRaticate said:
    I keep getting ''build is not defined''
    that is because you didn't give a string with the name build but tried to use build as a variable, and that of course is not defined.
    look at Shaz' examples in the first post to see what your command is missing - namely the string defining '
  14. Good pickup!

    In hindsight, I sometimes wish I'd not used names at all for maps, and just made it use map ids.
  15. I'm not sure if this is necroing, but I was wondering if this plugin works with RMMZ too? I tried setting it up, but I'm not getting access to any plugin commands. I thought I'd post a thread about this, but I don't appear to have enough privileges for that yet.

    Thanks in advance for any help.
  16. space_lion said:
    if this plugin works with RMMZ
    unlikely - MV forces automatic layering, MZ allows for manual layer choice.
    That makes the maps sufficiently different that this plugin is unlikely to be able to handle the MZ data.
  17. Andar said:
    unlikely - MV forces automatic layering, MZ allows for manual layer choice.
    That makes the maps sufficiently different that this plugin is unlikely to be able to handle the MZ data.
    I got it to work with the FOSSIL plugin, works nicely so far.
  18. Hello again :)

    I was wondering if it's possible to use region ID instead of the coordinates when changing tiles.
    I'm currently using this plugin to change the region ID of the player tile, but when a certain variable/switch changes, I'd like to change the region ID of all these tiles at once, when the player will no longer be standing on them. So for example: change all tiles with region ID 10 to region ID 20.

    Thanks.
  19. Edit! Went a different direction and found it was an error in a different plugin.