If *params is the first non comment or label line in a scene file, it generates the “TypeError: Cannot read property ‘length’ of undefined” error. Moving that code block below something that doesn’t use *params fixes it.
This fails:
*label test
*params testing
${testing}
*return
It generates that error if I use *params as the first non label or comment line in any scene that I use gosub_scene to get to. Doesn’t seem to matter what else there is around it. Just putting the code block with *params under another code block that doesn’t use parameters clears the error. It’s difficult to see how it could be anything in the scene files. The code works perfectly, by the way. Its just Quicktest that doesn’t like it.
I’ll try that when I can get things working again. It’s now decided that it can’t open “code.txt” although the file is in the same directory as the others, it’s called directly with a gosub_scene statement and nothing changed since the last time I ran the test. I might just see how far a mouse can fly today…
Ok, sorry, something did change, I took out the scenes_list - for some reason that made the file invisible.
Thanks Szaal, that made no difference at all though. It’s not a major issue, it can be sorted simply by not making a *params statement the first one in a scene file. It’s just an oddityl
Hmm. I added a *finish at the end of the startup file. Made no difference.
I created a new dummy file with a *finish statement and put a goto_scene to it in startup after the gosub_scene to the code file. Made no difference.
If I remove ‘code’ from the scene file it says it can’t find it. I put ‘code’ above ‘startup’ in the scenes list, still runs perfectly but quicktest still produces that error. Putting an empty label…return code block at the head of the scene file clears the error.
*label dummy
*return
I’m flummoxed. I created this little test project because I was having the very same issue in another project I was working on.
If you have a separate subroutine scene, you need to have a *bug Subroutine scene called without label. Make sure to specify the subroutine to be called by label. at the top (I mean, technically you only need the *bug, but I like to make sure all my bugs are correctly labeled). Quicktest just goes in at the top of the scene and tries to run it directly, and that won’t work because it doesn’t have any parameters when it starts (because it starts every scene fresh).
Nope. Thought I understood but I think the only way I’m going to work around this is to just not have a *params statement as the first real command in a file.
There’s nowhere I can put *ending that affects this issue in any way at all.
Anyway, I’ll just make sure that I don’t use *params at the first actual command in a scene file. That seems to be the only way to stop Quicktest failing on this without also breaking Randomtest.
Ahhhhhh. It’s taken me all this time to finally understand what you were trying to tell me!
Quicktest tries to treat a code only scene like a normal one and gets confused when it can’t find anything in it that it can ‘go to.’ I put ‘*ending’ right after a comment at the top of the file and that sorted it out.
Thanks, and apologies for being a bit dim witted lol
Figured I would necro this thread instead of opening an identical issue. I’m running into the same problem, but for me, neither adding a *bug at the top of the scene, nor adding *ending solves the issue. Here is my code:
File name: ro_name.txt
*bug Subroutine scene called without label. Make sure to specify the subroutine to be called by label
*label ro_name
*params punctuation
*if (roGender = kMale)
${kRoNameMale}${punctuation}
*elseif (roGender = kFemale)
${kRoNameFemale}${punctuation}
*else
*temp roll 0
*rand roll 1 2
@{roll ${kRoNameMale}|${kRoNameFemale}}${punctuation}
*return