I've searched far and wide for a simple way to do this, but to no avail. I feel like this shouldn't be difficult to do on Ren'Py, although I have little experience coding.
I have two weeks until I take a placement test at my school and instead of using flashcards, I wanted something where it could give me a word or words, then I could fill in the user input blank with the answer. I can either get it right, or wrong. If I get it wrong, it could just give me the correct word and move on. If I get it right, it moves on. Nothing complicated.
Not all answers need to be on the same screen. It could be flashcard-like. I just would prefer to type out my answers as opposed to selecting them from a list of options. Something like this:
Is this possible, and easy to do? Thanks for any help.
Help with a code for user-input answers?
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.
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.
- PyTom
- Ren'Py Creator
- Posts: 16088
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Help with a code for user-input answers?
Code: Select all
label start:
$ questions = [
("What is the answer to the great question of life, the universe, and everything?", "42"),
("How much wood could a woodchuck chuck if a woodchuck could chuck wood?", "42kg/day"),
("What is 43 minus 1?", "42"),
]
$ renpy.random.shuffle(questions)
while questions:
$ q, a = questions.pop()
$ answer = renpy.input(q)
if answer == a:
"That's right!"
else:
"Wrong. The right answer is [a]."
"Done."
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: Help with a code for user-input answers?
Thank you so much! <3
That's exactly what I need.
That's exactly what I need.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot]