Scripted Battle Encounter Continuously Loops, Even With Self-Switches

Hi, I'm having a problem with a battle continuously looping after completion of the event, even with self-switches active. I'll post screen shots as links, as I don't want to fill peoples' pages with images.

Event Page 1:
http://i.imgur.com/P0qvcxM.png

Everything works correctly on this tab. The mob wanders around on its own, and confronts me when within X range (in this case 3 tiles).

Event Page 2:
http://i.imgur.com/tJmbuAg.png

This is where things go wrong. If I had an Erase Event in there, the roaming mob disappears when I try to engage it. If I add a third page with just Self-switch A =ON, the mob and the event are gone entirely when I enter the area, battle isn't even a possibility.

Any help figuring out where I'm going wrong would be greatly appreciated! I'm entirely new to this entire thing, and haven't really got a clue as to what I'm doing.
Try turning Self Switch A OFF on page two, instead of ON.

Edit: Hm... Taking a closer look at you event, I'm wondering why you don't just put everything on one page. You could nest the conditional branches like so:

Fo8FNeV.png


Then on the second page you'd set the condition as "Self Switch A = 'ON'". That would permanently remove the enemy encounter from the map after its defeat. If you want it to respawn, you could just replace the self switch command with "Erase Event" so it would reappear each time you return to that map.
That did nothing for me. 🙁
Move the turn self switch off command immediately after the battle processing, within the conditional.
That did nothing for me, either. Still having the infinitely looped battle.
Event Page 2:

http://i.imgur.com/tJmbuAg.png

Any help figuring out where I'm going wrong would be greatly appreciated! I'm entirely new to this entire thing, and haven't really got a clue as to what I'm doing.
The problem is on the second page.

You use "control self-switch A= ON", but self-switch A is already ON from the first page, and this second page runs only if the switch is ON.

How to solve the problem depends on what you want to do.

If you want to disable the event, then you need to change that to "Control self-switch B = ON" and make an empty third page with condition self-switch B = ON.

If you want to return to the first page, allowing the distance check again, then you need to change the command to "control self-switch A = OFF".

If you want the event to respawn not immediatly but after a wait, then use a self-switch B to turn on a third page, make that third page paralllel process with a wait(500) first, control self-switch A = OFF second and control self-switch B=OFF last.

(replace 500 with whatever wait-time you want)
The problem is on the second page.

You use "control self-switch A= ON", but self-switch A is already ON from the first page, and this second page runs only if the switch is ON.

How to solve the problem depends on what you want to do.

If you want to disable the event, then you need to change that to "Control self-switch B = ON" and make an empty third page with condition self-switch B = ON.

If you want to return to the first page, allowing the distance check again, then you need to change the command to "control self-switch A = OFF".

If you want the event to respawn not immediatly but after a wait, then use a self-switch B to turn on a third page, make that third page paralllel process with a wait(500) first, control self-switch A = OFF second and control self-switch B=OFF last.

(replace 500 with whatever wait-time you want)
 Like this, or I did misunderand what you said?

Tab 2:

Spoiler
[IMG]http://i.imgur.com/gyQGQYz.png[/IMG]
Tab 3:

Spoiler
[IMG]http://i.imgur.com/WLVOtC1.png[/IMG]
Edit: Hollow, your edited update worked perfectly, thank you! 🙂 The reason it was on two pages was because that's what the tutorial I watched said to do, and as I'm new to this entire thing (never even heard of the RPG Maker until yesterday), I'm rather ignorant to 99.99% of the stuff.
Like this, or I did misunderand what you said?
You completely misunderstood what I said, your pictures especially show that you don't understand the difference between a condition and a control command.

If a page is conditioned to a self-switch, then it can only be activated if that self-switch is ON. To get to your page 3 of your post, it's required that the self-switch B is already ON - the control self-switch B = ON on that page is absolutely useless, because it sets the switch to ON, even if the switch was already ON before that command was executed.

Similiar to your original second page and the modified second page - in both cases the self-switch A=ON on those event pages is absolutely useless.

I strongly suggest that you read the tutorials about switches and variables before continuing development of your game - you will not be able to make anything more complex without having an understanding how switches and variables work.
I see, thanks for the information and the tip. 🙂 I'm a visual learner, I learn better/faster by seeing and doing than I do reading.
Is this resolved now?

Original thread: https://forums.rpgmakerweb.com/threads/scripted-battle-encounter-continuously-loops-even-with-self-switches.20438/