Jade010

Villager
Member
Joined
May 26, 2021
Messages
6
Reaction score
24
First Language
English
Primarily Uses
RMMZ
Hi. How do you make a personality quiz in rpg maker mz? Im trying to make one similar to pokemon mystery dungeon where each answer adds points into one of 12 variables. then i need it to read the variable with the highest amount so that personality is announced to the player. but i have no idea how to go about doing it. any help?
 

HexMozart88

The Master of Random Garbage
Veteran
Joined
May 15, 2016
Messages
2,100
Reaction score
3,871
First Language
English
Primarily Uses
RMVXA
What part are you confused about? How to add to the variables or how to compare them?
 
Joined
Jul 12, 2020
Messages
229
Reaction score
86
First Language
English
Primarily Uses
RMMV
I think you pretty much summed it up yourself!
Whatever personalities you have as options, just give those 1 variable each, and as you have the player make choices for those variables, simple "Add" a +1 to each of those choices made. After the quiz is over, just use conditional branches for the highest variable the player happened to get.



As for the actual personality quiz....well, that depends on what exactly your game contains. Is it going to ask things like their favorite (thing(s))? What-if scenarios? It's up to you really...
 

Jade010

Villager
Member
Joined
May 26, 2021
Messages
6
Reaction score
24
First Language
English
Primarily Uses
RMMZ
Thanks but how would i be able to get the conditional branch to search all of the variables?
 

HexMozart88

The Master of Random Garbage
Veteran
Joined
May 15, 2016
Messages
2,100
Reaction score
3,871
First Language
English
Primarily Uses
RMVXA
A bunch of greater than checks.
 

Jade010

Villager
Member
Joined
May 26, 2021
Messages
6
Reaction score
24
First Language
English
Primarily Uses
RMMZ
ok well ill give it a try. thank you everyone!
 

RachelTheSeeker

Suddenly, a summer breeze...
Veteran
Joined
Apr 13, 2012
Messages
478
Reaction score
814
First Language
English
Primarily Uses
RMVXA
I'd considered one of these myself lately, but the big hangup for me is what happens if there's a tie for variables. What could be the tiebreaker, and how much of a pain would that be to integrate?
 
Joined
Jul 12, 2020
Messages
229
Reaction score
86
First Language
English
Primarily Uses
RMMV
Thanks but how would i be able to get the conditional branch to search all of the variables?

I think all you would need to do is this:

At the end of the quiz, you will need to make it to where like...there are a bunch of conditional things that need to be checked at once. (Check 1 condition, then the next nested code checks for more conditions)
Let's say you have 4 personalities. A, B, C, and D.

Let's say at the end of the 5-question quiz, the player makes the choices to where they obtain personality A where A = 3, B = 1, C = 1, and D = 0.
The game needs to know personality A is the player's route.
So....

======
If Variable A > Variable B
{ (If Variable A > Variable C)
{ (If Variable A > Variable D)
(Text: "Based on your quiz, you are (personality A)!")
}
}
=======

In this example, since Variable A was indeed the greatest number (3), all of those conditions will be satisfied, and the personality A will be chosen.

So with this kind of format, you would need to nest this kind of If statement many times, for all 4 personalities. Remember, the moment ONE of those If branches gets violated, the rest of the nested code won't execute, which is what you want.

You will need to follow this format:
======
If Variable A > Variable B
(If Variable A > Variable C)
(If Variable A > Variable D)
(Text: "Based on your quiz, you are (personality A)!")

If Variable B > Variable A
(If Variable B > Variable C)
(If Variable B > Variable D)
(Text: "Based on your quiz, you are (personality B)!")

....(etc).
=========


Also to note, make sure the amount of personality questions is ODD! You don't want to have instances of ties...that makes things more complicated than it needs to be.
 
Last edited:

Finnuval

