RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Kill Autoshadows

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
Kill Autoshadows
Version: 2.0b
Author: modern algebra & Abt Plouton
Date: May 11, 2009

Version History


  • <Version 2.0b> 05.13.2009 - fixed a nasty bug that would appear whenever placing autoshadow producing tiles along the East and South edges of the map
  • <Version 2.0> 05.11.2009 - Made it more precisely target only autoshadow producing tiles, thus rectifying issues with table legs and allows for greater compatibility with any scripts that use the second layer
  • <Version 1.0> 01.28.2008 - Original Release

Description


This allows you to disable the appearance of autotiles and also to re-enable them if you want them to appear for certain maps.

Features

  • Allows you to get rid of annoying autoshadows
  • Easy to turn on and off in-game
  • precise targetting that allows for greater compatibility with scripts that make use of the second layer

Screenshots



Instructions

Place this script above Main and below Materials.

  To disable autoshadows, use this code in a call script:
Code: [Select]
$game_map.autoshadows = false

  To enable them, use this code:
Code: [Select]
$game_map.autoshadows = true

Script


Code: [Select]
#==============================================================================
#  Kill Autoshadows
#  Version: 2.0b
#  Author: modern algebra (rmrk.net) & Abt Plouton
#  Date: May 13, 2009
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#    This script allows you to disable or re-enable autoshadows at any time.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    Place this script above Main and below Materials.
#
#    To disable autoshadows, use this code in a call script:
#
#      $game_map.autoshadows = false
#
#    To enable them, use this code:
#
#      $game_map.autoshadows = true
#==============================================================================

#==============================================================================
# ** Game Map
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - setup
#    new writer instance variable - autoshadows
#    new method - autoshadows
#==============================================================================

class Game_Map
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_writer :autoshadows
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Get Autoshadows
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def autoshadows
    return @autoshadows unless @autoshadows.nil?
    @autoshadows = false
    return false
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Setup
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_remove_auto_shadows_on_setup setup
  def setup (map_id)
    ma_remove_auto_shadows_on_setup (map_id)
    # Rather than repeatedly call a method, set a local variable to have it's data
    ma_data = data
    return if autoshadows
    # For all squares on the map
    for x in 0...(ma_data.xsize - 1)
      for y in 0...(ma_data.ysize - 1)
        # If house autotile
        if ma_data[x, y, 0] >= 4352 && ma_data[x, y + 1 ,0] >= 4352 &&
             ma_data[x + 1, y + 1, 0] < 4352
          # Delete auto Shadow
          ma_data[x, y, 1] = ma_data[x,y,0]
          ma_data[x, y, 0] = 0
        end
      end
    end
  end
end

Credit


  • modern algebra
  • Abt Plouton, for original code upon which I built

Thanks

  • Zeriab, for his Table Printing script, without which I could not have updated this script
  • Dainreth, for the request
  • Anaxim, for reporting a bug in 2.0

Support


Please post here at rmrk.net for the swiftest response

Known Compatibility Issues

Spoiler for Wall Extension Incompatibility Fix:
There was a major compatibility problem that allowed you to walk on to the right hand side of any autotiled ceiling or wall. The code below ought to fix it.

Replace the Kill Autoshadows Script with the following and make sure it is below the Wall Extension Script:

Code: [Select]
#==============================================================================
#  Kill Autoshadows
#  Version: 2.0b (Wall Extension Compatibility)
#  Author: modern algebra (rmrk.net) & Abt Plouton
#             & some code borrowed from Moon Man to make the scripts compatible
#  Date: May 13, 2009
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#    This script allows you to disable or re-enable autoshadows at any time.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    Place this script above Main and below Materials.
#
#    To disable autoshadows, use this code in a call script:
#
#      $game_map.autoshadows = false
#
#    To enable them, use this code:
#
#      $game_map.autoshadows = true
#==============================================================================

#==============================================================================
# ** Game Map
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - setup
#    new writer instance variable - autoshadows
#    new method - autoshadows
#==============================================================================

