I’m having trouble with… running a random test. It is falling at the very first fake_choice.
The error I’m getting is:… trackEvent is not defined
My code looks like this: (At least, this was the last thing randomtest did before it stopped.)
#I'll use my knowledge of the world to work out what's going on, but not intervene.
*set educated %+maxi
It seems from the nature of the wear and tear on the street seller's clothing, as well as the strikingly sudden way her basket fell apart, that this is the result of magical damage.
The idea that a happy, successful town like Aberporth would respond so coldly
Example
*commend
Indent
1 Like
Are you using any extra code like a save plugin?
Is trackEvent a variable that you’ve created, or are checking anywhere in the file?
2 Likes
No, it doesn’t appear anywhere when I search. Also, I use underscores between words, rather than capital letters, usually.
No it sounds more like an issue with the actual random test itself.
How are you running random test? Via the web uploader or the .bat file? I had an issue with the web one for random test, but the .bat worked fine.
I don’t know. Whichever one you get when you just right click and hit ‘run randomtest with default settings’.
Update: I re-downloaded a previous version of my game which definitely was working, and it is throwing the same error.
I would try reinstalling the plugin, or see if it needs updating.
I would also try downloading the choicescript engine from the website, copying the files into the scenes folder and then try running the randomtest.html and randomtest.bat from there.
My suspicion is there is bug with the plugin as the choicescript code looks fine. Testing your files in a different testing environment would rule this out if the error persists.
I would try to run the test without the plugin. It’s not standard ChoiceScript, so randomtest can’t test it.
1 Like
OK, I’ve worked out the problem is with the current ChoiceScript extension for VSCode. When I dropped back to V3.1.0, it worked fine. Very mysterious because 3.1.1 is like a year old and I’ve been using it for months with no problems.
Incidentally, one thing I cannot recommend is writing your game in VSC, moving into CSide to test it, and then moving it back. It has ended up with random clusters of spaces and tabs, and it is taking me hours to fix it. I think we’ve all learned a lesson today about always making backups.
1 Like
I have actually had separate but related issues with the VSCode Extension in the past. My suspicion at the moment is that is has something to do with the way the extension reads your files when you use the built-in buttons for testing. I would recommend always using the .bat files in the main ChoiceScript folder that you get when you download it–even if it’s a few extra clicks–as they will always the read the files present in the same folder as them. (I’ve had issues with multiple versions / drafts of my project where the VSCode extension doesn’t know which subfolder in my workspace is the correct one to read from, and I looked through the documentation and settings but couldn’t find a way to remedy this.)
FWIW, “track_event” (with an underscore) is a standard ChoiceScript function defined in scene.js, but if the error message implies that the test is looking for a “trackEvent”, that is almost certainly an issue with the extension itself, as there’s no such thing in ChoiceScript code by default.