Make 2 pages.
First page
-your code here-
@>Switch operation: [0001] ON
Second page.
Just set the trigger (on the top- left corner, below the event name thing...) to switch 0001
Did you understand how it works. After your whole code it turns on a SWITCH which does something like marks that this piece of code is over. On the second page, you set the trigger as the switch you just turned on. So that means that the code has been executed and the switch has been turned on. The second page checks to see whether the switch is ON or not. And after the code it is turned on. On the second page, there is no code. If you put code over there, that code will be executed after the switch is turned ON.
Example: If you want some person to block your way, and only move after you have talked to somebody else, then you'll use a switch. You will make the person blocking your way have to pages. On the first page, you will make a message saying "I can't let you pass" (or anything you want) . On the second page, you will remove his graphic, and also make his type "Through". But, on the second page, you will set the trigger to the switch that will be turned ON after you speak to the person who he wants you to speak to. The other person's code will be like this:
@>Show message: Now that stupid old man will let you pass
@>Switch operation: [0002: Spoken to person] ON
And the second page trigger will be switch: [0001: Spoken to person]
This checks, whether you have spoken to the person or not. And if you have, then the switch will also be on, resulting in the <<man blocking your way>> 's graphic as well as the position changing.
Note: On the second page, make sure you change the graphic to nothing and the type to "Through"
PS: You might want to name your switches, just like I have named switch 0002 "spoken to person" . This doesn't have an effect on the game, but it is used for reference so that you can remember what each switch does.
Self Switches: Self Switches are similar to switches, except, when you're using a self-switch, it works only on the event you turn it ON. In the previous example, you saw that you had to talk to
two people for the whole process to end. That is why a switch is used. The value of switches, are taken into consideration by every event, whereas a self-switch is one which is INDIVIDUALLY meant for the specific event.
Example: A chest.
Page 1:
@>: Text: You got a potion!!
@>: Change items: Potion + 1
@>: Self Switch A: ON
Page 2: [trigger: Self Switch A]
@> Text: It's empty.
You see? Now this self-switch will ONLY work on this specific chest, and not on any other event.
PS: Very very tired, typing such a detailed description. I'll explain variables later... but you can expect a detailed explanation from me