MapMaker (for RMXP)
#7
Easy fix. Just make sure the custom Spriteset_Map includes this line:

Code:
@preview = Bitmap.new(@width, @height)

So it might say the following:

Code:
#===============================================================================
# ** Spriteset_Map
#-------------------------------------------------------------------------------
#  This class brings together map screen sprites, tilemaps, etc.
#  It's used within the Scene_Map class.
#===============================================================================

class Spriteset_Map
  attr_accessor :use_cache
  attr_reader  :til_on
  attr_reader  :cha_on
  attr_reader  :width
  attr_reader  :height
  attr_reader  :panorama
  attr_reader  :character_sprites
  attr_reader  :fog
  attr_reader  :preview
  attr_reader  :tilesize
  #-----------------------------------------------------------------------------
  # * Object Initialization
  #-----------------------------------------------------------------------------
  def initialize
    @progress = Window_Progress.new("Collecting map data")
    @use_cache = true
    @pan_on = (Settings['pan_on'] == 'true')
    @til_on = (Settings['til_on']).to_i
    @cha_on = (Settings['cha_on'] == 'true')
    @fog_on = (Settings['fog_on'] == 'true')
    @width = $game_map.width * 32
    @height = $game_map.height * 32
    @tile_cache = {}
    init_panorama                            # Initialize Panorama
    init_tilemap                              # Initialize Tilemap
    init_characters                          # Initialize Characters
    init_fog                                  # Initialize Fog
#    init_weather                              # Initialize Weather
#    init_timer                                # Initialize Timer
    @progress.dispose
    @preview = Bitmap.new(@width, @height)
    refresh_preview
  end

Later on you will find a method called refresh_preview. Below you will find the second fix. Or is it a workaround? Thinking

Code:
def refresh_preview
    @refresh = false
    @preview.dispose unless @preview.nil?
    Graphics.update
    # Set initial attempted tilesize for resulting image
    @tilesize = Settings['start_tilesize'].to_f
    # Number of times to try at the larger size before giving up
    tries = 2
    try = 0
    loop do
      # Catch "failure to create bitmap" from large size
      begin
        zoom = @tilesize / 32
        Debug.log 'Starting to refresh preview'
        # Create bitmaps representing the tilemap and assorted layers
        @preview = Bitmap.new(self.width * zoom, self.height * zoom)
        Graphics.update # Creating a large bitmap could take a while
        Debug.log 'Created bitmap'
        # Draw panorama if enabled
        Debug.log pan_on ? 'Drawing panorama...' : 'Skipping panorama'
        if pan_on
          @preview.plane_blt(@preview.rect, @panorama, @preview.rect)
          Debug.log 'Drew panorama'
        end
        # Draw tiles and characters
        tiles = []
        tiles += @tiles0.values.flatten if til_on.to_i == 1
        tiles += @tiles1.values.flatten if til_on.to_i == 2
        tiles += @tiles2.values.flatten if til_on.to_i == 3
        tiles += @tiles.values.flatten  if til_on.to_i == 4
        tiles += @char_tiles if cha_on
        progress = Window_Progress.new("Drawing preview", tiles.size, "tiles")
        i = 0
        tiles.sort.each do |tile|
          if (i += 1) % 1000 == 0
            progress.update(1000)
            Graphics.update
          end
          if @tilesize == 32
            @preview.blt(tile.sx, tile.sy, tile.bitmap, tile.rect, tile.opacity)
          else
            drect = Rect.new(tile.sx * zoom, tile.sy * zoom,
                             tile.rect.width * zoom, tile.rect.height * zoom)
            @preview.stretch_blt(drect, tile.bitmap, tile.rect, tile.opacity)
          end
        end
        progress.dispose
        Debug.log fog_on ? 'Drawing fog...' : 'Skipping fog'
        if fog_on
          @preview.plane_blt(@preview.rect, @fog, @preview.rect, @fog_opacity)
          Debug.log 'Drew fog.'
        end
        Debug.log 'Finished refreshing preview.'
        break
      rescue Exception
        progress.dispose unless progress.nil?
        @preview.dispose unless @preview.nil?
        if (try += 1) % tries == 0
          if @tilesize == 2 # If we cannot reduce the size any more
            Debug.log "Preview draw failed twice at smallest size; aborting."
            p "Cannot create preview; system resources unavailable.",
              "If you have generated other maps, try clearing the map cache."
            @preview = nil
            return false
          end
          Debug.log "Preview draw failed twice; reducing zoom to try again."
          # Reduce the tilesize until it works
          @tilesize /= 2
        end
        Debug.log "Error while drawing preview. Trying again."
      ensure
        zoom = @tilesize / 32
        Debug.log 'Starting to refresh preview'
        @preview = Bitmap.new(self.width * zoom, self.height * zoom)
      end
      Graphics.update
    end
    true
  end

How To Implement These Fixes

  1. There's a file called MapMaker.rxdata in the game's root directory. Copy it.
  2. Create a new project.
  3. Close it. Yes, close it!
  4. Remove the Scripts.rxdata file in the new project's Data folder.
  5. Rename MapMaker.rxdata as Scripts.rxdata.
  6. Copy and paste the fixes following the examples above.
  7. Save the project but DON'T playtest it.
  8. Go back to the MapMaker's root directory and run the MapMaker.exe file.

Now you can open it. Grinning
The problem is that it will throw the error after trying to generate the map. Confused
That is why I came up with the second fix aka the workaround a couple of minutes later.
Yet, there is a chance you will come across a Tile script that makes the executable crash at line 33 thanks to a TypeError bug...

I will ignore any further questions Tongue sticking out so make sure you're reading Book the instructions carefully over and over again until you get the idea.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }


Messages In This Thread
MapMaker (for RMXP) - by DerVVulfman - 06-06-2020, 03:46 AM
RE: MapMaker (for RMXP) - by DerVVulfman - 06-25-2020, 03:56 AM
RE: MapMaker (for RMXP) - by JayRay - 01-13-2023, 01:55 PM
RE: MapMaker (for RMXP) - by DerVVulfman - 01-14-2023, 03:18 AM
RE: MapMaker (for RMXP) - by DerVVulfman - 02-16-2025, 01:37 AM
RE: MapMaker (for RMXP) - by Ace_V - 02-24-2025, 11:05 AM
RE: MapMaker (for RMXP) - by kyonides - 02-24-2025, 12:02 PM
RE: MapMaker (for RMXP) - by Ace_V - 02-24-2025, 03:29 PM
RE: MapMaker (for RMXP) - by Ace_V - 02-24-2025, 03:44 PM
RE: MapMaker (for RMXP) - by DerVVulfman - 02-24-2025, 09:30 PM
RE: MapMaker (for RMXP) - by Ace_V - 02-25-2025, 08:31 AM
RE: MapMaker (for RMXP) - by DerVVulfman - Yesterday, 05:09 PM
RE: MapMaker (for RMXP) - by Ace_V - 7 hours ago

Possibly Related Threads…
Thread Author Replies Views Last Post
   (RMXP) Autotile Expanded JayRay 1 7,647 04-12-2015, 06:12 PM
Last Post: DerVVulfman
   Neko RMXP Player for Android JayRay 2 8,534 10-05-2014, 03:46 AM
Last Post: DerVVulfman
   RMXP Pool formlesstree4 7 12,835 03-20-2010, 01:31 AM
Last Post: formlesstree4



Users browsing this thread: 5 Guest(s)