[SOLVE] Gender Choice and Branching
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.
[SOLVE] Gender Choice and Branching
Hi everyone!
I'm starting a new game and I have at the very beging the option to choose between male and female, I'm not sure how it's handled in english, but because it's in spanish, there are lots of nouns and adjectives that vary depending on the gender. My question is how do I code it, do I make a copy of the script and alter it to fit the other gender and at that gender option make it jump to the other script, do I write it as a conditional on every sentence that has this difference? I'm quite new, so I don't know if it's a simple problem and I've just said the most bizarre solutions, but I'm learning and I thought I'd askit before I wrote down more stuff.
Thank you in advance
I'm starting a new game and I have at the very beging the option to choose between male and female, I'm not sure how it's handled in english, but because it's in spanish, there are lots of nouns and adjectives that vary depending on the gender. My question is how do I code it, do I make a copy of the script and alter it to fit the other gender and at that gender option make it jump to the other script, do I write it as a conditional on every sentence that has this difference? I'm quite new, so I don't know if it's a simple problem and I've just said the most bizarre solutions, but I'm learning and I thought I'd askit before I wrote down more stuff.
Thank you in advance
Last edited by BLucy on Thu Jun 18, 2020 8:00 am, edited 1 time in total.
- Per K Grok
- Miko-Class Veteran
- Posts: 882
- Joined: Fri May 18, 2018 1:02 am
- Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
- itch: per-k-grok
- Location: Sverige
- Contact:
Re: Gender Choice and Branching
Both ways could work.BLucy wrote: ↑Tue Jun 16, 2020 12:28 pm Hi everyone!
I'm starting a new game and I have at the very beging the option to choose between male and female, I'm not sure how it's handled in english, but because it's in spanish, there are lots of nouns and adjectives that vary depending on the gender. My question is how do I code it, do I make a copy of the script and alter it to fit the other gender and at that gender option make it jump to the other script, do I write it as a conditional on every sentence that has this difference? I'm quite new, so I don't know if it's a simple problem and I've just said the most bizarre solutions, but I'm learning and I thought I'd askit before I wrote down more stuff.
Thank you in advance
I think that having a male/female alternative for each sentence where it is needed, would be less work, IF everything else is the same.
If there are many other differences as well two separate patches might be better. You will then have to have two separate lines of labelnames when you have parallel even. i.e. label beachM and label beachF if the male character or the female character is visiting the beach.
I don't think there is one solution here that is the best in all cases.
Re: Gender Choice and Branching
to my mind comes something like this, just by doing that it changes depending on the gender, idk if i did the code right but you get the idea, if its a pain to write it like this, write it normally and use crlt + f to change all the he, she and him, her to the variable. maybe this works maybeee?
Code: Select all
define ge = "male or female"
define ge3 = "male or female"
menu:
"Male":
$ ge = "he" #stands for gender
$ ge3 = "him" #stands for gender 3rd person
"Female":
$ ge = "he"
$ ge3 = "her"
c "would you like to date [ge3], is [ge] good enough for you?"
Re: Gender Choice and Branching
So this is kind of like letting the player choose the mc name's, right? The problem is, because it's in spanish, it's not just he/she, him/her, but, also nouns and adjectives, like with the sentence you wrote, it'd have to be "¿Es lo suficientemente BUENO/BUENA para ti?" while in english is just "good" for both genders.Dr_arell wrote: ↑Tue Jun 16, 2020 3:32 pm to my mind comes something like this, just by doing that it changes depending on the gender, idk if i did the code right but you get the idea, if its a pain to write it like this, write it normally and use crlt + f to change all the he, she and him, her to the variable. maybe this works maybeee?
Code: Select all
define ge = "male or female" define ge3 = "male or female" menu: "Male": $ ge = "he" #stands for gender $ ge3 = "him" #stands for gender 3rd person "Female": $ ge = "he" $ ge3 = "her" c "would you like to date [ge3], is [ge] good enough for you?"
Last edited by BLucy on Tue Jun 16, 2020 5:33 pm, edited 1 time in total.
Re: Gender Choice and Branching
Well, at first I tried the conditional thing, but it didn't show up (I'll have to restudy that part), so then I tried copying the script.rpy and script.rpyc files and left it like that (didn't make any calls to the new one or anything, because I was focus on other thing). Yesterday, writting other stuff work fine, but today when I opened it say there was an error, that there were 2 "script" files, so I erased it. Is it because of the name (the original was the same and the copy was "scriptm") or should copy the entire code (once it's finished) underneath the original and then change the gender? i.e.:Per K Grok wrote: ↑Tue Jun 16, 2020 3:18 pmBoth ways could work.BLucy wrote: ↑Tue Jun 16, 2020 12:28 pm Hi everyone!
I'm starting a new game and I have at the very beging the option to choose between male and female, I'm not sure how it's handled in english, but because it's in spanish, there are lots of nouns and adjectives that vary depending on the gender. My question is how do I code it, do I make a copy of the script and alter it to fit the other gender and at that gender option make it jump to the other script, do I write it as a conditional on every sentence that has this difference? I'm quite new, so I don't know if it's a simple problem and I've just said the most bizarre solutions, but I'm learning and I thought I'd askit before I wrote down more stuff.
Thank you in advance
I think that having a male/female alternative for each sentence where it is needed, would be less work, IF everything else is the same.
If there are many other differences as well two separate patches might be better. You will then have to have two separate lines of labelnames when you have parallel even. i.e. label beachM and label beachF if the male character or the female character is visiting the beach.
I don't think there is one solution here that is the best in all cases.
"Start of his story"
"Middle of his stroy"
"End of his story"
"Start of her story"
"Middle of her story"
"End of her story"
return
The story doesn't have many different paths except for a few romantic options, but the main story wil be the same otherwise.
Re: Gender Choice and Branching
And thank you both of you, I'm quite lost in all of this and I really appreciate the help.
Re: Gender Choice and Branching
so there's another idea i got when i was rethinking about it, first came to my mind, make a variable that changes between o and a, to use it like this enferrmer[@], but since this is not true for all the words as example doctor and doctora, what you can do is to make 2 lists, each one with the different words and nouns to be used, and depending on the option the player choose, one of the 2 list will provide the words.
This is very blurry to me and i can't code it, but i know its possible.
The word would have to be called by the number of element. for example if i want to use trabajador or trabajadora, it would have to be called with his respective number.
this is python code and using this ----> print(P[2}) <--- wont work, you need to call it with the renpy equivalent, i dont remember how it is XD
This is very blurry to me and i can't code it, but i know its possible.
Code: Select all
menu:
"i'm a boy":
$ P = [
doctor, #element 0
enfermero, #element 1
trabajador, #element 2
un, #element 3
carpintero,
]
"i'm a girl":
$ P = [doctora,
enfermera,
trabajadora,
carpintera,
]
hey entonces quieres ser print(P[3]) print(P[2]) aqui?
# hey entonces quieres ser un/una trabajador/trabajadora aqui?
this is python code and using this ----> print(P[2}) <--- wont work, you need to call it with the renpy equivalent, i dont remember how it is XD
Last edited by Dr_arell on Mon Aug 10, 2020 4:17 pm, edited 1 time in total.
Re: Gender Choice and Branching
Oh, yeah, I get it. Well I think I'll need to sort out which way works best, But thank you very much, really!Dr_arell wrote: ↑Wed Jun 17, 2020 2:14 am so there's another idea i got when i was rethinking about it, first came to my mind, make a variable that changes between o and a, to use it like this enferrmer[@], but since this is not true for all the words as example doctor and doctora, what you can do is to make 2 lists, each one with the different words and nouns to be used, and depending on the option the player choose, one of the 2 list will provide the words.
This is very blurry to me and i can't code it, but i know its possible.The word would have to be called by the number of element. for example if i want to use trabajador or trabajadora, it would have to be called with his respective number.Code: Select all
menu: "i'm a boy": $ P = [ doctor, #element 0 enfermero, #element 1 trabajador, #element 2 un, #element 3 carpintero, ] "i'm a girl": $ P = [doctora, enfermera, trabajadora, carpintera, ] hey entonces quieres ser print(P[3]) print(P[2]) aqui? # hey entonces quieres ser un/una trabajador/trabajadora aqui?
although this is python code and using code like this ----> print(P[2}) <--- probably wont be displayed inside the textbox.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot]