Exchanging tilesets between maps?

Hi.

I need a small script to work with RGSS2 (RMVX) that does this.

Upon the player entering maps 80, 399, 397, 398, and 400 the script should copy all files from the Graphics\System\Tileset2 folder to the Graphics\System folder.

After that, if the next map player enters isn't one of the mentioned above, the script should copy all files from Graphics\System\Tileset1 folder to the Graphics\System.

It's the only way around the limitations of RPG MAKER VX tileset system. I prefer the one used in RPG MAKER XP. I don't know why they decided to limit the tileset in the newer version.

In any case, could someone help out flesh something? Pathing isn't a problem. It should always be the one set in the editor.
I only need the TileD file swapped, but let's make it swap all if it's not a problem (just in case in the future I need more tiles).

Through google I found that a script exists that might potentially do the things I need done, but I can't find it anywhere. Only things I found are the name and the author. It's Modern Algebra's Tileset Swap Script.

I also tried using ChatCPT but I better not post that here. It just kept popping method errors so I just gave up. Sometimes it writes something usable and working but today it's just not working.

Any help with this is appreciated.
You could try this one:

Ruby:
# * KTilesetDir VX * #
#   Scripter : Kyonides Arkanthes
#   2024-10-26

# This scriptlet allows you to define a custom tileset directory located in the
# Graphics folder.

module KTileset
  TILESET_DIR = "Tilesets"
  # Add as Many Map ID's as deemed necessary, i.e. [1,2,3,4]
  MAP_IDS = []
end

module Cache
  def self.tileset(filename)
    load_bitmap("Graphics/#{KTileset::TILESET_DIR}/", filename)
  end
end

class Spriteset_Map
  alias :kyon_tileset_dirs_sprtst_map_crt_tilemap :create_tilemap
  def create_tilemap
    if KTileset::MAP_IDS.include?($game_map.map_id)
      create_custom_tilemap
    else
      kyon_tileset_dirs_sprtst_map_crt_tilemap
    end
  end

  def create_custom_tilemap
    @tilemap = Tilemap.new(@viewport1)
    @tilemap.bitmaps[0] = Cache.tileset("TileA1")
    @tilemap.bitmaps[1] = Cache.tileset("TileA2")
    @tilemap.bitmaps[2] = Cache.tileset("TileA3")
    @tilemap.bitmaps[3] = Cache.tileset("TileA4")
    @tilemap.bitmaps[4] = Cache.tileset("TileA5")
    @tilemap.bitmaps[5] = Cache.tileset("TileB")
    @tilemap.bitmaps[6] = Cache.tileset("TileC")
    @tilemap.bitmaps[7] = Cache.tileset("TileD")
    @tilemap.bitmaps[8] = Cache.tileset("TileE")
    @tilemap.map_data = $game_map.data
    @tilemap.passages = $game_map.passages
  end
end
Thank you very much. Works beautifully.

Since it seems you're amazing at this I have another question. It's regarding zooming. Is it possible to zoom in on the camera with a script? I have some events that I'd like to zoom in on when a sprite animation is playing.

If I could use a script call to zoom in and out on an event I specify would be perfect but dunno if something like that is possible using VX.
That would require you to start a new thread...
Honestly, zooming in and out can be, err, problematic. I don't remember if there was such a script for VX. I know there's one for VX ACE.

Original thread: https://forums.rpgmakerweb.com/threads/exchanging-tilesets-between-maps.172842/