NPC gender and MC RO

So, hello there. I am new at this and I am currently practicing my Choicescript skills.

The reason I create this post, well just like the others. I’m stuck and don’t know what to do. I keep searching, reading, and do everything and it makes me confused. So, the last thing I want to do is ‘ask’ to those people who are experienced in Choicescript.

So here’s the problem.
I tried to make my NPC to become my MC Romance Option. So I started normally by looking at tutorials and in the end, I’ve got no error, but ‘it’s not right’. So the NPC i try to make is [i]female[/] and when i tried to make her my MC girlfriend, turns out it’s wrong. If I chose her with my female MC, My MC will become ‘her boyfriend’ and that’s not right since I script it to become ‘girlfriend’. And when I chose her with my male MC, the script only gave ‘blank’. I did a little experiment and It gave me headache.

Sorry for my English, it’s not my native. Also, it’s hard for me to understand what I just wrote, but I hope you guys understand it well. :slight_smile:

Here’s the script

Do you feel attracted to ${laura_his}?

*fake_choice
	#Nah, I'm only interested to man.
		*if (gender="male")
			*set orientation "gay"
		*if (gender="female")
			*set orientation "straight"
			*got halloween_house
	
	#She's a cute girl, of course I'm attracted.
		*if (gender="female")
			*set orientation "gay"
			*gosub lover_male
		*if (gender="male")
			*set orientation "straight"
			*gosub lover_laura
			*gosub lover_female
			
	#I like her, but I like man too.
		*set orientation "bisexual"
		*goto laura_rel
		*temp random_gender
	*rand random_gender 1 2
	*if random_gender=1
		*gosub lover_male
	*if random_gender=2
		*gosub lover_female
		
	#Love? Not interested.
		*set orientation "asexual"
		*goto halloween_house
		

*label lover_female
*set boyfriend "girlfriend"
*set husband "wife"
*set val_he "she"
*set val_his "her"
*set val_man "woman"
*set handsome "beautiful"

*label lover_male
*set boyfriend "boyfriend"
*set husband "husband"
*set val_he "he"
*set val_his "his"
*set handsome "handsome"
*set val_man "man"

*page_break

*label lover_laura
*set boyfriend "girlfriend"
*set husband "wife"
*set val_he "she"
*set val_his "her"
*set val_man "woman"
*set handsome "beautiful"

So you are ${laura_his} ${boyfriend} then?

So the obvious thing I see already is that you are missing *returns in your *gosub statements and that’s likely what’s causing the issue. I’m gonna clear it up and post here since in your opening post it’s formatted wrong. Give me a little while and I’ll try to fix it all for you.

Do you feel attracted to ${laura_his}?

*fake_choice
	#Nah, I’m only interested to man.
		*if (gender=“male”)
			*set orientation “gay”
		*if (gender=“female”)
			*set orientation “straight”
		*goto halloween_house
	#She's a cute girl, of course I'm attracted.
		*if (gender="female")
			*set orientation "gay"
			*gosub lover_male
		*if (gender="male")
			*set orientation "straight"
			*gosub lover_laura
			*gosub lover_female
	#I like her, but I like man too.
		*set orientation "bisexual"
		*goto laura_rel
		*temp random_gender
		*rand random_gender 1 2
		*if random_gender=1
			*gosub lover_male
		*if random_gender=2
			*gosub lover_female
	#Love? Not interested.
		*set orientation "asexual"
		*goto halloween_house

*label lover_female
*set boyfriend “girlfriend”
*set husband “wife”
*set val_he “she”
*set val_his “her”
*set val_man “woman”
*set handsome “beautiful”

*label lover_male
*set boyfriend “boyfriend”
*set husband “husband”
*set val_he “he”
*set val_his “his”
*set handsome “handsome”
*set val_man “man”

*page_break

*label lover_laura
*set boyfriend “girlfriend”
*set husband “wife”
*set val_he “she”
*set val_his “her”
*set val_man “woman”
*set handsome “beautiful”

So you are {laura_his} {boyfriend} then?

So I have some questions here; the MC can have their gender selected by the player right? And so does this lover? It’s not always a woman then? As in, not always Laura.

1 Like

Alright, thanks. I’m also still unfamiliar with forum codes. :sweat_smile:

Yes the MC can be male or female.

