[CSIDE] The ChoiceScript IDE (v1.3.3 Now Available — 05/09/2022)

What about the top of your code you posted? *choice command shouldn’t need to be indented.

"Seems straight foward enough," says Sir Malcolm. "Go to the cave, kill the spider, get our stuff back." 
   	*choice
1 Like

Would you mind PMing me a zipped copy of the project? We can only speculate without being able to run the code.

1 Like

Hi Szaal, I can see that it does look indented but it is not indented in the code

I would love that, thank you very much

the last one should be an *else I think…
this should be the order, first *if, then all the *elseif that you need and lastly the *else. In your case its just one *if and one *else
*if
*elseif
*elseif
*else

1 Like

Many thanks, I appreciate the help! I have cut and pasted this code from previous scenes that do work and so I can’t think this is the issue because it would not have failed here it would fail earlier on?

Yes, it might not solve the issue, though I still think is a good practice to do it that way.
Regarding the bug it may be on the past chunk of code or the one that follows, just check that all the branches leading there and the ones after are good to, sometimes I’ve found that the line indicated by the quicktest is not always the line of the error but one of the prior or posterior ones.

1 Like

Cheers!
I fixed it by moving Refuse to above #accept and then moved all the code to the bottom so I could align it all again.

There are other errors now of course!

Thanks for everyones help!

1 Like

Thank you for the suggestion @Alice-chan! I had a lot of fun with this one:

Sorry I missed this @Fennik. What do you mean by establish a command? Do you want to take this to the save plugin thread: ChoiceScript Saving Plugin (Update: April 2023)?

7 Likes

oh wow that is so cool. Thanks so much :heart_eyes:

1 Like

I can’t set sexuality for my character. I get “Expected an option, not *set” error. Code is this: (I’m testing a simple sexuality page, before you ask other sexualities will be in.)

*choice
    #He is bisexual.
        *set sexuality bisexual (error happens exactly at this part)
        *finish
    #He is straight.
        *set sexuality straight
        *finish

Works fine for me (if I define the variable and change those to strings):

*temp sexuality ""
*choice
    #He is bisexual.
        *set sexuality "bisexual"
        *finish
    #He is straight.
        *set sexuality "straight"
*finish

Want to PM me a full project?

Hi. There is no project yet as I’m just messing around to learn stuff and I’ve decided to learn how to change variables.

That’s my "startup* page:

*title Mr Freedom
*author Doğukan Gündoğdu
Testing, hope this works
*scene_list
    startup
    chapter1
*create sexuality "Unknown"
*page_break Next
*finish

And you can guess what’s chapter1. When I check Stats I can succesfully see “Sexuality” is unknown

Don’t forget to wrap your sexuality values in quotes:

*set sexuality "bisexual"

Though I can’t see how that would give the error you’re quoting above.

Copied this and worked perfecty, IDK why.

It appears if I copy pasta the correct code it works flawlessly while typing on interface causing issues. Maybe that’s because I’m using an Android device because uhh I don’t have a PC sadly.

Well, at least found a workaround. An annoying one but :man_shrugging:

1 Like

Make sure to keep a consistent indentation. It could mistake the *set for a choice-option if the indentation was off.

Make sure your indentation unit (in settings) is matching what you’re actually indenting with.
I.e. don’t have it set to tabs if you’re using spaces.

I’m afraid CSIDE is otherwise not officially supported on mobile/touchscreen devices.

[Repeat from twitter, the gif is bigger here!]

New features – and even bigger changes to come! Check out this addition: project-wide Find and Replace.

12 Likes

@CJW Can I make a suggestion? :flushed:

You know how some IDE allows collapsing blocks of code?

I thought that would be a great feature for CSIDE. I know CS syntax is not helpful in that regard, but collapsing choices, comment blocks (consecutive lines of *comment), walls of text between *page_breaks or even anything between a *return statement and the previous *label would be great. Perhaps even allowing the user to set the range of lines to be collapsed, like an excel spreadsheet :joy:.

It’s just that scene files can get really long and scrolling up and down can become a chore after a while, and I always put my sub-routines after the *finish statement, so I’m always going up and down. Sorry if that’s totally unreasonable or if it has been suggested before.

Here’s a screengrab from IntelliJ I found on Stack Overflow:

2 Likes

Of course, always!

CSIDE actually already supports folding for indented blocks:

folding

Folding for other situations (such as label → return blocks) is a lot more tricky.
I’ve got an open feature request for it on Github: Investigate enhanced code folding · Issue #58 · ChoicescriptIDE/main · GitHub, which explains my thinking. It’s guaranteed that, at some point, an indented block will end (or the scene will finish). In the case of labels, however, there’s no guarantee that it will end with a return, or it may even end with two or more (under a series of ifs). If you have anything you can add to that discussion, please do feel free!

The tl;dr is: I’m happy to do it, but only once someone convinces me that it can be done well.

5 Likes