Needs # in line X (Im complete noob when it comes to java script FULL STOP)

It keeps saying: needs # in line 21 (and 17, or just any number really) even when there is one or I haven’t created that line. why is this? and how to fix?:sob:

Can you post your code here, so it’d be easier to see what the problem might be? And . . . I assume you mean you’re new to ChoiceScript, not javascript. If I understand correctly, ChoiceScript is built on javascript, but the ChoiceScript coder isn’t directly interacting with javascript in any way (thank goodness).

1 Like

First_Scene line 21: Expected option starting with # (that line is empty in the first place and if I added a # there it would still repeat)
Oh, and I this is the first time using JavaScript along with Choice script

Can you copy and paste the actual lines from your game? That might help.

Also when you post code on the forums, you can use

 and 

(without the space after the forward slash) on both sides, so that the spacing pastes correctly.

You're standing, fighting off the strong fear that threatens to overwhelm you. Your muscles are tensed, 
but shaking. your eyes are focused, but wavering. Not  once in your life have you ever felt like this
before. Not even when it murdered your family. yes... thats right, you are facing the very thing that
destroyed your family, and the very thing that now threatens to overtake all of Earth! 


Now what are you going to do?


You currently have him backed up towards a cliff edge of this strange land. He's focused on
you, without emotion. But your not even sure if he had any to begin with. That dark, blood soaked face;
those black holes for eyes that seem to almost grab for your soul, and his overgrown black hair that
point out like shards of glass... this was the first time you've seen the actual creature not only in
the flesh, but also the first time you've seen his face. in fact, no one has seen his face, he always
wore a cloak that cast a shadow over it. Although, anyone who may of seen it, never lived to tell the
tale. The creatures mouth twists into a menacing grin and you take your signal from there.
*Choice
  #Draw your sword and attack head on
  
     Theres no where for him to run! You unsheathe your sword in a flash and take a dive at his head. You think this is it,
 you have done it! you wait for the feeling of your sword sinking into his flesh, but all theres only air! You have fallen into his trap and he has evaded! and because you utilized all your force in doing so, you're unable to stop as you see the cliff edge draw closer. In a last attempt you reach out your hand. you grab something... you have him! "Thats right." you think. "If I'm going down your coming with me." and with that you pull him down to join your impending doom.
    *finish
  
  #Seige the oppurtunity and speak to it
      
       His grin twists further "Death is about to overcome you mortal, embrace..." He hisses. 
  #Cautiously walk towards it 
hm in my txt viewer its spaced not so unorderly as it appears here, it could be the a problem with the program I used to write it, although its in the right format.

After the ‘embrace’ part, you need a *goto or a *finish (you always do, after each option). Also it looks like the spacing isn’t the same under the three choices, which might cause the problem. Are you using tabs or spaces to indent?

I’ll do that, thank you. I’m using spaces.

I used tabs (didn’t know I could do that) and it cleaned it up nicely. used finished for all options but it repeated.
I’m going to flip

:sweat: now theres an illegal tab when theres a space on line 20… but I haven’t created a line 20. I think I’m going to try another text editor program, because I don’t remember getting these on my tablet. thank you for trying to help though.

1 Like

I strongly sugest you to use the choicescript online IDE or the notepad plus plus highlighter. This way you can better organize your text AND indentation.

Are there too many spaces in front of the #'s?

All of your things are out of alignment. Everything after a # choice needs to have the same amount of spaces before them in the line. And I’m not sure any indentation can be more than 1 greater than the previous part.

For sure. Which text editor were you using?

I just read the thing on note pad as a text editor making things incredibly difficult, so I’m going to download another program that is mentioned here. I’m using the program that comes with every pc, now I know my problem, thank you, its all fixed now.

2 Likes