Error: Invalid *create instruction & other things

Alright, so I’ve ran into another wall. Again(I seem to have a knack for breaking things).

this is my startup code:

*title The Tainted *author A.G. a.k.a Silhuetta *scene_list startup prologue visionfire

This is all indented correctly… and then we go down to startup line 12, where it says the error is.

*create full_name "John Doe" *create firstname "John" *create lastname "Doe" *create gender "Unknown" *create himher "him" *create himher "her" *create hisher "his" *create hisher "her" *create manwoman "man" *create manwoman "woman" *create hishersplu "hers" *create heshe "he" *create heshe "she" *create boygirl "boy" *create boygirl "girl" *create mistermiss "Mister" *create mistermiss "Miss" *create himselfherself "himself" *create himselfherself "herself" *create race "" *create position "Disoriented Civilian" *create female false *create male false *create sex_preference "Unknown" *create skin_color "Unknown" *create hair_color "Unknown" *create eye_color "Unknown" *create body_type "Unknown" *create like_males false *create like_females false *create know_about_tainted false *create employer_name "Unknown" *create legend_name "Unknown" *create know_about_cerebrum false *create addiction_to_cerebrum false *create health 75 *create has_employer false *create knows_about_insincerus false *create know_about_pures false *create race "Racially Ambigious" *create checkmark_one false *create checkmark_two false

Throughout the whole file, there are no *set commands, which sometimes breaks the game.

If anybody has a clue as to what is going on here, I’d appreciate it if you could lend me your assistance.:sweat_smile:

*create himher "him"
*create himher "her"
*create hisher "his"
*create hisher "her"
*create manwoman "man"
*create manwoman "woman"
*create heshe "he"
*create heshe "she"
*create boygirl "boy"
*create boygirl "girl"
*create mistermiss "Mister"
*create mistermiss "Miss"
*create himselfherself "himself"
*create himselfherself "herself"

It looks to me like this is the issue. You’re creating the same variable twice, but with different values. I bet ChoiceScript doesn’t like that.

2 Likes

I thought this causes an error.

Hmm, that’s strange. I’ve run CS with that code before, and it’s never gave me trouble until now.

So you’re saying:

*create himher "" *create hisher "" *create manwoman "" *create heshe ""

etc, etc, and just set the variables down the line?

@Zolataya, I’ve ran the code, and it doesn’t seem to be the problem. Maybe it’s because of my *sm_init

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.

well, I am a novice still. I use the “unknown” method. it makes it simple for blondes like me. :dolphin:

1 Like

Gah, this is confusing.

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.

*title The Tainted *author A.G. a.k.a Silhuetta *scene_list startup prologue visionfire *sm_init tainted | 4

From my understanding, the sm_init is supposed to go under the scene_list…right?

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.

What is that for anyway? Some plugin?

3 Likes

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.

1 Like

I got the following code from several locations:

#Male *set mc_isfemale false *set mc_malefemale "male" *set mc_manwoman "man" *set mc_menwomen "men" *set mc_boygirl "boy" *set mc_fathermother "father" *set mc_brothersister "brother" *set mc_husbandwife "husband" *set mc_heshe "he" *set mc_hisher "his" *set mc_himher "him" *set mc_sondaughter "son" *set mc_princeprincess "prince" *set mc_PrincePrincess "Prince" #Female *set mc_isfemale true *set mc_malefemale "female" *set mc_manwoman "woman" *set mc_menwomen "women" *set mc_boygirl "girl" *set mc_fathermother "mother" *set mc_brothersister "sister" *set mc_husbandwife "wife" *set mc_heshe "she" *set mc_hisher "her" *set mc_himher "her" *set mc_sondaughter "daughter" *set mc_princeprincess "princess" *set mc_PrincePrincess "Princess"

@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.

This is what I’ve set my code to now:

*create full_name "" *create firstname "John" *create lastname "Doe" *create gender "Unknown" *create hisher "his" *create heshe "he" *create himher "him" *create himherself "himself" *create boygirl "boy" *create mistermiss "mister" *create manwoman "man" *create race "" *create position "Disoriented Civilian" *create female false *create male false *create sex_preference "Unknown" *create skin_color "Unknown" *create hair_color "Unknown" *create eye_color "Unknown" *create body_type "Unknown" *create like_males false *create like_females false *create know_about_tainted false *create employer_name "Unknown" *create legend_name "Unknown" *create know_about_cerebrum false *create addiction_to_cerebrum false *create health 75 *create has_employer false *create knows_about_insincerus false *create know_about_pures false *create race "Racially Ambigious" *create checkmark_one false *create checkmark_two false

I just set the gender pronouns to the female later on, but it still is giving me a error on the first line.

@Zolataya You’re using set there, not create. Set is different.

You have *create race twice on your list.

1 Like

Thanks for pointing that out.

I ended up moving the *sm_init to the bottom, and everything seems to be working fine now.

Now, if I could only get the fade effect to work…:sweat_smile:

@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.

Oh, and a third thing: instead of

*set mc_princeprincess "prince"
*set mc_PrincePrincess "Prince"

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.

2 Likes

A post was split to a new topic: Error: Invalid *create (Multiple values)