I’m having trouble with the quicktest function reporting an error whenever I use variable by reference. The code works when playing, but not for the quicktest. For example:
Successfully works to reduce alchemy by 1, but when I run a quicktest it seems to ignore the “if” command and gives me this error:
Error: choicescript_stats line 2491: Non-existent variable ''
Where line 2491 is “*set {eastwindritualtarget} - 1”
At first I thought "oh, duh, I must have used ’ instead of " somewhere. But I’ve looked through and that’s not it. For some reason it’s setting the variable to use two ’ symbols instead of two " symbols to empty it when I’m not doing that anywhere, and also trying to test the command even when eastwindritual doesn’t = “alchemy”. At first I just removed these sections to quicktest but to add a feature they’re getting more plentiful.
For context as well, this happens in the quicktest to every stat change I do by referencing a variable.
I know this is not the solution/answer, but I’ve also ran into a similar problem with the old(?) referencing notation, *setref, just the error message is different:
Quicktest failed: Cannot read properties of undefined (reading 'length')
Sharing this in case it is helpful for getting closer to the cause.
Huh, oddly that does fix it. Can’t use it to fix one instance but I can use it to fix the instance that I had to replicate everywhere, so it looks like I can reliably test again. Thanks!
Quicktest, unlike randomtest, doesn’t actually “play” your game. It therefore has no way of knowing what value that variable is set to at that point in the game.
You can either ensure there’s a suitable dummy default value given, as mentioned above. Or, you can use the special variable: choice_quicktest, in an if condition to appropriately set (or avoid running the problematic code).