A way to disable autoshadow

Is there any way to disable autoshadowing? It gets rather annoying that you have to go back and unshadow everything if you're never gonna have to use it if you are using a day & night script.
Unfortunately there is no way to distinguish auto-shadow from manual shadow.
This will completely disable autoshadows:

Code:
class Spriteset_Map  def create_tilemap    @tilemap = Tilemap.new(@viewport1)    @tilemap.map_data = $game_map.data.dup    $game_map.width.times do |i1|      $game_map.height.times do |i2|        @tilemap.map_data[i1, i2, 3] = 0      end    end    load_tileset  end   def update_tilemap    @tilemap.map_data = $game_map.data.dup    $game_map.width.times do |i1|      $game_map.height.times do |i2|        @tilemap.map_data[i1, i2, 3] = 0      end    end    @tilemap.ox = $game_map.display_x * 32    @tilemap.oy = $game_map.display_y * 32    @tilemap.update  endend
That is soooo close to perfect.


Except setting it to 0 will also remove all of your regions.


I DID have a little script that would go through and remove all the shadows while leaving regions intact, but I can't find it right now. You need to do some bit manipulations - maybe something as simple as this:

Code:
@tilemap.map_data[i1, i2, 3] = (@tilemap.map_data[i1, i2, 3] >> 8) << 8
but I haven't tested that logic.
Look again.  It dupes the tilemap from Game_Map when opening it in Spriteset_Map, so the table is left completely intact in Game_Map allowing regions to still be used.  The table is only changed in a new tilemap in the spriteset.
Ah, of course, you're right. I did think it curious that you were using tilemap and not modifying $game_map.data directly 🙂
That's going to be extremely laggy for sufficiently large maps since you're duping the table every frame and performing the loops. I imagine 50x50 would already experience lag.


I'd go with Shaz's approach in changing the map data directly cause that's only done once everytime you load a map.
That is soooo close to perfect.

Except setting it to 0 will also remove all of your regions.

I DID have a little script that would go through and remove all the shadows while leaving regions intact, but I can't find it right now. You need to do some bit manipulations - maybe something as simple as this:

@tilemap.map_data[i1, i2, 3] = (@tilemap.map_data[i1, i2, 3] >> 8) << 8but I haven't tested that logic.
Where would I put this exactly?
This is more efficient as it doesn't do basically the same thing again and again.

If you want to remove shadows, then there's no need to keep the original shadow settings.

Code:
class Game_Map    alias :th_remove_shadow_setup :setup  def setup(map_id)    th_remove_shadow_setup(map_id)    remove_shadows  end    def remove_shadows    for x in 0 ... width      for y in 0 ... height        @map.data[x, y, 3] = (@map.data[x, y, 3] >> 8) << 8      end    end  endend

Original thread: https://forums.rpgmakerweb.com/threads/a-way-to-disable-autoshadow.19759/