Hello everyone.
I am making a game as my school project in this engine and I was given the suggestion of a system that goes like this:
An NPC asks you a certain amount of questions and based on your responses, let's say
"Yes", "No" or "Maybe", it would give your character a specific class.
Now, a system like this exists in the Pokemon Mystery Dungeon games and it's something I really like about it. I really wanted ti implement this in my game so if anyone has any idea how to do it with either a script or through events I'd appreciate it.
Thanks 🙂
It's really not difficult to do, using nested Show Choices (maybe with conditional branches). Unless you're going to ask half a dozen questions and want to cover every combination.
What have you tried so far, and where are you having troubles?
Looping is probably because you set the event up as a parallel process or autorun, and didn't add a command to end it once the choice had been made. This is usually done by transferring to a different map (as long as you have nothing else to do on this map for the rest of the game), or by turning on a self switch then adding a second event page with no commands and an action button trigger, conditioned by that self switch.
Then please show screenshots of your events. Something has gone wrong somewhere and we need to see what you've done to help you fix it. Using Alt+PrintScreen will capture the whole event window without cropping stuff out that we need to see.
If you have to create it again, maybe get some paper first and draw a kind of flow chart or branching diagram. This might help you with your logic, so choices, responses and loops go in the right places.
Re-reading your last reply, if your second page was an action button trigger and no event commands, but the selecting stuff was still looping, then it sounds like you didn't correctly activate the second page - you didn't turn on the right switch or self switch.
Well, the way to do this would be to just make a few Show Text commands with Show Choices commands and the answers would increase the values of variables that represented the suitability of the player for the class. In the end, the variables would be evaluated and compared with each other and then things would happen differently depending on the result, which could be done with conditional branches for example.
Like, let's say you have 4 classes, Warrior, Ranger, Rogue and Mage. So you use 4 variables called "Warrior Points" etc. to store the amount of points towards that specific class.
Then have questions like:
"Which one out of these activities is your favorite?"
Exercising (+1 Warrior)
Going on long walks in nature (+1 Ranger)
Playing Hide-and-Seek (+1 Rogue)
Reading books (+1 Wizard)
"You need to cross a bridge, but there's a giant troll standing in your way, how will you get past him?"
Fight him! (+1 Warrior, +1 Ranger)
Trick him! (+1 Rogue, +1 Mage)
Yeah, but how do you want it to work. Do you want it to be like when you start the game some text pops up and you start answering questions? Do you want to have a character walk up to an NPC and they ask those questions? When you mean you want this to be able to repeat the quiz, how exactly is that supposed to work? Is it only before they finally get their class or any time after? That's what you need to decide.
I have something similar in my game which determines your starting actor. When you answer a question it increases the Starter variable by different amounts. 0, 1 ,2, 3. I have three answers so a max of 9 points total. At the end of the questioning I have a conditional branch that says if equal to or less than 1 = this, else equal to or less than 3, 6 and then equal to or greater than 7. And of course each one would give you a different actor.
To do the points thing, in each branch of the Conditional Branch, assign points as appropriate by increasing a certain Variable. For example?
Show Message: "Do the ends justify the means?"
Show Choices: Yes, No, Sometimes
If Yes:
....Control Variables: Increase Variable #1 "Paladin" by 1
....Control Variables: Increase Variable #2 "Zealot" by 5
....Control Variables: Increase Variable #3 "Priest" by 3
End Branch
If No:
....Control Variables: Increase Variable #1 "Paladin" by 5
....Control Variables: Increase Variable #2 "Zealot" by 1
....Control Variables: Increase Variable #3 "Priest" by 3
End Branch
If Sometimes:
....Control Variables: Increase Variable #1 "Paladin" by 2
....Control Variables: Increase Variable #2 "Zealot" by 2
....Control Variables: Increase Variable #3 "Priest" by 4
End Branch
Then, at the end of all the questions, compare all the variables to each other. As long as one class has more points than all the others, give the player that class.
Conditional Branch: Variable #1 is Greater than or Equal to Variable #2
....Conditional Branch: Variable #1 is Greater than or Equal to Variable #3 (note: by nesting one inside the other, this branch will only run when #1 is greater than or equal to #2 AND #3)
........Show Message: "You are now a Paladin!"
........Change Actor Class: Hero, to Paladin
....Exit Event Processing (note: this will stop further classes from being awarded in the case of ties)
....End Branch
End Branch
Conditional Branch: Variable #2 is Greater than or Equal to Variable #1
....Conditional Branch: Variable #2 is Greater than or Equal to Variable #3
........Show Message: "You are now a Zealot!"
........Change Actor Class: Hero, to Zealot
....Exit Event Processing
....End Branch
End Branch
Conditional Branch: Variable #3 is Greater than or Equal to Variable #1
....Conditional Branch: Variable #3 is Greater than or Equal to Variable #2
........Show Message: "You are now a Priest!"
........Change Actor Class: Hero, to Priest
....Exit Event Processing
....End Branch
End Branch