Nah, that should work fine. I use that method for my WiP’s all the time.
Yes, that is what I’d do. You could set it as either one or the other beforehand though, if that eases your mind, or substitute it with “Unknown”. That looks nicer in the stats screen too, for the variables that are actually visible, at least.
My *sm_init never gave me trouble before, but I think that it’s causing the problem. When I take it out,it works, but when I try to put it back in…things get messy.
Now that I’m thinking about it, no, that’s not what I’m saying. I’m saying, only create the variables you need once. As it is now you’re basically creating one variable, but trying to call it two different things at the same time. I imagine that’ll come back to bite you in the rear in the long run.
I don’t use the save system plugin, so can’t advise on what *sm_init might be doing to your code. But Cecilia’s right: if you try to create a variable that you’ve already created, the game will crash. You can’t create “himher” on line 12 and then create it again on line 13.
Instead, when you create himher, create it as either “him” or “her”. Say you chose “her” as the default; when you have a choice of gender later in the game, if the player chooses to be male, then *set himher "him", and likewise with all the other gender-dependent variables.
@Havenstone - you seem to be telling me this is wrong? Because it seems to be working flawlessly so far. banging head in frustration at not being a code wizz.
@Silhuetta, If it works without *sm_init, then that’s probably what’s causing the problem. If not, what’s the specific error message you’re getting? (Ooh, good catch, FG) Edit: glad it’s working now!
@Zolataya, those are all *set commands, not *create ones. So it’s functional code, nothing wrong with it as such.
I’d just say two things about it: first, you could save code by creating all the stats as if your MC is either male or female, like this:
*create mc_isfemale false
*create mc_malefemale “male”
*create mc_manwoman “man”
etc.
Then when you get to the choice in your game, you only have to *set them to a different value if the reader chooses to be female.
Second, while different folks find different things helpful in variable names, those examples feel incredibly long to me. I’d go nuts if I had to write {mc_princeprincess} every time I wanted to display "prince". Myself, I'd recommend `*create prince "prince"` (and then `*set prince "princess"` later if the reader chooses to be female) and just remember that your variable {prince} is (a) referring to the MC and (b) it’ll be “princess” if the MC is female. But if the longer ones work better for you, more power to you.
it would work better to have just the first one, and put in an exclamation mark like this: $!{mc_princeprincess}
when you wanted it to display in caps.