Any help on scripting character appearance?

Okay so I’m creating my first appearance choice in game but I can’t seem to figure out how to put multiple options into one variable. (Solved)

Okay so how do you script in the choice where the player is able to input their own choice? For example
What is your eye color?
Red
Blue
Yellow
None of these are right (how do you do this?)

If I’m understanding you correctly, you’re trying to find a way to store information for both the hair and the eyes in the ‘appearance’ variable?

If so, you can’t do that, unless you set a different value for every single combination of hair and eye variations, which is unwieldy to say the least.

It’s much easier and more efficient to just create separate variables for the hair and eyes, then reference each individual value as needed.

I see, thanks mate. I tried this option the first time but the code was so painstakingly long and unwieldy that I wiped it to find another option. I’ll just create individual variables.

If I may ask—what is it about separate variables that you’re finding long and unwieldy? Do you really have that many customizable character traits?

If it’s the amount of variables in general that’s overwhelming you, my suggestion would be to separate and categorize them based on subject matter. Put the appearance variables in one section, label them with a *comment header, rinse and repeat, etc.

Edit: oh wait, I might be misunderstanding you, are you saying that you tried the “make a different value for every single combination” method and found that it was, in fact, unwieldy?

In the beginning I put all of my appearance options into one *choice branch like hair, hair color, eye color, hair style, and length. This created around 1-2 thousand lines of code that was hard to keep up with. After choosing your choices you would end up with for example…

So you have long red wavy hair and gray eyes?

I would end up setting this in the appearance variable but it got complicated if that makes sense.

Ahh, gotcha. Yeah, I can see how this would get complicated. My suggestion would be to separate the options as well. Ask for hair, then hair color, then eye color, etc. Set each one separately, in separate *choice commands.

If you still want to do a confirmation bit at the end, you can still do that! Just make a *label before the whole character creation process and then *goto it if the player decides they don’t like the result.

1 Like

One of the first things you have to do when including customization is decide on a balance. How much code you’re willing to maintain, versus how much customization you’re willing to sacrifice. Having played several WIPs on the forums that have extensive customization, I decided that for myself, four appearance variables was the max that I was willing to code around.

I can post my code, if you like. Seeing a done example might help you out a bit.

1 Like

That would be awesome, I couldn’t find many examples of this so this would be very helpful!

*create hair_color ""
*create eye_color ""
.
.
.

What is your hair color?
*fake_choice
	#Black.
		*set hair_color "black"
	#Blonde.
		*set hair_color "blonde"
	#Red.
		*set hair_color "red"
	#Gray.
		*set hair_color "gray"

What is your eye color?
*fake_choice
	#Blue.
		*set eye_color "blue"
	#Green.
		*set eye_color "green"
	#Hazel.
		*set eye_color "hazel"
	#Brown.
		*set eye_color "brown"


You hair is ${hair_color} and your eyes are ${eye_color}.

Thanks a lot!

This link might help you out with similar customization options in the future. :slight_smile:

Question resolved!