I’m getting an error where my * commands aren’t working at all so could someone tell me what’s wrong? It continues to say that I should have no indents in any line (errors on every line with a indent)
You can use quotes on #option
s without issue. That’s probably not the issue.
Indent issues usually occur when you mix tabs and spaces, or when you don’t correctly indent each line using the same number of spaces/tabs. I suspect the latter more than anything - it’s easy to accidentally hit a space bar one too many times, or to think you pressed it and end up with less spaces than you suspected. Are you using CSIDE or Notepad++?
I’m using Notepad++ and trust me I considered the latter so many times and even rewrote it on another script it’s definitely not the issue although I wish it was it’s more easier that way.
Don’t indent the input text. Try writing it out where the input text part is on the same spacing as the label.
K give me one sec
No, while it did let the *input_text work, it still wants everything else without the indents.
The indents keep me organized
Works fine for me without the indents on the *input and *goto commands.
You can’t just use indents where you please and ignore them where you want. They’re a part of the Choicescript language, used to delineate sections form each other - much like Python.
I use 3 spaces for *goto, *set, and *input_text commands
I use 2 spaces for #choice
That’s it I don’t have these problems on my other game
The spaces need to be identical, otherwise the code won’t read it write. For your problem of wishing to organize it, I tweaked the code a bit to incorporate the use of a choice command in picking your name, therefore allowing you to indent the input_text command.
*create name ""
*create name ""
*create surname ""
*create gender ""
*create gender1 ""
*create gender2 ""
*create gender3 ""
Chapter 1
"Oh my what a beautiful little-
*choice
#-Girl"
*set Gender "Female"
*set Gender1 "her"
*set Gender2 "she"
*set Gender3 "Ms."
*goto child
#-Boy"
*set Gender "Male"
*set Gender1 "he"
*set Gender2 "him"
*set Gender3 "Mr."
*goto child
#-Baby
*set Gender "Non-binary"
*set Gender1 "Xe"
*set Gender2 "Xem"
*set Gender3 "Mx"
*goto child
*label child
What is your name?
*choice
#Bobeh.
*set name "Bobeh"
*goto theme
#Let me spell it out for you.
*input_text Name
*goto theme
Ok I just tried your code now it allows me to indent the *input_text but it still won’t let me indent *set and *goto
You have to have consistently the same exact indentation for your commands, otherwise the script may read it wrong. Let’s say you put choices as two spaces and gotos as three spaces. Well that means on the sixth space, you’re going to have two identical spacings, but one is a choice and the other is a random goto from a completely different scene. Attempt to use the same number of spacings for every command. I personally use two space indents, but you can use four, six, three, eight, whathaveyou, so long as each time you indent, it’s the same number of spaces per indent. It’s like how you wouldn’t indent the start of a paragraph a different number of spaces/tabs than the next paragraph.
See I already address this problem
Is there anymore possibilities to what could be wrong
From your code it seems you are using 2 spaces as indentation. This means you need to use 2 spaces for each level of indentation.
Level 0: No spaces.
Level 1: 2 spaces.
Level 2: 4 spaces.
Level 3: 6 spaces.
.
.
.
What exactly is the error message you are getting? Because the version posted by @LeoXII is working fine, although that seems to have incorrect indentation (at least when I copy and paste to check); it has only 3 spaces instead of 4. Even then, the code works fine (I printed Gender and Gender1 variables and they are still *set correctly).
Btw, I highly recommend you use tabs instead of spaces for indentation, use only 1 tab per level because it’s much more visible and you only need to press it once, you don’t have to remember how many you did unlike if you use spaces. Notepad++ will also have a marker for your indents if you use tab.
Example of using tab (this is only 1 tab for each level). Note how the choice options are very visible even if only 1 tab press is used, while 2 tabs presses are used for the Gender, Gender1… *sets underneath it and are also very distinguishable at a glance.
Note how Notepad++ leaves a dotted line so you can more clearly see the indent.
(@LeoXII's version with tabs)
*title Indentt
*author GS
*create name ""
*create surname ""
*create gender ""
*create gender1 ""
*create gender2 ""
*create gender3 ""
Chapter 1
"Oh my what a beautiful little-
*choice
#-Girl
*set Gender "Female"
*set Gender1 "her"
*set Gender2 "she"
*set Gender3 "Ms."
*goto child
#-Boy
*set Gender "Male"
*set Gender1 "he"
*set Gender2 "him"
*set Gender3 "Mr."
*goto child
#-Baby
*set Gender "Non-binary"
*set Gender1 "Xe"
*set Gender2 "Xem"
*set Gender3 "Mx"
*goto child
*label child
${Gender} ${Gender1}
What is your name?
*choice
#Bobeh.
*set name "Bobeh"
*goto theme
#Let me spell it out for you.
*input_text Name
*goto theme
Give me one sec to test this out
No it didn’t work either I’m thinking on just getting a new project all together and dropping this one
And what’s the error message? It works fine here.
Edit: Wait, I messed up and forgot to set it into code mode for the forum. I edited my post, try the new code there.
The codes @GoldenSilver and I displayed are both perfectly functioning (I still don’t know how the difference in spaces happened in the translation of text here, it’s all two spaced on my CSIDE ). I think the main issue is that you’re attempting to configure the code to work in a way it’s not intended. You viably cannot use choicescript in a function that lets you personally determine how many tabs you can use based on the command without it eventually screwing up. You have to set up your coding around how the program reads it, otherwise it won’t read it correctly. The actual place you write the code doesn’t matter: I started writing choicescript on a basic notepad app, and just counted the spaces every time I indented. We’ve solved the formatting issue, and the game works with no errors. Whether or not you prefer that is a different problem that I don’t think I can personally solve haha.
Edit:
This isn’t a problem with the script, but you should have a Gender4 variable that lists “his/her”
There are errors on every line even one that saysthere should be 8 instead of 0