Display Pictures and erase them when changing map

Okay, this really bugs me up!

I want to use some pictures I made to display some light effects and for overlay mapping.

since I learned today that pictures are global, I have to erase them on every teleport when changing the map. 

and to use different ID's for every picture or assign a new picture to the ID ....

what I want to know now is... do I have to teleport first and then erase the pictures or first erase the pictures and then teleport?

I made a short gif and hope you understand what I mean. and both results don't satisfy me really...

http://imgur.com/OHXtQPk
I know this problem all too well ...

Try this:

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
wow, this is gold!!

for uhm.. 1ms you can see the previous picture, but this is negligible. 

what I really like is, that I don't have to erase every picture manually now, thank you very much! =D
Make a Paralell Event on every Map, let it call Comon Event1 for Example.

Erase Pictures 1 to 10

Erase Event (Thatway everytime the Map get loaded, the Pictures will be Erased and the Code just run 1Time).

Or:

Activate a Switch which is Condition for Paralell Common Event which Erases the Picture Ids and than deactivates the Switch.

(I supose the first Soluton is better and more simple with just making sure to put an event on every map insteed of activating that switch everytime

you want to teleport(?))
The problem is that if you use a map transfer with the default normal fade effect, that will happen first before it disposes all the pictures irregardless if you use a common event. The workaround would be to use fade out screen > Erase pictures > teleport (use instant) > Fade in Screen which is honestly a lot of unnecessary work (But it doesn't have the 1ms appearance).
hm.. but if I use it in your script snippet (fade out, erase pictures, teleport, fade in) then it isn't a lot of work or not? 
then all you have to do is fade out -> teleport -> fade in.
okay, I have written this snippet and it works like a charm!!

#==============================================================================# ** Scene_Map#------------------------------------------------------------------------------# This class performs the map screen processing.#==============================================================================class Scene_Map < Scene_Base #-------------------------------------------------------------------------- # * Player Transfer Processing #-------------------------------------------------------------------------- def perform_transfer #fade type (0 = black) $game_temp.fade_type = 0 #fade out fadeout(60) #teleport $game_player.perform_transfer #erase pictures $game_map.screen.pictures.each { |p| p.erase } #fade in fadein(60) end endnow the pictures doesn't have the 1ms appearance. thank you! =)
To not have that lag, use Bex's method. Just simply add a parallel process event on each map that will erase, or set the correct picture (with an erase event to seal the deal). Do not set the picture or erase the picture inside the event where you are transferring, always have it on the map that needs the picture or have it be erased.


You'll have to copy and paste the event on every map, but the lag should be gone!
@ Archeia, i just rebuild my Solution, and it works fine,

your Described Bug isnt happening.

But iam aware there are always more than one way to do something, and the Scriptway is interesting,

it offers some new rgss3 commands. 🙂
well, the script snippet works perfectly fine for me and the plus is, I don't have to erase the pictures via events and can simply use the teleport command in events, thats all.

and a nice side effect, the map names doesn't appear any more if I enter the maps. XD (note: I use a script to display map names in another way)
well, the script snippet works perfectly fine for me and the plus is, I don't have to erase the pictures via events and can simply use the teleport command in events, thats all.


and a nice side effect, the map names doesn't appear any more if I enter the maps. XD (note: I use a script to display map names in another way)
That's an option you can turn off, basically leave the Display name empty in the map properties.
@ Archeia, i just rebuild my Solution, and it works fine,

your Described Bug isnt happening.

But iam aware there are always more than one way to do something, and the Scriptway is interesting,

it offers some new rgss3 commands. 🙂
It happened to me a lot in Omori, it will get more obvious as you do image heavy stuff or when you animate a lot.
That's an option you can turn off, basically leave the Display name empty in the map properties.
yeah, I know, but I found a script from MogHunter to display map names with a nice effect. this requires to write the text you want to be displayed into the map name box. 

as I tested it, the effect from the script appears AND the default map name display thing. and now this is resolved too with my short script snippet, which makes me really happy! ^_^

Original thread: https://forums.rpgmakerweb.com/threads/display-pictures-and-erase-them-when-changing-map.36990/