class Game_Map
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_writer :autoshadows
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Get Autoshadows
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def autoshadows
    return @autoshadows unless @autoshadows.nil?
    @autoshadows = false
    return false
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Setup
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_remove_auto_shadows_on_setup setup
  def setup (map_id)
    ma_remove_auto_shadows_on_setup (map_id)
    # Rather than repeatedly call a method, set a local variable to have it's data
    ma_data = data
    return if autoshadows
    # For all squares on the map
    for x in 0...(ma_data.xsize - 1)
      for y in 0...(ma_data.ysize - 1)
        if ma_data[x, y, 0] >= 4352 && ma_data[x, y + 1 ,0] >= 4352 &&
             ma_data[x + 1, y + 1, 0] < 4352
          tile_id = ma_data[x, y, 0]
          if (4352...5888).include?(tile_id) or
            (6272...6656).include?(tile_id) or
            (7040...7424).include?(tile_id) or
            (7808...8192).include?(tile_id)
            dummy_tile_id = 2000 + auto_(tile_id)
          else
            dummy_tile_id = 1952 + auto_(tile_id)
          end
          ma_data[x, y, 1] = ma_data[x, y, 0]
          ma_data[x, y, 0] = dummy_tile_id
        end
      end
    end
  end
end

Otherwise, no currently known compatibility problems.

Demo


Not required. Just plug the script in and see it work.

Author's Notes


On another forum, somebody was complaining about autoshadows so I wrote a little script to get rid of them if you so wish.

Also, I should mention that the main part of the script was written (apparently) by some guy named Abt Plouton for single maps. All I did was make it globally applicable and fix a few bug issues with bush and table tiles


Creative Commons License
This script by modern algebra is licensed under a Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.
« Last Edit: February 11, 2010, 09:44:42 PM by Modern Algebra »

*
A Random Custom Title
Rep:
Level 96
wah
Cool. :)

Quote from: modern algebra
@Rabu: I don't know. I haven't actually looked into the way auto shadows work.
LOL

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
Hey all, apparently there was a bit of a screw up and the code that was up also removed the bush effect from grass and stuff. I've fixed that now.

pokeball joyOfflineFemale
*
Rep:
Level 85
I heard the voice of the salt in the desert
2012 Best RPG Maker User (Mapping)Project of the Month winner for June 20092010 Best RPG Maker User (Creativity)2011 Best RPG Maker User (Mapping)2011 Best RPG Maker User (Creativity)Winner - 2011 Winter Project of the Season2010 Best RPG Maker User (Mapping)2010 Best RPG Maker User (Graphical)2010 Best Artist2014 Best RPG Maker User - Graphics2014 Best RPG Maker User - Mapping2014 Best Artist2013 Best RPG Maker User (Graphical)2013 Best RPG Maker User (Mapping)2010 Most Unsung Member2010 Most Attractive Female Member
Love this little snippet.

I am having a problem though, it also kills the shadows/legs of tables from TileA2.

Example:
http://img.photobucket.com/albums/v648/joymason/Problem-01.png

Is there any way to fix this without re-enabling shadows?

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
THat does seem to be a big problem. I will look into it, but I am not on my computer right now, so it might be a little while before I get back to you. I will probably be able to fix it though. Anyway, I like your tileset.

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
I'm positive I've been through this database dozens of time and I haven't seen this until now ._.   

I see how this is useful though. Ever have a cliff in VX that's 5 tiles high and the shadow is 4 tiles high? (You should cause it does that anyways) But the lighting is totally off for things like that, where the shadow should only be about 2-3 tiles high, that after you remove them with this script, you can draw them in with the half shadow tile in the map editor :3

I've thought of this a few times, but never cared enough. Lol

