Quicktest Error - Sage Advice Needed


While this isn’t the end of all humanity, I’m having trouble with a Quicktest Error

When I run quicktest it returns the ERROR: couldn’t open [object Object].txt

It doesn’t really express where this error happens, but it always happens after executing a certain scene.

The only reason I think this could happen in my code is because I use the *goto_scene scenename label command, with both the scene and label being correct and functioning at other points in the game.

It passed all 10 000 iterations of Randomtest, so I’m fairly certain that the game’s okay, and I can live with it, but I’d like insight into correcting the issue because it prevents me from using Quicktest to isolate other coding issues after this cutoff point.


First the obvious thing… make sure the name of your text file is spelled the same way as the way you’re referencing it in game.

Second… you actually have the label in the file, right?
Example: *goto_scene startup first
Obviously, that would try and go to a label called "first"
It can’t do that if there isn’t a *label first in startup.txt

Third… is your text file actually named “object Object.txt”?
If so, or if it has a space in it, have you tried removing the space?

Fourth… are all your files in the right folder?

Fifth… have you tried isolating exactly where that happens by making a copy of your choicescript folder and putting a very simple *goto in a startup, to see if it goes to your other .txt file?


Not at all, which is the worrying part. There’s nothing in the game named ‘Object’ or object. I have no idea where the Quicktest comes up with that. As a precaution, I’ve diverted all instances of *goto_scene {scene} to the main page, and it still produces the error.

There is no object Object.txt, and the game really shouldn’t be looking for one.

All *goto_scene scene label instances are correct and have appropriate targets.

Fairly sure, yes.


Sixth… have you tried downloading a fresh copy of choicescript just to make sure a file isn’t corrupted?


Okay, yes, I did this now, and it still produces the error, which I infer to mean that there must a fault with my coding. Dramatic Sigh - Time to start combing.

Thanks for the help, though.


I have isolated the issue. It seems that a particular instance of this just didn’t go over well, even though there is an academy.txt:

*comment in startup
*create scene "academy"

*comment Anywhere at all
*goto_scene {scene}


Do you not need a $ sign?

*goto_scene ${scene}


I don’t believe so. If I’m not mistaken, the ${} function is only for printing the variable value in text. In commands, I’d use {} to refer to the variable.

I think *goto_scene ${variable} shouldn’t work.


Odd question.
Why do you need a
*create scene?


In startup
Do as well?


I use the ‘scene’ variable as an alternative to *gosub and *return, because those functions aren’t necessarily compatible with my game mechanics.

*goto returnfrombattle
*label returnfrombattle
*goto_scene {scene} {label}

In this case, I’m free to alter the scene and label where the player is deposited after a battle. I can make these changes during, before or after battle as it becomes necessary.

I should point out that *create scene "academy" doesn’t create a .txt file. It creates a variable named ‘scene’ with the string “academy”.


Not a solution, but some side fluff: IIRC QuickTest doesn’t support goto or gosub commands that make use of variable substitution, it simply attempts to skip them.