Different Faces for different genders?

So, basically I'm looking for a script that can let you select a faceset for one gender's messages, but if a different one has been selected (Based off of a switch) then the game will take the same index from another faceset (Because of emotions in the same faceset)

This will stop you from having to put a Conditional Branch every time the player speaks.

For example, say your 2 gender facesets are Hero_M and Hero_F. When you select say number 3 on Hero_M, if the Switch "Is Female?" is on, then the game would display face number 3 from Hero_F instead.

I hope I made that clear enough. If you're not sure about what i'm talking about, then feel free to ask! 🙂
Well you can easily make a script that reads input off a character and a variable like gender.  Let's brainstorm this together as I am also new to coding and this will help me grow a bit while others tell me I am wrong/correct me.  Feel free to disregard if a more experienced person comes along =3

Spoiler
@actor_portrait.bitmap = Bitmap.new("Graphics/Pictures/" + @actor.name + "-N1.png")  

Should your face set be in the regular folder and not be a portrait it will be 

@actor_portrait.bitmap = Bitmap.new("Graphics/Faces/" + @actor.name + "-N.png")

This method will be easier if you don't intend to use full busts/portaits.

Where N would be F and M for male and female respectively and 1 is the corresponding first emotion or default for the set of 8. (0-7 by the editor standards in event window).  This will require an index in the script.  I think this can be done by a variable and inputed directly upon character creations so set a variable like:

If male Variable 001 = M

Otherwise Variable 001 =F

You can also use a switch, but I think a variable will allow you to assign the faces separated by gender more easily in file names.

If you are using the method for busts it will be a bit more work than setting a variable since they aren't all attached.

So the script would need that variable, I choose 1 arbitrarily:

$game_variables[001]

@actor_portrait.bitmap = Bitmap.new("Graphics/Pictures/" + @actor.name + "$game_variables[001]"1.png")

And you'd need an index of the emotions used:

$game_variables[$1.to_i]

So it will need to read i where that is the number of the emotion you want to use.

@actor_portrait.bitmap = Bitmap.new("Graphics/Pictures/" + @actor.name + "$game_variables[001]"i".png")

Where i, the index is 1 -8 here for portraits, or for faces 0-7.

I also think you will require a script call when you want to use the appropriate emotion, so you may end up putting in as much work for this method with a lot of copying and pasting script calls.

I hope this will a bit helpful to get you thinking to work involved.
I think Trivel did a gender script but honestly I want to see what you and palladin come up with now. 😛
Hmm.. yes. I was thinking that the script would detect when you were using either Hero_M or Hero_F, and then change it based on that, so I could effortlessy select the right emotion, without worrying about the gender.

Yes, now that I think about it, you would find the point where the Face is drawn, then if it's Hero_M or Hero_F, you intercept it, and replace it woth something like "Hero_" + $Gender, which would be set to F or M.

Also,

So the script would need that variable, I choose 1 arbitrarily:
$game_variables[001]
When using $game_variables, you don't have leading zeros because it's an array (Correct me if i'm wrong.

Edit:

I've found a few gender scripts, but none of them seem to have this function.
You might wan to compare with this:


http://rmrk.net/index.php/topic,48031.0.html


It's not exactly what you want, but covers most of it and has some additional options
Thanks. That script with the following message code works:
\f{"Hero_#{$Gender}":n}

Edit:
Sorry, wasn't thinking straight yesterday. I don't think that would work.

Original thread: https://forums.rpgmakerweb.com/threads/different-faces-for-different-genders.40324/