So im creating a game were I want the player to be able to choose between 3 options of characters (female, male and nonbinary).
Basically what was answered here ( viewtopic.php?t=41843 ) but I don't know if it would workout with 3 options instead of 2.
And also how do I go about coding to show the option that the player chose as a side image.
Help with simple character choice
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.
-
- Newbie
- Posts: 7
- Joined: Tue May 24, 2022 9:15 pm
- Contact:
- m_from_space
- Miko-Class Veteran
- Posts: 974
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: Help with simple character choice
Well it's pretty much the same, just add a third line within the question and a third option inside the image:
You will figure out the rest.
edit:
One option inside the ConditionSwitch() function should always be true, so it's better to write the following, assuming that if the player didn't pick male or female we just assume it's nonbinary, regardless of what is inside the variable "gender". Otherwise if the variable would contain None or another value, the function would throw an error and the game crashes.
Code: Select all
image mysprite = ConditionSwitch(
"gender=='male'", "male_sprite.png",
"gender=='female'", "female_sprite.png",
"gender=='nonbinary'", "nonbinary_sprite.png")
edit:
One option inside the ConditionSwitch() function should always be true, so it's better to write the following, assuming that if the player didn't pick male or female we just assume it's nonbinary, regardless of what is inside the variable "gender". Otherwise if the variable would contain None or another value, the function would throw an error and the game crashes.
Code: Select all
image mysprite = ConditionSwitch(
"gender=='male'", "male_sprite.png",
"gender=='female'", "female_sprite.png",
"True", "nonbinary_sprite.png")
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot], Ocelot