Clearing all pictures on map transfer?

RinOmoiyari

Villager
Member
Joined
Sep 18, 2014
Messages
6
Reaction score
0
First Language
English
Primarily Uses
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.
 
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
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.
 

RinOmoiyari

Villager
Member
Joined
Sep 18, 2014
Messages
6
Reaction score
0
First Language
English
Primarily Uses
(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! :)
 

Shaz

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

RinOmoiyari

Villager
Member
Joined
Sep 18, 2014
Messages
6
Reaction score
0
First Language
English
Primarily Uses
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
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
you can also do the lights using events afaik... try to look for BustedEd's tutorial
 
Last edited by a moderator:

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,141
Reaction score
15,473
First Language
Filipino
Primarily Uses
RMMZ
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
 
Last edited by a moderator:

RinOmoiyari

Villager
Member
Joined
Sep 18, 2014
Messages
6
Reaction score
0
First Language
English
Primarily Uses
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!
 

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,141
Reaction score
15,473
First Language
Filipino
Primarily Uses
RMMZ
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.
 
Last edited by a moderator:

RinOmoiyari

Villager
Member
Joined
Sep 18, 2014
Messages
6
Reaction score
0
First Language
English
Primarily Uses
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!
 

RinOmoiyari

Villager
Member
Joined
Sep 18, 2014
Messages
6
Reaction score
0
First Language
English
Primarily Uses
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?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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
 

Shaz

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

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

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,078
Members
137,580
Latest member
Snavi
Top