Error with "nonexistent" variable that actually exists

Having trouble with a variable that is returning as “nonexistent” despite it existing in the *startup file? I’m not really sure what’s going on here since the only thing it’s returning is “nonexistent variable”.

The variables in the startup file:

*create AlienDogName "text"
*create RoombaName "text"

The code where it’s saying the variable doesn’t exist:

What will you name the dog?

*input_text AlienDogName

*page_break
*goto RoombaName

*label RoombaName

And what will you name the machine?

*input_text RoombaName

*page_break

I will note that there is another section of the game where the same code IS working.

Your variable actually have the same name as the label, maybe try changing the label name by adding a number a the end for example

*goto RoombaName1. Not sure.

further advice:
make all variables lowercase. this stuff can be dreadfully case sensitive.

I thought C-Script wasn’t case sensitive?

Also changed the label and such. @CC_Hill . Still getting the same error.

it can be fiddly.

try making it lower case, resave and try again?

The RoombaName input text or the label?

the variable

Alright. I assume I’ll have to lowercase it in the startup file as well then?

Changed both. Testing now.

As a side note; quick-test isn’t picking up this error. It’s only when players are going through dashingdon that the error occurs. Apologies for any delays as a result.

Did you try to test it yourself and see if you get the error too on your side? I was testing a game just now on Dashington and got an error but the game still played as usual. It was strange.

I got the same error, yes. Weirdly, quick-test popped on something just now but it was unrelated to this particular error.

I think I’m becoming the embodiment of this now:

my-code-doesntwork-i-have-no-idea-why-my-code-14032929.png (500×781) (onsizzle.com)

1 Like

did you reupload ALL files?

Not in the most recent update. Just CH3.

try reuploading all files

Ye. Just did that now. Quick-test isn’t showing any errors now (it did that before though so idk). Hopefully it will fix the problem. I’ll have to test it in a bit.

I would say do a search of the particular variable RoombaName in the file in question… it can be that you just have the variable written somewhere by itself and not in brackets like ${RoombaName}

image

Completed. No errors found.

Two things you’re doing are I believe considered poor general coding practice – not having your variables in all lowercase, and having labels with the same name as a variable – but they do not actually cause ChoiceScript to choke. CS is built to be pretty robust to less-than-ideal coding practices. Whatever the reason for your problem, it’s neither of those things.

Does the line reference in your error message make clear which variable it’s choking on? That should point you to the line of code that’s causing problems. CSIDE in particular is good for jumping you straight to the specific line of trouble code when CS crashes.

1 Like

I’m actually not getting an error code from Quick-test when this error occurs. Dashingdon tells me it’s on the line that involves “*input_text RoombaName” but this line of code is working in other sections of the game and other similar pieces are still working.

Big fan of your work by the way.

Edit:

The *goto and *label in that section were not there before when this error first occurred. I added them in an attempt to fix it since I couldn’t find the error myself.

1 Like

Seeing it had no errors after reuploading, it’s likely the startup on dashing did not contain the variable

1 Like