A way to disable autoshadow

Roxas162

Game Designer
Veteran
Joined
Sep 19, 2013
Messages
33
Reaction score
1
First Language
English
Primarily Uses
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.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Unfortunately there is no way to distinguish auto-shadow from manual shadow.
 

Neon Black

The Classy Prostitute
Veteran
Joined
Mar 17, 2012
Messages
1,149
Reaction score
374
First Language
Sarcasm
Primarily Uses
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
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 

Neon Black

The Classy Prostitute
Veteran
Joined
Mar 17, 2012
Messages
1,149
Reaction score
374
First Language
Sarcasm
Primarily Uses
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.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Ah, of course, you're right. I did think it curious that you were using tilemap and not modifying $game_map.data directly :)
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
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.
 
Last edited by a moderator:

Roxas162

Game Designer
Veteran
Joined
Sep 19, 2013
Messages
33
Reaction score
1
First Language
English
Primarily Uses
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?
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
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
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top