[solved]Erasing Pictures before transferring to another map.

Heya!

I'm trying to remove all the images generated before I transfer to another map.
But somehow it's not getting deleted.

I'm just trying to roll 1-5 at the moment since I have not finished the code for the others.
So when a variable is chosen from 1-5, a selfswitch is activated, while also turning off the variable rolling.
The selfswitches basically have the same thing inside them but has different pictures depending on what was rolled.
SelfswitchA-E(using yanfly selfswitch&variables) are like the picture I attached, while F-O are blanks.

I made sure to put all the pictureIDs used by the ones from a-e in the erase picture common event.
But when I transfer, they are all still there.
Most likely a timing problem

your event pages with show picture are set to parallel and have absolutely no wait, which means that each show picture is used sixty times per second.

your exit event needs time as well - erasing a single picture does nothing if the other event shows the same picture again and again before you can transfer.

First thing is: always place a wait into EVERY parallel page to prevent lag.
the correct number of waits needs to be experimented - too few and the lag goes up, too many and the event delays its function (which looks like lag to the inexperienced user, but is no lag)

Then make sure that all those parallel event pages showing pictures are disabled as the first step of the common event, before erasing the pictures.
Most likely a timing problem

your event pages with show picture are set to parallel and have absolutely no wait, which means that each show picture is used sixty times per second.

your exit event needs time as well - erasing a single picture does nothing if the other event shows the same picture again and again before you can transfer.

First thing is: always place a wait into EVERY parallel page to prevent lag.
the correct number of waits needs to be experimented - too few and the lag goes up, too many and the event delays its function (which looks like lag to the inexperienced user, but is no lag)

Then make sure that all those parallel event pages showing pictures are disabled as the first step of the common event, before erasing the pictures.
Thank you, I haven’t tried putting wait on it so I’ll try that later, hopefully it works.

One thing I forgot to mention was there’s 5 of these parallel events that randomize which picture they show, the only difference was the location, and they all work, I can see all 5 images randomly generated every refresh of the map. So maybe that also causes some issues?

As for turning off the parallel events before erasing, I believe I did that by turning off the switch that actually generate the images. All 5 are using the same switch, and when an image is generated, they should autoswitch off that switch.
I believe I did that by turning off the switch that actually generate the images.
no, it doesn't.

Page priority is highest page number has priority, if several pages have their conditions fulfilled then the one with the highest page number remains active - as there can only be one active page per event.

changing conditions for page 1 of an event does absolutely nothing for any of the higher pages, which is why their parallels will remain active even after you turn off the randomizer switch.
no, it doesn't.

Page priority is highest page number has priority, if several pages have their conditions fulfilled then the one with the highest page number remains active - as there can only be one active page per event.

changing conditions for page 1 of an event does absolutely nothing for any of the higher pages, which is why their parallels will remain active even after you turn off the randomizer switch.
Oh I see what you mean.

So the switch off on page1 after switching the selfswitch of the variable is pointless?

And I have to transfer that switch into the exit itself?
yes and no - there are several options of what you can and can't do, depending on circumstances.

If you never return to the same map (unlikely due to it being a shop) you could create an additional higher page and switch that one active to disable the parallels.

If you need to return to the map and need the event to start again from scratch, then you need to disable all conditions for all higher pages (which is one reason why structures like that are uncommon)

Most people that use setup events try to get the entire setup on a single event page, because then they can use erase event and it will work again after reloading the map.

An additional problem of your event is the use of self-switches. ONLY the same event has access to the self-switches, or a common event called from the same event.
Since the common event for exit is called by another map event, it has no direct access to the picture event self-switches.

So no matter what you do, you'll have to redo the event big time.
and given that, I strongly suggest you change the condition from switch to variable.
That would make your event much easier and much shorter

You need to be carefull with the numbering, but if you give each page its own page number as a variable condition, then a randomized variable will jump directly to activate that page, and setting the variable to zero will remove all conditions with one command.

just keep in mind that skipping numbers in the condition makes the next lower existing number take all solutions due to the >=, but that can be intended if you want the different pages to have different probability.
yes and no - there are several options of what you can and can't do, depending on circumstances.

If you never return to the same map (unlikely due to it being a shop) you could create an additional higher page and switch that one active to disable the parallels.

If you need to return to the map and need the event to start again from scratch, then you need to disable all conditions for all higher pages (which is one reason why structures like that are uncommon)

Most people that use setup events try to get the entire setup on a single event page, because then they can use erase event and it will work again after reloading the map.

An additional problem of your event is the use of self-switches. ONLY the same event has access to the self-switches, or a common event called from the same event.
Since the common event for exit is called by another map event, it has no direct access to the picture event self-switches.

So no matter what you do, you'll have to redo the event big time.
and given that, I strongly suggest you change the condition from switch to variable.
That would make your event much easier and much shorter

You need to be carefull with the numbering, but if you give each page its own page number as a variable condition, then a randomized variable will jump directly to activate that page, and setting the variable to zero will remove all conditions with one command.

just keep in mind that skipping numbers in the condition makes the next lower existing number take all solutions due to the >=, but that can be intended if you want the different pages to have different probability.
I’m not familiar with using variables instead of selfswitches, but if it’s as simple as just changing the condition to a variable I think I understand.

So for the page1, the setup will be the same but instead of having it switchon a selfswitch, the variable chosen itself will be the condition for pages 2 and up to activate.

So for page 2, it will be if Variable == 1?
Am I getting it right? Unfortunately I cannot test it at the moment because of work, so I’m not sure if I’m getting the idea properly..
So for page 2, it will be if Variable == 1?
Theoretically yes, but if you are that inexperienced with variables I would have two other suggestions:

1) use variable exactly as page number (page number 2 gets variable >=2), and in the randomizer on the first page start with 2 as lowest result (roll 2..6 instead of 1..5 like you did above)

2) follow the link to the starting point in my signature, it links to several other tutorials.
One of those tutorials is the "Variables Guide", which is a game made in VXA - but variables never change and those basics still count everywhere.
And you can download the Ace trial to get the event code for all those tutorial events after playing it through
Theoretically yes, but if you are that inexperienced with variables I would have two other suggestions:

1) use variable exactly as page number (page number 2 gets variable >=2), and in the randomizer on the first page start with 2 as lowest result (roll 2..6 instead of 1..5 like you did above)

2) follow the link to the starting point in my signature, it links to several other tutorials.
One of those tutorials is the "Variables Guide", which is a game made in VXA - but variables never change and those basics still count everywhere.
And you can download the Ace trial to get the event code for all those tutorial events after playing it through
Thank you very much! I will look it up later and update you how it goes.
Theoretically yes, but if you are that inexperienced with variables I would have two other suggestions:

1) use variable exactly as page number (page number 2 gets variable >=2), and in the randomizer on the first page start with 2 as lowest result (roll 2..6 instead of 1..5 like you did above)

2) follow the link to the starting point in my signature, it links to several other tutorials.
One of those tutorials is the "Variables Guide", which is a game made in VXA - but variables never change and those basics still count everywhere.
And you can download the Ace trial to get the event code for all those tutorial events after playing it through
Just wanted to thank you again for the help yesterday! I fixed my events now using variables and they work the way I wanted them to.

I also figured out how to do it by SelfSwitches, the main problem was that the SelfSwitches weren’t being switched off as well when I map transfer.

Basically a bunch of basic stuff I should know by now and yet I always forgot to do!

Original thread: https://forums.rpgmakerweb.com/threads/solved-erasing-pictures-before-transferring-to-another-map.159090/