Hello,
I know this problem is probably a problem to many of you but I'm a beginner.
I have several NPCs on my map who all will say something when the main character talks to them. How do I apply the single switch on one event that will activate once the character finishes talking to all NPCs? There are only two spaces for switches on every single event but I have more than 2 NPCs.
Thanks in advance.
add a counter at the end of the dialogue of each NPC, tally up the total, and check for it at the final NPC.
make sure the dialogue of each individual NPC doesn't trigger again once the player has talked to them once, or you'll trigger the sum twice, and that'll change the total.
you can use self-switches on each speaking NPC, so that when the dialogue finishes the NPC passes to an alternate state where it doesn't have dialogue, or just dismisses the player.
In the NPC events, just put the commands I've written, using the appropriate text and variable number (same variable for all events).
In the final event that activates, use that variable with the total number it needs to reach on the page conditions. The box above the event sprite.
When the event is set to autorun, as long as the conditions are met it will activate, no matter where the player is. If it is set to Player Touch, you have to actually walk on it.
Are you saying you've spoken with the 15 NPCs then walked onto this, and nothing happens?
The fact that it works when set to autorun indicates the page conditions are working properly. If it doesn't work when you set it to Player Touch means either you didn't talk to all 15 NPCs, or there's an issue with the Player Touch trigger. Play again and make sure you speak with EVERY one (you could temporarily move them so they're all in a line so you don't miss anyone or double up). If it still doesn't work, change the trigger to Event Touch and try again (it shouldn't make a difference, but it might). Then if it still doesn't work, try the below ...
Please copy and paste that event page, then go back to page 1 and remove the variable condition and the transfer player. Instead, put Show Text \V[2]. (does XP let you do that? You want it to display a text box with the value of variable 2).
Then go talk to all your events and walk onto this one. If you've talked to them all and they've all incremented the variable, the second event page SHOULD be active, and you'll transfer. If you haven't talked to them all or something is wrong with one/more of the events (don't increment the variable properly), the first page will be active and it'll tell you how many it thinks you've talked to. If that happens, go recheck all of your events to make sure there's nothing weird in the way they change the variable (you don't have some weird conditions on one or two that cause them not to increment sometimes).
Also make sure you don't have any scripts that use variable 2. And that you do actually have a Map 3 that is at least 11x10 tiles in size.