Old Raven following Rainbows
Veteran
Joined
Aug 1, 2018
Messages
2,405
Reaction score
8,606
First Language
Dutch
Primarily Uses
RMMZ
Also to note, make sure the amount of personality questions is ODD! You don't want to have instances of ties...that makes things more complicated than it needs to be.
In addition to this also make sure the number of outcomes is always smaller then the number of questions.

If they are equal (5 questions and 5 personalities) you still Risk a tie of all getting 1. Of the number of questions is 5 and the number of personalities is 4 be however there Will be no chance of this.
 

HexMozart88

The Master of Random Garbage
Veteran
Joined
May 15, 2016
Messages
2,100
Reaction score
3,871
First Language
English
Primarily Uses
RMVXA
Here is the script that i modified:

Screenshot_14.png


And here at the small box, it didn't show up:
Screenshot_15.png


im sorry but help me
How can i make states show up and make it to the right angle.
Thank you
Uh, wrong thread?
 

Jade010

Villager
Member
Joined
May 26, 2021
Messages
6
Reaction score
24
First Language
English
Primarily Uses
RMMZ
Ill give it a try and the whole thing on having it have more questions is a good point. i never thought of that. ill have to map it out on paper first.
 

tumsterfest

Veteran
Veteran
Joined
Aug 11, 2020
Messages
78
Reaction score
19
First Language
English
Primarily Uses
RMMZ
Having an odd number of questions only helps if you have just 2 possible personality types. And I'm not sure how keeping the number of types lower than the number of questions helps, as you could have 5 questions and 4 personalities, with 2 personalities tying for 1st place with 2 votes

Only jumping in here because I'm curious about an efficient solution for this haha
 
Joined
Jul 12, 2020
Messages
229
Reaction score
86
First Language
English
Primarily Uses
RMMV
Having an odd number of questions only helps if you have just 2 possible personality types. And I'm not sure how keeping the number of types lower than the number of questions helps, as you could have 5 questions and 4 personalities, with 2 personalities tying for 1st place with 2 votes

Only jumping in here because I'm curious about an efficient solution for this haha

Ohhhh yeah you're right! I didn't consider this previously. When OP said personality quiz, I instantly thought about one of those long, 10-20 question "quizzes" you find on buzzfeed lol. My bad.

In my mind, it sounded like they wanted more questions, but you've got a bigger picture.
 

Winshifter

Veteran
Veteran
Joined
Feb 24, 2017
Messages
88
Reaction score
59
First Language
Spanish
Primarily Uses
RMMV
Why don't you try to use a sort algorithm for the variables?
Yeah, I know that it kind of sounds stupid but I remember a Spanish developer once using a sort algorithm in rm2k3 to find where a certain character was in the map. Unfortunately I lost the code for that.

So, how can you approach this? First, I would suggest that you understand what and how a sort algorithm works, but the very basic thing is about comparing two values within a loop and substitue the values as you go about the loop of variables. However, since you will like to know which one is the one that has the highter value, you probably could just use the loop to get the highter value in another variable.

It should look something like this.

Loop variables x = 1 to 10 then
If x != 10 then
Loop variables y = x +1 to 10 then
if x > y then
assign variable z = x
else then
assign variable z = y
end
end
end
end

It's very crude and I know it my have issues, but it's only to get to the point. This however does not take into account if they are the same, I suggest that in the event of variables having the same value, each type also has a certain presedence, like a certain initial value just to avoid ties.
 

Latest Threads

Latest Posts

Latest Profile Posts

How does one pronounce Godot? I've heard it pronounced a couple of different ways, and I genuinely don't know the proper way.
March 2020 ...
1635188823939.jpeg
... vs October 2021
You look like you had a rough day...Here, have a Baby Panda!

7 years of trying to plan this project... and it got an official plotline today. 7 years. I really just have no concept of order huh GHJGSJHGVGHASFH.
Doing RPG Maker News for 24th October 2021

Forum statistics

Threads
116,068
Messages
1,095,498
Members
151,433
Latest member
Nanoql
Top