Variables...Please help

I hope im asking this in the right spot...I need help figuring out how to make it where i cant move on in my game until


i have talked to three or more npcs.. can someone help me ive viewed tutorials on variables and conditional branches


but i dont think im doing it right..
It would help to know what you've tried. But basically, at each NPC, once you've talked to them, you'll add 1 to the variable. And then, whichever event controls you being able to move on, will need a conditional branch set to If variable >= 3 .
(I should really look to see where I'm posting before doing so. I'm not familiar with VXAce and am not sure if they have Self Switches or not. If no, I apologize, but in that case, just replace self switches with regular switches)


Basic variable manipulation is fairly simple.


In this particular case, you need to have your different NPCs. I'm using 4 in my explanation, but you can tweak it however you wish. 3 of them will be used as the NPCs to talk to, the fourth will be used to check the variable and advance the plot.


When setting up your NPCs, there are two commands you will want to use. Control Variable and Control Self Switch. Control Variable will allow you to change a variable's number whenever you talk to them. Control Self Switch will enable you to make it so that particular NPC can only add to the variable's number a single time.

Spoiler
Variable Step 1.png Variable Step 2.png





 



 

As you can see, the first time you talk to him while there's no predetermined conditions, he says his piece, adds +1 to the variable "Duders Talked To", and enables Self Switch A. In the second picture, Self Switch A is enabled, so page two will automatically trigger any time you talk to him after the first, preventing him from adding to the variable multiple times. Do this for however many NPCs you want to use to affect the variable (so in your case, 3)


After you make your 3 NPCs to talk to, you need to make something for the variable to trigger. I used an NPC, but its possible to do it on a "Move Location" command, or even an Autorun Trigger to make something happen immediately after you talk to the third.


Variable Step 3.png Variable Step 4.png



 


 





In this situation, page 1 has no set conditions. so talking to the NPC will result in him telling you to talk to the others first. However, once you've finished talking to the three other NPCs and gotten the "Duders Talked To" variable up to 3 or greater, page 2 will trigger, and he will instead congratulate you on accomplishing this monumental task laid before you. Again, this doesn't necessarily have to be an NPC, I just chose to use it to demonstrate for simplicity sake.


And that's it. Basic Variable Usage 101. Now if I could only get someone to teach ME how to properly use spoilers tags so I stop posting giant walls of images XD
Make a variable called npc talk. When you talk to a npc you will make that variable increase by 1 point.


Then make a conditional branch in an event which says: "when variable "X" is more or the same than 3..." so you will increase the variable thre times. 


Hope I helped!
Follow the link to the starting point in my signature and play through the game named "variables guide" that is linked there. After that you can open that game to see how everything was done in it.


If that is not enough (it includes exactly the type of tasks you're talking about), then we need screenshots of your events to help you.
I have the variables guide already but idk why but i guess variables totally allude me but im not gonna give up ill try all of your ideas thanks guys and


thanks for being patient with a total noob
Is it possible to make a switch turn on after you've met the variable requirements to move on... ok heres whats going on in my game...


you get teleported to a village in the woods and you have no idea where you are so you and your friend decide to ask around but noone


will talk to you and i want after you talk to the villagers outside ( the only three or four outside) for one of them to tell you to go talk to the


innkeeper there but i cant seem to figure it out.. but hopefully after i try you guys advice it'll work right... thanks and if you have any other


ideas id love to hear them
@Madhatter5252, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


As I wrote above, if the variables guide is not enough, we need to see screenshots of your event to tell you where you went wrong.
The screenshots I posted in my first post also show exactly how to do this.
@Madhatter5252 And the message intended by your blank post is...?
sorry it was supposed to be a picture...nevermind i figured it out
I want to thank everyone for helping me with this It took me a bit but i finally got it and now im starting to understand variables thanks alot everyone
So can this be closed?

Original thread: https://forums.rpgmakerweb.com/threads/variables-please-help.68584/