I am creating a game where the main character's sprite can change based on various circumstances such as what type of armor he is wearing, and eventually, what gender the player picks.
What I am discovering very quickly is that accounting for this in game is requiring me to include mountains of conditional branches in every event.
Is there a plugin somewhere that would let me choose what face to be displayed with a variable or a switch? Or if not, do some of you have any tips for me on how to do this more easily?
Thanks!
EDIT:
I may have figured out something on my own here, so I'll leave my solution here in case anyone is curious or figures out a better way to do it.
I discovered that you can call the text box manually via the following script: $gameMessage.setFaceImage('filename',x) ~ where the string in the quotes is the name of the file you're pulling the character's face from and x is a number from 0 to 7 indicating what specific face to pull from the file.
So, all we need to do is replace the file name with a variable containing a string that is the filename we need. Unfortunately, you have to do this manually also, as far as I can tell. But this is easy enough.
The syntax is: var Whatever = "TheNameOfYourFaceSetFile"
So, if you were to call a script and type in this:
var Whatever = "TheNameOfYourFaceSetFile"
$gameMessage.setFaceImage(Whatver,4)
$gameMessage.add("This is a test")
In game, it would display a message in the appropriate event using the fourth image in the TheNameOfYourFaceSetFile.png file that says This is a test.
I think.
EDIT 2:
Okay, so that didn't work like I thought it would. I don't know what I'm doing wrong, but when I set the string for the variable in any other context but in the script box that is directly calling the text i want, the game promptly forgets all about that variable. And I get an undefined variable error.
Oy.
What I am discovering very quickly is that accounting for this in game is requiring me to include mountains of conditional branches in every event.
Is there a plugin somewhere that would let me choose what face to be displayed with a variable or a switch? Or if not, do some of you have any tips for me on how to do this more easily?
Thanks!
EDIT:
I may have figured out something on my own here, so I'll leave my solution here in case anyone is curious or figures out a better way to do it.
I discovered that you can call the text box manually via the following script: $gameMessage.setFaceImage('filename',x) ~ where the string in the quotes is the name of the file you're pulling the character's face from and x is a number from 0 to 7 indicating what specific face to pull from the file.
So, all we need to do is replace the file name with a variable containing a string that is the filename we need. Unfortunately, you have to do this manually also, as far as I can tell. But this is easy enough.
The syntax is: var Whatever = "TheNameOfYourFaceSetFile"
So, if you were to call a script and type in this:
var Whatever = "TheNameOfYourFaceSetFile"
$gameMessage.setFaceImage(Whatver,4)
$gameMessage.add("This is a test")
In game, it would display a message in the appropriate event using the fourth image in the TheNameOfYourFaceSetFile.png file that says This is a test.
I think.
EDIT 2:
Okay, so that didn't work like I thought it would. I don't know what I'm doing wrong, but when I set the string for the variable in any other context but in the script box that is directly calling the text i want, the game promptly forgets all about that variable. And I get an undefined variable error.
Oy.