A question about player gender.

Darthfayyt
02 Dec 2012, 04:28
I need some help setting the player character's gender so the game loads certain dialogues and scenes based upon if the player has chosen to be male or female. Is this at all possible? I managed to get a question/menu up and running at the start of the game that asks the player to choose a gender, but not sure if I could use that value or how I could use it for specific dialogue depending on the question/menu selection.

182crazyking
02 Dec 2012, 08:30
It's quite possible! If you already know how to set up the menu, just make it so that the game sets a flag depending on which choice. So, if the player chooses male, the game sets a flag on the object "player" called "male." Else if they choose female, the flag is called "female"
Then, whenever you want a gender-unique event, set up an "If..." script. For example, this script for speaking to Bobert:

      <speak type="script">
if (GetBoolean(player, "male")) {
msg ("\"Hey, bro!\" Bobert says, man-hugging you.")
}
else if (GetBoolean(player, "female")) {
msg ("\"Oh, hi!\" Bobert says, giving you a hug.")
}
</speak>


Or in the GUI:

Darthfayyt
02 Dec 2012, 16:24
Thank you so very much!

Darthfayyt
02 Dec 2012, 17:06
How exactly would I make the "Male" and "Female" choices into flags for the player? forgive me, I am really new to Quest.

guzmere
04 Dec 2012, 13:16
Hi <speak type="script">
if (GetBoolean(player, "male")) {
msg ("\"Hey, bro!\" Bobert says, man-hugging you.")
SetObjectFlagOn (player,"male")
}
else if (GetBoolean(player, "female")) {
msg ("\"Oh, hi!\" Bobert says, giving you a hug.")
SetObjectFlagOn (player,"female")
}
</speak>
After the message just set the flags as above. I think this is the way to go. Not sure if the Quote Marks are needed or not.
Keep smiling Terry. :D :D :D :D

jaynabonne
05 Dec 2012, 00:30
Terry, I don't think that makes sense. :) You're basiclly checking if the flag is there, and if it is, you then set it again.

Darth, take the idea in Terry's (using SetObjectFlagOn) but put in the script handler for your menu. If it's Male choice, set Male, else set Female.

(A personal preference: I'd use a single flag or a gender type. Male and female are exclusive and complementary, so a single variable should able to distinguish one from the other, e.g. IsFemale, where false means male, etc.)

guzmere
05 Dec 2012, 06:48
@ Jaynabonne I knew the syntax was sort of right with the gender, just got mixed up with where to place oh well no harm done. By the way did you sort out the timing factor in your walkthrough. I'm having the same problem. For eg if I move from one location to another I sometimes add a second delay just to give it some realism in the game. However I don't know how to transfer that to the walkthrough. It throws all the commands out if it encounters a timer. Terry :D :D :D :D

jaynabonne
05 Dec 2012, 15:08
I don't think I had that problem. I did have an issue with multiple commands not calling turn scripts after each one. :) I gave up on timers long ago. It is an interesting problem though.

I should probably try a walkthrough on my code and see how it works... ;)

guzmere
05 Dec 2012, 15:35
Magic thanks. Terry :D :D :D :D