I’m trying to implement a gender system in my game I’m making with CSIDE and it all works fine except for transgender female, the error just flags life line under it setting the gender. The only way I’ve been able to fix it is if I have an *if (gender = “Male”) choice or a regular choice under it, but that isn’t a very good solution.
*if (gender = "Male") #Yes, I am a man.
*set gender "Cisgender Male"
*if (gender = "Male") #No, I am a woman.
*set gender "Transgender Female"
*if (gender = "Female") #Yes, I am a woman.
*set gender "Cisgender Female"
*if (gender = "Female") #No, I am a man.
*set gender "Transgender Male"
#No, I am neither a man nor a woman.
*set gender "Non-binary"
Are you sure that the fourth option works ?
Because I think that The cause of your proplem is that you can’t check the same condition repeatedly
Which will give you an error in the second choice and the fourth one too
And this is an alternative for your code that I hope will work:
*choice
#Yes, I am a man.
*if (gender = "Male")
*set gender "Cisgender Male"
*if (gender = "Female")
*set gender "Transgender Male"
#No, I am a woman.
*if (gender = "Male")
*set gender "Transgender Female"
*if (gender = "Female")
*set gender "Cisgender Female"
#No, I am neither a man nor a woman.
*set gender "Non-binary"
It should be able to check for the same if-condition when they’re used to show/hide the options.
This is a weird one. The indentation checks out, there’s no accidental two ’ instead of ", so the best guess is that something went on the wonk in CSIDE.
OP, how long is the scene file? Maybe that’s the culprit, that it just has to parse too much by that point?
I don’t know but I think that the alternative I wrote will work for her just well.
If she wrote the error maybe someone could understand her proplem and help her . Maybe it will be something wrong with the set command indentation on the second choice🤔
But it seems good here
If it doesn’t then maybe it’s CSIDE’s cache. Another alternative would be making the gender variable a numeral one, which would also make using it with multireplace easier. But let’s wait for what OP says.
Agree with the previous comment totally. The issue is incredibly weird, particularly considering syntax and also the way it’s indented look right. I can see why one might assume possible CSIDE issues, having these types of errors a lot when processing big scene files. I suggest to image some circumstance where the scene file is causing a memory error, and try splitting it in smaller parts if that is too big. You should also try to save the file again in another text editor if there are formatting issues.
Here’s a picture of the actual error, and you can see the scene’s word count, I tried Death_Lord’s code and it worked just fine so I’ll probably stick with that. Every single option works except for picking “No, I am a woman.”
Ok this error mostly appears when there is a mistake with a specific signs so I will give you some ideas that may solve the problem:
1-have you tried changing *fake choice command into *choice command
Try to add a label after the choice column and add a goto(label you added) command at the end of every choice(#)
2-try to add another = in the line 42 if statement condition to be like that ==
3- check your indentation and and the high commas around female as a final desperate try
If all else fails try changing the variables to a numeral one (as mentioned)?.
*if (gender =1) #Yes, I am a man.
*if (gender =1) #No, I am a woman.
*set gender 3
*if (gender =2) #Yes, I am a woman.
*if (gender =2) #No, I am a man.
*set gender 4
#No, I am neither a man nor a woman.
*set gender 5
Oh, James, could you try the following with the initial code:
*if (gender = "Male") #Yes, I am a man.
*set gender "Cisgender Male"
*if (gender != "Female") #No, I am a woman.
*set gender "Transgender Female"
*if (gender = "Female") #Yes, I am a woman.
*set gender "Cisgender Female"
*if (gender = "Female") #No, I am a man.
*set gender "Transgender Male"
#No, I am neither a man nor a woman.
*set gender "Non-binary"
Just to see if it works then for some reason, or if the program isn’t parsing the whole line of code somehow.
Except that it will crash their code, which is what they’re trying to fix. Check your solutions before you post them or you’ll cause people more hassle than help – the opposite of your intention, I know.
I don’t think attempting to fix already broken code with a method that works in other programing languages would really harm James’ code, especially since I’ve already offered him an alternative solution.
However, I’ll definitely keep your advice in mind.
By the way, do you have any insights into what might be causing the issue with James’ code? I find his problem quite intriguing.
It will literally cause his work-in-progress to crash, O Lord. He will get a new and exciting error message about how ChoiceScript was expecting the first equal sign to be followed by a variable, number, etc., not by a second operator.
If you’re writing your own game, try it and see – it should take you 30 seconds in CSIDE. Plenty of things that work in Python (or whatever other language you had in mind) will break ChoiceScript. I know you mean to be helpful, so bear that in mind.
My guess from a quick scan of other threads reporting the “couldn’t extract another token” error is that the problem is trying to use *if as an inline command before the #Option. An extra indent level seems to fix this issue for others, though I couldn’t tell you why. So in James’s case, that would look like:
*if (gender = "Male")
#Yes, I am a man.
*set gender "Cisgender Male"
*if (gender = "Male")
#No, I am a woman.
*set gender "Transgender Female"
*if (gender = "Female")
#Yes, I am a woman.
*set gender "Cisgender Female"
*if (gender = "Female")
#No, I am a man.
*set gender "Transgender Male"
#No, I am neither a man nor a woman.
*set gender "Non-binary"