[SOLVE] Gender Choice and Branching

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
Message
Author
BLucy
Newbie
Posts: 9
Joined: Tue Jun 16, 2020 5:21 am
Contact:

[SOLVE] Gender Choice and Branching

#1 Post by BLucy »

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 :)
Last edited by BLucy on Thu Jun 18, 2020 8:00 am, edited 1 time in total.

User avatar
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

#2 Post by Per K Grok »

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 :)
Both ways could work.

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.

Dr_arell
Regular
Posts: 70
Joined: Sun Feb 23, 2020 11:24 pm
Deviantart: DarellArt
Contact:

Re: Gender Choice and Branching

#3 Post by Dr_arell »

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?"

BLucy
Newbie
Posts: 9
Joined: Tue Jun 16, 2020 5:21 am
Contact:

Re: Gender Choice and Branching

#4 Post by BLucy »

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?"
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.
Last edited by BLucy on Tue Jun 16, 2020 5:33 pm, edited 1 time in total.

BLucy
Newbie
Posts: 9
Joined: Tue Jun 16, 2020 5:21 am
Contact:

Re: Gender Choice and Branching

#5 Post by BLucy »

Per K Grok wrote: Tue Jun 16, 2020 3:18 pm
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 :)
Both ways could work.

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.
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.:
"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.

BLucy
Newbie
Posts: 9
Joined: Tue Jun 16, 2020 5:21 am
Contact:

Re: Gender Choice and Branching

#6 Post by BLucy »

And thank you both of you, I'm quite lost in all of this and I really appreciate the help.

Dr_arell
Regular
Posts: 70
Joined: Sun Feb 23, 2020 11:24 pm
Deviantart: DarellArt
Contact:

Re: Gender Choice and Branching

#7 Post by Dr_arell »

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.

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?

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
Last edited by Dr_arell on Mon Aug 10, 2020 4:17 pm, edited 1 time in total.

BLucy
Newbie
Posts: 9
Joined: Tue Jun 16, 2020 5:21 am
Contact:

Re: Gender Choice and Branching

#8 Post by BLucy »

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.

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?

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.
although this is python code and using code like this ----> print(P[2}) <--- probably wont be displayed inside the textbox.
Oh, yeah, I get it. Well I think I'll need to sort out which way works best, But thank you very much, really!

Post Reply

Who is online

Users browsing this forum: Google [Bot]