Well yes, uh this makes me confused there will be more RO but currently I only have Laura here so I tried experimenting with the script. Well, based on the script I made, Laura is locked as female so I created standalone script for her and different from lover female .

There will be another RO (gender locked) and MC’s RO is not always Laura.

Okay, so Laura is always female then? Ok.

For the bisexual option you added a random gender option, what’s that supposed to mean? Because I didn’t understand it.

The things in lover_male and lover_female are what Laura will call you if you’re her lover right? As in if the MC is male Laura will call you “handsome” and if MC is female Laura will call you “beautiful”?

1 Like

Yep Laura is locked female.

For the bisexual and asexual part, i don’t understand either. As I said earlier, i experimenting with the script and turns out it’s not giving me an error, but a dissaster.

Yep, that’s what I wanted to fix, but since the desk messed up, I got stressed by it and even ruined it more. In the end of the script i sent, I want the Lover to call the MC their ‘boyfriend’ (based on MC gender) but I think I write it wrong and the codes just didn’t match with what I’m expected.

Well what also confuses me here is if we are supposed to define if we like Laura? Because this choice seems to be used to define the MC sexuality and if we like Laura or not, thus it’s missing an option to like women but not be attracted to Laura in particular.

Do you want the option to mean we are attracted to Laura too, therefore those “lover_female” and “lover_male” names would kick in only in that case? The scripting is somewhat simple, I’m just confused at what exactly you are trying to achieve with this choice.

1 Like

I made the script to choice whether if you want to go Straight, Gay, Bi, or A, then a choice to romance Laura on the same time. But I think, I mix it somehow.

Based on what I made, if you chose to romance female lover for the entire story, you can chose “well she is cute, of course …”. Then it gave you an option if you are Laura’s “boyfriend” with choice " yes or no".

And if you only want to romance male lover, the Laura’s boyfriend part will not showing up but it will make the MC to romance male lover for the entire story. I’m confused, should I made it fake_choice or not, so I start experimenting and then I stuck.

Well I’m still a bit confused on what you’re trying to do here, but here goes.

Do you feel attracted to Laura?

*fake_choice
	#No, I’m only interested in men.
		*if (gender = "male")
			*set orientation “gay”
		*else
			*set orientation “straight”
		*goto halloween_house
	#She's a cute girl, of course I'm attracted.
		*if (gender = "male")
			*set orientation "straight"
		*else
			*set orientation "gay"
		*gosub lover_words
	#I do like her, but I like men too.
		*set orientation "bisexual"
		*gosub lover_words
	#Love? Not interested.
		*set orientation "asexual"


*goto halloween_house
*comment ---------lover_words--------
*label lover_words

*if (gender = "male")
	*set boyfriend “boyfriend”
	*set husband “husband”
	*set val_he “he”
	*set val_his “his”
	*set handsome “handsome”
	*set val_man “man”
*else
	*set boyfriend “girlfriend”
	*set husband “wife”
	*set val_he “she”
	*set val_his “her”
	*set val_man “woman”
	*set handsome “beautiful”

*return
*comment ---------halloween_house--------
*label halloween_house

So you are Laura's ${boyfriend} then?

What is being done here is that it will set the player’s orientation based on their gender and selected answer. If the orientation selected likes women, it will then assign the proper words to the variables.

This is how *gosub works:

Once *gosub lover_words is reached, it wil go to the *label lover_words (just like a *goto), and then it will do the code contained there, which it will check what gender the player is to properly assign them. This way you don’t need two *gosubs lover_male and lover_female, just leave the check on the *gosub instead. Once it reaches *return it will go back to where it was called (to whichever *gosub lover_words it was called from) and continue the code normally.

1 Like

I’m currently outside, and definitely will try this once I home. Thank you for your help. I will post about what happen next, later. :grin:

I know this isn’t really what you’re asking but I found useful stuff from tutorials, to where to post a demo, and to creating save points. It did help me with setting up variables be it a conditional case or a trigger case for the game. Hope the link helps.

1 Like

Thank you for sharing it, I’m going to check it and will keep learning so my choicescript-ing will be better and better. :grin:

So far, this code works fine, even when I do a little edit for adjustment, they’re still working.
I think this solve the case of mine so I’ll pin it as solved. Thank you. :grin: