Issue with coding/setting strings

So, I am currently trying to code something to let the players choose their gender, pretty basic stuff. While doing so, the following error appears “line 18: Invalid use of curly smart quote. Use straight quote instead”

My problem is that I am fairly certain that I am already using straight quotes. To the point where I copypasted straight quotes into the script and the error is still popping up. Additionally, line 18 comes after multiple other lines of similiar code so I can only assume the ones above are fine and good, in which case I don’t know how line 18 would have ended up curly in particular.

When I copy and paste the line into other systems, like word doc, the quotes are straight too. So, I am not very certain what I am doing wrong in this case.

Thanks to anyone who can help!

1 Like

It would really help to see the code section in question.

Use the “preformated text” menu item in the forum’s editor to copy and paste it here without formatting from the forum’s software changing it.

Also, are you using CSIDE, another IDE or a text editor to work in?

Edit: I moved the thread to the help section, so others are more likely to see it as well.

2 Likes

I am currently writing up the code on choicescriptmain>wed>mygame>scenes. The excerpt of code is the following one:

*set mcbtitle “Baron” (specific line that is the problem)

Full code that this segment is a part of is this:

*choice
#…her only son."
*set they “he”
*set their “his”
*set theirs “his”
*set them “him”
*set mcltitle “Lord”
*set mccall “Mister”
*set mcgentleterm “gentleman”
*set mcchildterm “boy”
*set adultterm “man”
*set mcbtitle “Baron”
*set Cthey “He”
*set Ctheir “His”
*set Ctheirs “His”
*set Cthem “Him”
*set Cmcgentleterm “Gentleman”
*goto_scene ladyquartzcontinue

(I tried to add a screenshot too, but it would not let me)

Thanks for moving it to the appropiate thread too! Will keep that in mind in the future.

Use some text editor with replace function.

Replace this

for

"

and

for

"

Look for the configuration of your keyboard. Spanish uses those quotes you’re using, so try to change the layout to English or find which key combination is the one you should use on your keyboard to get → " " ←

5 Likes

Word auto-changes the quotation marks as far as I know, so that may not be the best option.

4 Likes

I figured it out! The problem did seem to be that it was using the quotation style of my own language. I have changed that now. Thank you very much!

2 Likes

That could explain another issue I was having… Will keep it in mind when writing down my notes (I write them in doc first). Thanks!

Usually you can set up several layouts and switch with the windows key + space. If you switch often that’s a quick way to do it.
Otherwise, depending on your OS, there should be a quick access button on the bottom right of your navigation bar.

English also generally uses curved quotes in printed text – but not in coding, where having a single character " is preferred to different before/after quote marks.

As you may be noticing, MS Word does a lot of auto-formatting that can mess up your file. Some people make it work, but I’d personally suggest writing even your notes/first drafts in a program meant for code – like CSIDE (meant specifically for Choicescript), or VSCode, or Notepad++.

2 Likes

Or alternatively not copy-pasting, but re-typing everything to the editor used for coding. Granted, it’s more work (but I personally appreciate the extra round of forced proofreading).

2 Likes

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