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,051
Reaction score
3,722
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
214
Reaction score
63
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,051
Reaction score
3,722
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
812
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
214
Reaction score
63
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,362
Reaction score
8,380
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,051
Reaction score
3,722
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
66
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
214
Reaction score
63
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


1,Randomly generate events with planted spawner events(great flexibility for customization and auto-match player's level)
2,Randomly enter roguelike dungeon
3,Player can exit dungeon or back to town or choose to challenge BOSS at the end of each dungeon
4,Dungeon maps can be randomly generated by a third-party tool
Got locked out of the house yesterday... best friends who had the spare ghosted me. Locksmith had to literally drill thru the lock bc they couldn't pick it. Whole process took 4 hours and far too much money. And they have to come back next week bc they don't have the right cylinder, cause it's an old interlocking lock. I'm livid lol
 I’m probably going to regret this, but I need kobolds for my project and I’ve decided to sprite them myself. This is Attempt #1, front view only.

KoboldFront.gif
It's a shame that Selection Control will not be ported to MZ. I found a neat way of using it to enable ways for tanks to protect squishies. lol
Lately I have been taking a break from game and resource making so I won't get burnt out. But I am also interested in the Game Jams this site periodically holds. It'd be great if I knew when the next one, if any, is planned.

Forum statistics

Threads
115,354
Messages
1,089,217
Members
150,029
Latest member
Cwiras
Top