Switches Inverted?

Hey Community!


I am trying to design an event where an NPC fights you and then joins you if you win.  However, the switches are acting strange.  I will show code and explain below.

Code:
Comment: Event Page 1
If: Nana In Team = OFF
	
:Else
	Text: None, Dim, Bottom
		:Here Lies Liboria Catalano
		:Born: 1935 Died: 2014
		:Mother, Leader and Radical Grandma
	Control Switches: #0001 Nana Activated = ON
	Set Event Location : This Event, (32,4)
	Control Self Switch: A = ON
:End
Code:
Comment: Event Page 2
If Nana Activated is ON
    Set Movement Route: This Event(Wait)
                Opacity: 0
                Opacity: 10
                Opacity: 20
                Opacity: 30
                Opacity: 40
                Opacity: 50
                Opacity: 60
                Opacity: 70
                Opacity: 80
                Opacity: 90
                Opacity: 100
                Opacity: 110
                Opacity: 120
                Opacity: 130
                Opacity: 140
    Text:NanaFrown(0), Dim, Bottom
        :Liboria: I was known as Liboria.  Will you release me from the chains of Death?
    Show Choices: Yes, No(Dim, Right, #1, #2)
    :When Yes
    Comment: This fight is for the character Libiona.  Dedicated to Stephanie.
    Battle Processing: Liboria
    :If Win
        Control Switches: #0002 Nana In Team = OFF
        Text:NanaFrown(0), Dim, Bottom
            :Liboria: Thank you for honoring my Life. In turn, I will honor yours.
        Set Movement Route: This Event(Wait)
                    Opacity: 140
                    Opacity: 130
                    Opacity: 120
                    Opacity: 110
                    Opacity: 100
                    Opacity: 90
                    Opacity: 80
                    Opacity: 70
                    Opacity: 60
                    Opacity: 50
                    Opacity: 40
                    Opacity: 30
                    Opacity: 20
                    Opacity: 10
                    Opacity: 0
        Set Movement Route: This Event(Wait)
                            :Through ON
        Control Switches: #0001 Nana Activated = OFF
        Exit Event Processing
        Control Self Switch : A = OFF
        Erase Event
        
    :If Lose
        Game Over
        
    :End

    :When No
        Text:NanaFrown(0), Dim, Bottom
            :Liboria:...
        Set Movement Route: This Event(Wait)
                    Opacity: 140
                    Opacity: 130
                    Opacity: 120
                    Opacity: 110
                    Opacity: 100
                    Opacity: 90
                    Opacity: 80
                    Opacity: 70
                    Opacity: 60
                    Opacity: 50
                    Opacity: 40
                    Opacity: 30
                    Opacity: 20
                    Opacity: 10
                    Opacity: 0
        Set Event Location: This Event, (33,5)
        Set Movement Route: This Event(Wait)
                            :Through ON
        Control Switches: :#0001 Nana Activated = OFF
        Exit Event Processing
        Control Self Switch: A = OFF
        Erase Event
        Set Movement Route: This Event(Wait)
                            :Through ON
    :End

As seen above in the comments in the code, event page 1 has the Switch set to OFF, as my brain understands it, I want that switch to be set to ON after she is defeated so the event no longer appears on the map.  However, when I switch it to ON the action press button of event page one doesn't trigger anything.  Event page two is set to parallel.


Feel free to help me clean this up --- I am brand new at this.  Some pictures are attached.


Thank you in advance.


Please feel free to ask any questions!


- Paw

action page 2a.jpg

action page 1.jpg

action page 2b.jpg

action page 2c.jpg

action page 2d.jpg
I suggest you'll streamline the event, because you've implemented several inversion into the event where you'll made the event difficult to read.


For example, in the first page, on action button you check the condition if that switch is OFF - but do nothing if it is off, but use the else-branch (if the switch is not off which means if the switch is on) to do something.


Either you placed the commands into the wrong branch, or it would be much easier to eliminate the conditional branch completely and use the page conditions directly on that switch.


And something similiar on the second page - if you check in a conditional branch if a switch is on, and all the else-branch contains is an erase event, then you better use page condition on that page directly and move the else-part to a third page.


By the way - setting through on after erase event is completely useless, because if the event is erased it won't exist anymore.
Thank you very much for your insight.  I will rework it.  I really enjoy this stuff so back to the stone I go!

Original thread: https://forums.rpgmakerweb.com/threads/switches-inverted.60659/