Clearing all pictures on map transfer?

● ARCHIVED · READ-ONLY
Started by RinOmoiyari 16 posts View original ↗
  1. Hello!

    So I'm rather new to RPG Maker and I have, what I hope to be, a rather simple question:

    In a hall that I'm working on, I'm using low-opacity pictures to convey light sources:

    1. One Image shows the light coming from the fire place.
    2. Another image shows the light from the window.
    The reason I'm using multiple is because I'm allowing the player to douse/restart the fire and close/open the curtains, so I need to be able to switch the light sources on and off independently.

    The frustrating point I'm running into is on map transfers out of the hall into side rooms. Since images don't disappear between transfers, both images stay visible.

    I know about the Erase Picture command, and that works for clearing them one at a time, but I was surprised there was no "clear all pictures" option.

    So, is there any easy way to clear all the pictures on a map transfer? Or will I need to individual erase each one on each door out of the hall? (And the inverse in those rooms, which have their own light sources?)

    Currently I'm cleaning images up with a parallel process in the related rooms that clears the images, but that's a lot of events spread out across a lot of maps.

    It's not the cleanest/most organized way to go about it, I'm guessing.
  2. I have merged your posts. Please do not double post in future. You can access the forum rules from the lower right corner of any page.


    The easiest way to clear pictures on map transfer would simply be to jump into the Game_Map script's setup method and clear it there. I don't have Ace with me so I can't check the actual command for you, or see if you need to go through and erase them all first to free up memory / properly dispose of the bitmap, or if that would happen automatically.
  3. (Sorry, didn't think to edit my existing one, will do so in the future.)

    Ah, was hoping to avoid dealing with scripts for a bit, but I suppose I'll have to deal with them sooner or later anyway. Thanks for the direction, I'll look into that! :)
  4. You could create a common event that does a script call to do it, and then have a parallel process event on every single map that calls that common event and then erases itself.


    TBH, changing the script would be easier.


    If you can wait a few hours until I finish work, I'll be able to check my own project and see what I did, and check those other things, and can tell you exactly what to change (or give you a little script to add). It's not difficult - I just don't want to guess at it when I don't have any reference in front of me.
  5. Well, I am certainly not in any rush, just learning the system.

    If doing that wouldn't be an inconvenience for you, I'd really appreciate it! :D
  6. you can also do the lights using events afaik... try to look for BustedEd's tutorial
  7. I had this same problem with pictures not clearing fast enough due to fade in fiber thingies. Here's a snippet Galv gave to me when I requested it from him. This clears all pictures upon map transfer. You should be able to load new ones before the player can see stuff.

    Code:
     class Scene_Map < Scene_Base  alias galv_archeia_sm_sb_post_transfer post_transfer  def post_transfer    $game_map.screen.pictures.each { |p| p.erase }    galv_archeia_sm_sb_post_transfer  endend
  8. Archeia said:
    I had this same problem with pictures not clearing fast enough due to fade in fiber thingies. Here's a snippet Galv gave to me when I requested it from him. This clears all pictures upon map transfer. You should be able to load new ones before the player can see stuff.

     class Scene_Map < Scene_Base  alias galv_archeia_sm_sb_post_transfer post_transfer  def post_transfer    $game_map.screen.pictures.each { |p| p.erase }    galv_archeia_sm_sb_post_transfer  endend
    Archeia, this might be exactly what I need, but I'm not sure how or where to implement it.

    I tried using the script command in an event, but got the following error message when it triggered in the playtest:

    "Script 'Game_Interpreter' line1411:NameError occured.

    undefined method 'post_transfer' for class'

    'Game_Interpreter::Scene_Map'

    I know absolutely nothing about scripts yet, so you you could let me know where I should be placing this snippet of code, I would be most grateful!
  9. Go to Script Editor (F11), Under Materials make a new slot (Insert) and paste that snippet and apply then OK. Save your game. You don't need to do anything.
  10. Oh my goodness, this works beautifully! Thank you for your assistance :D

    This will save me from having to make SO MANY events, thank you!
  11. Glad it worked ;D
  12. One last question: Is there a way for me to attach this script to the base RPG Maker setup? or will I need to file it away in a separate doc for whenever I do a new game in the future?
  13. you could always make a sample project with all the extra scripts that you might need on every game, then just copy paste that sample project when you need to create a new game
  14. Yes, unfortunately there doesn't appear to be a way for us to change RTP scripts - only graphic/audio resources. You'll have to set it up with each new project, or follow the suggestion above.
  15. Hey! Sorry to bring this back up so many years later, does anyone know how to add that snippet in Mv? since it doesnt have an in game script editor Im having trouble finding the right spot
  16. Soapcult69 said:
    Hey! Sorry to bring this back up so many years later, does anyone know how to add that snippet in Mv? since it doesnt have an in game script editor Im having trouble finding the right spot
    This is for VX Ace. You're posting in VX Ace Support thread.