Renpy quiz

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
User avatar
Posts: 11
Joined: Thu Sep 06, 2018 10:18 am
Deviantart: Kirkechan

Renpy quiz

#1 Post by kirkechan » Sun Oct 13, 2019 3:36 am

I want to create a personality quiz in renpy but I honestly have no idea how to do it. It's easy to make a quiz with correct and uncorrect answers, but I want something a bit different. All answers are correct and the most important thing is how much "a" you had, how much "b", how much "c" etc. But I need some advices about how to make it...

Posts: 8
Joined: Wed Oct 21, 2015 9:26 pm
Tumblr: TanixBR

Re: Renpy quiz

#2 Post by tanix » Sun Oct 13, 2019 7:55 am

Hi kirke,

My suggestion may be is OO or function to handle this.

You can create dict or some objects like arrays of arrays or some data structures that will have questions, answers and correct answers. So you can make functions to pick a question, display answers and later after user submit the answer you need a function that validate based on the question loaded

User avatar
Lemma-Class Veteran
Posts: 3140
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor

Re: Renpy quiz

#3 Post by Imperf3kt » Sun Oct 13, 2019 9:22 am

An easier way would be to simply have a variable for "A" answers, "B" answers, etc.
Then use the choice menu to increment the chosen option by +1 each time it is selected.

When the quiz reaches the results screen you can show which option was most selected or a percentage or whatever, based on those variables.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Free Android GUI - Updated occasionally

User avatar
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao

Re: Renpy quiz

#4 Post by isobellesophia » Sat Oct 19, 2019 2:23 am

Variables can do honestly, since alot RenPy with quiz games uses variables commonly..

This is about results, not good at making this, but take a try.

Code: Select all

default correct1 = False
default correct2 = False
default wrong1 = False
default wrong2 = False

Code: Select all

label quiz:
"What is the third planet on the solar system?"

jump earth

jump neptune

label earth:
$ correct1 = True
"You got the correct answer!"
jump quiz2

label neptune:
$ wrong1 = True
jump quiz2

"What is my personality?"

jump kind

jump bad

label kind:
$ correct2 = True
"You got it!"
jump results

label bad:
$ wrong2 = True
jump results

label results:
if correct1 and correct2:
"You got A!"
elif correct1 and wrong2:
"You got B!"
elif wrong1 and correct2:
"You got C!"
elif wrong1 and wrong2:
"You got D!"
I am a friendly user, please respect and have a good day.



Post Reply

Who is online

Users browsing this forum: Google [Bot], Trafagal