An option to switch sprites out?
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.
An option to switch sprites out?
So I don't quite know how to word this question in a way that I can search it. But, in short I want to know if there's a way to switch sprites in the options (And some of the text). I was thinking, why not make a game that you can swap the genders of love interests. I mean it's not particularly important, but I thought it might've been a fun idea as I think it allows for the opposite gender to be more comfortable with playing the game, and it sells better >.>. (And honestly I don't spend much time on the sprites to begin with, so making a new set of sprites for a few characters isn't too bad.) Especially since there concept remains very much the same. Anyhow enough of me babbling lol.
- mitoky
- Veteran
- Posts: 316
- Joined: Sat Feb 07, 2015 9:12 pm
- Projects: The Purring Demon's Love, circus eterie
- Contact:
Re: An option to switch sprites out?
I am a bit unsure if it would work (and didnt tested, if anything is wrong pelase correct me!) but this might work.
First, you have to set a variable with the gender:
and each sprite (main happy, main sad etc) with a condition switch:
Afterwards you only have to let the player decide. For this you can simply ask them at the start of the game:
Once done, you can simply show your sprite in game:
and the gender chosen should show up!
As for text, you can use if statements.
First, you have to set a variable with the gender:
Code: Select all
default genre = male
Code: Select all
image main happy = ConditionSwitch(
"genre == 'male'", "male_main_happy.png",
"genre == 'female'", "female_main_happy.png",
)
Code: Select all
label start:
"Are you male or female??"
menu:
"male":
$ genre = male
"female:
$ genre = female
Code: Select all
show main happy
As for text, you can use if statements.
Code: Select all
if gender == male:
"I think you are a super handsome guy!"
else:
"I think you are a super cute girl!"
Last edited by mitoky on Thu Feb 15, 2018 7:18 am, edited 2 times in total.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3794
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: An option to switch sprites out?
^ a minor problem with using persistent in that way, is that if a player saves a game as say, female, and starts a new game as male, when they go back to what they think is the 'female' save game, it'll be male now.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
- mitoky
- Veteran
- Posts: 316
- Joined: Sat Feb 07, 2015 9:12 pm
- Projects: The Purring Demon's Love, circus eterie
- Contact:
Re: An option to switch sprites out?
Whoops, you are right! Changed it, thanks for pointing that out! (:
Re: An option to switch sprites out?
Thanks for the info, I'm gonna test it... sooner or later >.>
Who is online
Users browsing this forum: Majestic-12 [Bot], snotwurm