I’m not sure if this is even possible, but I want to add an option for the player to skip character customization and play with a random appearance. Maybe I could assign each hair color/eye color, etc. a number and use *rand to generate a random characteristic, if that makes sense, but I honestly have no idea if that will even work.
Also, sorry if this has already been asked before, I couldn’t really find anything relevant. Thanks in advance.
Have you tried it? What makes you think it’s not possible? If you tried and struggled at a particular point, let us know so we can help. But it seems from your question that you already know how to do it.
One annoying quirk of CScript is that it re-randomises everything if you go to the stats screen and come back, so you have to do the *rand commands before the choice is made!
*rand r_skin 1 6
*rand r_hair 1 3
*rand r_hairc 1 6
*rand r_height 1 3
Do you want to randomize your appearance?
*choice
#Yes
Your appearance has been randomised!
*goto the_runway
#No
*goto set_appearance
As @Havenstone said, the *rand needs to be before the choice, otherwise you open the stats screen, see that you’ve got red hair, exit out of stats screen, and then the game re-randomises you so you now have blonde hair and don’t realize until all the NPCs start calling you blonde!
I also once had an issue where I’d use *rand to determine if a player succeeded or failed at a task, and some players found that they could just enter and exit the stats screen until the game reported that they succeeded!
It’s only once you reach the next page that it’s locked in, so the best way to do it is to use the *rand command at least one page or one choice before where it’s actually referenced in the game.
Then another possible method should be doing the randomisation on startup and hiding it behind another variable that gets set to true/false at the choice.
Yeah, this has worked pretty well for me. I almost always do my *rands at startup, or (for temp vars) at the top of the chapter file, and use some other approach to keep them from being obvious on the stat screen until the relevant moment. (Like only using r_skin etc. to affect text in the game rather than descriptions on the stat screen, or having the descriptions only appear on the stat screen once r_appearance_chosen has been set to true.)