Need Help with Error in Code

I’m still fairly new to choicescript, so I don’t know if I missed anything or I’m just dumb, but I’m having trouble with doing this particular scene that requires the player to check all the hiding places before they can click “done”, and I tried to use the example from the *hide_reuse command in the ChoiceScript Wiki, but that also won’t work. The errors that have appeared are:

increasing indent not allowed, illegal to fall out of a *choice statement or invalid expression, couldn’t extract another token: 's search the other rooms, none existent variable “done” (the last option used to be labelled “done” insead of “search other rooms”)

Here’s the code to it:

*label second_floor
Search the floor.

*choice
Preformatted texthide_reuse #Let’s check underneath the bed.
Preformatted text
set search + 1
Preformatted textYou bend and peer underneath the bed and find nothing more but boxes.
Preformatted text*goto second_floor
Preformatted text*disable_reuse *if (closetopen = “false”) #Use the bedsheets to open the closet.
Preformatted text*set search + 1
Preformatted text*set closetopen “true”
Preformatted textYou tie the bedsheets to the closet. Opened. There’s nothing inside.
Preformatted text*goto second_floor
Preformatted text*disable_reuse *if (closetopen = “false”) #Tying something is unnecessary. Open the closet.
Preformatted text*set search + 1
Preformatted text*set closetopen “true”
Preformatted text*goto second_floor
Preformatted textYou tie the bedsheets to the closet.
Preformatted text*disable_reuse #Check the bathroom.
Preformatted text*set search + 1
Preformatted textYou check the bathroom.
Preformatted text*selectable_if (search >= 3) #Let’s search the other rooms.
Preformatted textIt seems you’ve finished searching this room. Let’s go to the other ones.

Are there alternatives? Thank you!

*label second_floor
Search the floor.

*choice
  *hide_reuse #Let’s check underneath the bed.
    *set search + 1
    You bend and peer underneath the bed and find nothing more but boxes.
    *goto second_floor
  *disable_reuse *if (closetopen = “false”) #Use the bedsheets to open the closet.
    *set search + 1
    *set closetopen “true”
    You tie the bedsheets to the closet. Opened. There’s nothing inside.
    *goto second_floor
  *disable_reuse *if (closetopen = “false”) #Tying something is unnecessary. Open the closet.
    *set search + 1
    *set closetopen “true”
    You tie the bedsheets to the closet.
    *goto second_floor
  *disable_reuse #Check the bathroom.
    *set search + 1
    You check the bathroom.
    *goto second_floor
  *selectable_if (search >= 3) #Let’s search the other rooms.
    It seems you’ve finished searching this room. Let’s go to the other ones.

This should work now, you were missing a *goto label, if it doesn’t work let me know the exact error.

No Problem :slightly_smiling_face:

3 Likes

I copied your code and it worked! (Except that I had to change the variable to 3 instead of 4 since 4 was unobtainable.) Thank you so much! I appreciate it. :))

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.