Problem with switches and tile swapping

Okay, this is super bugging me. I've tried to fix this over and over again, and it still won't work. What I want to happen is that when a switch is on on a certain map, a script is called, but when it is off the script is not called. At first, it seemed to call the script no matter what, and now it does absolutely nothing whether or not the switch is on.

Here is the event (note these are three pages of the same thing):

Spoiler
5.png
6.png
7.png
Script from here: http://forums.rpgmakerweb.com/index.php?/topic/9396-easy-tile-swapping/
Please do not cut away important parts of the screenshots when posting.


Most probably this problem is caused by a wrong page priority, and you have cut away the page numbers that will solve this.


More specifically, the highest page has always priority, and if the last screenshot is of page three, that has the highest priority - causing the event to stop working after switch B was used the first time.
Its because of the last page....on the second you have erace event. It never gets to the last page because self switch B is never turned on...so it doesnt work at all :/

Edit: Ander you ninja!! Well, you explained it better than I could have, so....lol. 🙂
Its because of the last page....on the second you have erace event. It never gets to the last page because self switch B is never turned on...so it doesnt work at all :/
Wrong - the problem is that the switch B is turned on - on page 1, and then the entire event is deactivated.
Wrong - the problem is that the switch B is turned on - on page 1, and then the entire event is deactivated.
OH! Sorry, I didint see that. My mistake.
Please do not cut away important parts of the screenshots when posting.

Most probably this problem is caused by a wrong page priority, and you have cut away the page numbers that will solve this.

More specifically, the highest page has always priority, and if the last screenshot is of page three, that has the highest priority - causing the event to stop working after switch B was used the first time.
I'm sorry, I didn't know it was so important. I was unable to select everything in MSPaint.

The pages are in this order from top to bottom - 1, 2, 3.

EDIT: Tried switching pages 2 and 3 around. Didn't work.
You don't even need three pages. Why have a page on parallel process that just turns on switches to other pages that run on parallel process?


Have ONE event page set to parallel process. Set the page's condition to switch 8.


In the event commands, do you tile swapping, then add an Erase Event command.


This means, when you enter the map, if the switch is off, nothing will happen. If the switch is on, the tiles will be swapped.


When you leave the map and come back later, it'll do the check again.
You don't even need three pages. Why have a page on parallel process that just turns on switches to other pages that run on parallel process?

Have ONE event page set to parallel process. Set the page's condition to switch 8.

In the event commands, do you tile swapping, then add an Erase Event command.

This means, when you enter the map, if the switch is off, nothing will happen. If the switch is on, the tiles will be swapped.

When you leave the map and come back later, it'll do the check again.
I tried this already, and the problem then was that the switch seemed to permenantly switched on. I'll retry and check my leaving event to make sure the switch is set to turn off (but I'm sure it is).
I suggest taking one step back and explaining what exactly the event is supposed to do - because several things don't fit together, and I think it's completely unneccessary to make them parallel processes.


Currently the event (as in the pictures) works this way:


As long as switch 8 is ON, upon entering the map several tiles will be switched to a new tile (based on region), then the event gets erased and reloaded on next map enter.


When switch 8 is OFF, this region tile switching becomes disabled and will stay disabled for the rest of the game. That is the function of the third page when used in that way.


If the tiles should only be switched when switch 8 is on and nothing should happen otherwise, then Shaz suggestion is the way to make the event.


If that doesn't work as intended, then you have some problem with the switches themselves and we need to see the events where the switches are set.


The most common mistake in that case is to place the control switch commands after the transfer player command - because commands after transfer player are usually ignored by the engine...
Show us a screenshot of your one-page event - the WHOLE window, not just a bit of it. If you have it set up as I described and it's not working, it's because you've missed something small or have made a mistake somewhere. It's really better to stick with the one page, as what you're doing - adding 3 pages and several self switches, is just introducing more places for things to go wrong.
Okay, here's the event as one page:

Spoiler
8.png
This event is supposed to turn the switch off:

Spoiler
9.png
These events turn it on. Note that the multiple-paged one is set up so that it only happens once (once self switch A is on, that particular event is supposed to be disabled forever - it's because it's part of the WIP first cutscene).

Spoiler
10.png
Spoiler
11_1.png
The problem with those events is that you made a few aborted sequences - commands that will never be executed. In addition you didn't understand the purpose of some of the commands.


1) Transfer Player: If the transfer command will transport the player to a different map, then all events on the current map will cease to exist and be aborted. Which is the reason why it's usually a bad idea to continue commands after the transfer command.


The second event will only work if the player already is on the map 13:world, it will not work anywhere else.


2) Erase event is temporary. It will erase the event only until the map is reloaded. Which means that by adding erase event to the third event, you're specifically telling the game to rerun the event everytime the map is entered. It might be that the self-switch prevents that, but that is not something you should chance.


Either switch off an parallel process permanently by using a self-switch to an empty page, OR turn it off temporarily until next reload by erasing the event - NEVER both in the same parallel process.
All right, I figured out it's the script itself to blame. So I will be looking into that instead.

UPDATE: Solved! =D Thanks for all the suggestions and help.

Original thread: https://forums.rpgmakerweb.com/threads/problem-with-switches-and-tile-swapping.36522/