pokeball joyOfflineFemale
*
Rep:
Level 85
I heard the voice of the salt in the desert
2012 Best RPG Maker User (Mapping)Project of the Month winner for June 20092010 Best RPG Maker User (Creativity)2011 Best RPG Maker User (Mapping)2011 Best RPG Maker User (Creativity)Winner - 2011 Winter Project of the Season2010 Best RPG Maker User (Mapping)2010 Best RPG Maker User (Graphical)2010 Best Artist2014 Best RPG Maker User - Graphics2014 Best RPG Maker User - Mapping2014 Best Artist2013 Best RPG Maker User (Graphical)2013 Best RPG Maker User (Mapping)2010 Most Unsung Member2010 Most Attractive Female Member
Just wondering if there was any progress on the fix.

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
No, not yet. I did look into the problem but had difficulty diagnosing the problem since Tilemap is a hidden class. I fully intend to look into the problem again and will hopefully find a fix.

**
Rep:
Level 84
the script might break counter tiles and bush tiles too. at least that's what happened with the original by abt plouton. something else to look into when making your fix

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
No, bush tiles are fine. Haven't checked counter tiles.

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
Alright, I've been looking into tilemaps for a terrain tags script I'm writing, and so I finally decided to get off my ass and figure out what to do about this fellow. SO now it's done and tables and everything works now, I think. Enjoy!
« Last Edit: May 12, 2009, 02:08:11 AM by modern algebra »

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
:lol: awesommeeee

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
Updated to 2.0b, as Anaxim reported a bug that would occur whenever autoshadow-producing tiles were placed on the East or South edges of a map. If you have 2.0, then you must replace it with 2.0b

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
I created another version of the script for compatibility purposes with Moon Man's Wall Tile Extension script. It can be found in the original post under Known Compatibility Issues. It will only work if Moon Man's script is already installed.

**
Rep:
Level 82
and it was I needed!! thanks!! Algebra!! :blizj:

**
Rep: +0/-0Level 81
RMRK Junior
First let me say, nice little script...

Works as advertised. Problems:

1. The shadow tiles to replace the removed autoshadows are passable.
2. Obviously, this leads to "holes" on the map.
3. Setting the shadow tiles to non-passable means that creating a nice map becomes a tedious exercise.
4. So, why can't I place a tile as one state, change the state and place it without over-riding the original? Am I stupid?
5. Do I need to make E-tilesets to overcome this problem?
6. Sorry for being a noob but this problem is plagueing me.

I really do like the option of taking out the autoshadow because it's ugly. HELP!

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
I don't understand your problem at all. Why does having shadow tiles as passable create holes in the map? That's not obvious at all. Whatever it means I don't see how making them non-passable changes it. Maybe a screenshot would help?

The only thing that I can think you mean is that if you place a shadow over a tile that would normally be non-passable on the A layer, then that tile becomes passable and that's bad. If that's the case, then depending on how many of them there are, you could just use an event layer for the shadow on those tiles - set the graphic as the shadow or else make the event itself non-passable.

**
Rep: +0/-0Level 81
RMRK Junior
Yeah that's about right. Didn't even cross my mind to use an event graphic. And not what I wanted
to hear! Dang... well back to it. Place strategic shadow events as non-passable and keep the rest as
normal. Wow, that will be a lot of events. Break the map up... hmm. OK, thanks m.a. for the quick
reply. If anybody else has any handy advice - always more than one way to skin a cat!

BTW, a screen shot would be superfluous. The map is like a tiered mountain side - a series of stepped
plateaus. Some of the shadows pop up in the wrong places, which is disconcerting.

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
Mmmmmmm wow. You DO realize that there are 2 sets of shadow tiles on TileB, right? One set is passable and the other set is non-passable. Obviously use them both. Use the non-passable shadows on cliffs or over things that shouldn't be able to be walked on and use the passable shadow tiles on things that could be walked on...

**
Rep: +0/-0Level 81
RMRK Junior
Thanks grafikal, that information is EXACTLY what I didn't realize. Sometimes my bent
obscures the most simple solutions. My bad. And for those who are too shy to
ask stupid questions - just do it. You guys are great for the newbie support! Don't
worry I have a lot more innocent questions.

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
Lol, Ok. Glad you didn't know about that, cause it seemed too dumb to ask more from this script without knowing that. Glad we could help.