so… I have written the first chapter of my game but when playing it, I get this error message:
"startup line 74: expected choice body."
It's to do with this bit of script I have written:
All you know is that you're a:
*choice
#Male
*set gender "male"
*goto First_name_male
#Female
*set gender "female"
*goto_first_name_male
It’s the *set lines that are causing the error but as I am pretty new to choicescript, I don’t know why.
@Addicted do you mind putting < pre > < /pre > without all the spaces and your code between the two >< of the pre’s? This will allow us to properly see how your code is spaced out. As of now I would simply say you need to tab those choices.
Have you created gender in your startup page? and create a male and female for it?
Ah wait I think I see the problem, in your last line *goto_first_name_male that first underscore shouldn’t be there. Should be *goto first_name_male let me know if that solved your problem.
I was about to ask that too. @addicted whenever you’re pasting code on here be sure to select the text you pasted and use the “preformated text” option.
yeah sorry about that. I have used indentation when writing but I didn’t know how to write it on here.
as for the problem though… It’s saying that the problem is to do with the “*set”. I have created male and female labels so I don’t know why it’s saying that that’s an error.
Just to let you know, I haven’t indented the “*set” as when I did at first, it says that the indentation shouldn’t be there; so I removed it.
If the moderators don’t mind I would like to ask another question here. Although it is not to do with this problem, I don’t want to clog up the forum.
How when writing in choice script do you get it to put in “she, her etc” when writing about a female and “him, his etc” when talking about a male? yeah… I know this is pretty basic stuff but although I thought I had it, it turns out I haven’t.
We don’t mind, believe me. We’re all about helping out!
*create gender ""
*create his ""
*create him ""
*create he ""
*create mr ""
*create boy ""
Choose your gender
*fake_choice
#Man
*set gender "man"
*set his "his"
*set him "him"
*set he "he"
*set mr "Mr"
*set boy "boy"
#Woman
*set gender "woman"
*set his "hers"
*set him "her"
*set he "she"
*set mr "Ms"
*set boy "girl"
Well, ${he}'s a fine ${boy}.
Hi there,
I have another question to ask you guys…
How do you get choicescript to only allow someone to use a particular item only if they have picked it up earlier in the game?
Here is something I have made up just for the mean time but it still includes everything that I have done in my actual game (including exact indentation).
At the start of the game:
*create item_one ""
*label demonstration_one
You walk in to a room and spot a pen lying on a table what do you do?
#Pick it up
*set item_one "pen"
*goto write_letter
#Leave the pen where it is.
*goto write_letter
*label write_letter
You decide to write a letter. With what writing implimment do you do so?
#pen
*if item_one = "pen"
You pick up the pen and start writing your letter.
*goto next_section
#You don't have a writing implimment to write with.
*goto next_section
And as always, I am ever greatful for the help you provide.
:smile:
That’s in the advanced section of my guide. The short is:
*create has_pen false
*if you get the pen at some point <-- your first choice
*set has_pen true
*choice
*if (has_pen) #Use the pen
You used the pen
*finish
#Other options.
Does that make sense?
(Also, you need to highlight the code before you hit the </> button.)