Need help circumventing a Quicktest error

I want to run a Quicktest, but when I try, I always get the same error. I know what’s causing it, and will explain below the excerpt of code, but I can’t get rid of the offending lines, so I need to find out some way, like Randomtest’s *if choice_randomtest, to get around it.

Here’s the offending code:

*if (length(name) >= 1)
     *temp letter1 name#1
*if (length(name) >= 2)
     *temp letter2 name#2
*if (length(name) >= 3)
     *temp letter3 name#3
*if (length(name) >= 4)
     *temp letter4 name#4
*if (length(name) >= 5)
     *temp letter5 name#5
*if (length(name) >= 6)
     *temp letter6 name#6
*if (length(name) >= 7)
     *temp letter7 name#7
*if (length(name) >= 8)
     *temp letter8 name#8
*if (length(name) >= 9)
     *temp letter9 name#9

See, when the player chooses their name, I need to grab each letter in their chosen name, whether it’s one of the default names or one they input. Each *if statement in the code above stores each letter in the name in a *temp variable. When I first tried doing this, I got errors if the inputted name wasn’t long enough, e.g. the name Helen would result in “There is no character at position 6. “Helen” is only 5 characters long.” Adding the *if statements to check that the letter existed fixed it for manual playthroughs and Randomtests. However, since Quicktest checks *if statements even if they should be impossible to reach, I can’t test past these lines of code. This is right at the beginning of the game as well, so I essentially can’t use Quicktest at all. Help please?

Have you tried putting *comment before each line you want choice script to ignore?

For quicktest:
*if choice_quicktest

1 Like

No, I don’t want choicescript to ignore it, just quicktest. I don’t get this kind of error at all with a regular playthrough or with randomtest.

Didn’t work. Quicktest stopped at the same line.

It should. Could you post the code snippet of how you circumvent it?

Maybe try using permanent variables instead of temp ones? I’ve had issues like that where it fails to read *temp

1 Like

What are you using letter1, letter2, and letter3 for? Is there a reason you can’t use name#1, name#2, etc. directly?

Quicktest really doesn’t like long series of *ifs, so you could try using an array instead. Something to the effect of:

*temp i 0
*temp letter_1 ""
*temp letter_2 ""
*temp letter_3 ""
*temp letter_4 ""
*temp letter_5 ""
*temp letter_6 ""
*temp letter_7 ""
*temp letter_8 ""
*temp letter_9 ""
*label while
*set i + 1
*if i <= length(name)
     *set letter[i] name#i
     *goto while

Should that be *if not (choice_quicktest), if you want Quicktest to ignore it?

1 Like

Works both ways if you format it right, but yeah, !if is quicker.

@Jumo_004 @Gower

Here’s how I inserted the choice_quicktest bit. If it works the same as choice_randomtest, it should’ve brought the quicktest way further down to past all the stuff where I needed each individual letter, but it stopped at the same place anyway.

*if (choice_quicktest)
     *set name "Quickie"
     *set arithmancy 7
     *goto finally_done

*choice
     *if ((gender = "male") or (gender = "neuter")) #Hiroas
          *set name "Hiroas"
          *goto named
     *if (gender = "female") #Hirya
          *set name "Hirya"
          *goto named
     *if (gender = "male") #Belleros
          *set name "Belleros"
          *goto named
     *if ((gender = "female") or (gender = "neuter")) #Philone
          *set name "Philone"
          *goto named
     *if ((gender = "male") or (gender = "neuter")) #Theseus
          *set name "Theseus"
          *goto named
     *if (gender = "female") #Araidne
          *set name "Ariadne"
          *goto named
     *if (gender = "male") #Persefs
          *set name "Persefs"
          *goto named
     *if ((gender = "female") or (gender = "neuter")) #Danae
          *set name "Danae"
          *goto named
     *if ((gender = "male") or (gender = "neuter")) #Dionis
          *set name "Dionis"
          *goto named
     *if (gender = "female") #Semely
          *set name "Semely"
          *goto named
     #New Name
          *goto new

*label new
Your name?  (Maximum 9 letters, please, and make sure the first letter, and only the first letter, is capitalized.)
*input_text name

Right!  So your name is ${name}!
*choice
     *allow_reuse #Yes
          *goto named
     *allow_reuse #No
          *goto new

*label named
*if (length(name) >= 1)
     *temp letter1 name#1
*if (length(name) >= 2)
     *temp letter2 name#2
*if (length(name) >= 3)
     *temp letter3 name#3
*if (length(name) >= 4)
     *temp letter4 name#4
*if (length(name) >= 5)
     *temp letter5 name#5
*if (length(name) >= 6)
     *temp letter6 name#6
*if (length(name) >= 7)
     *temp letter7 name#7
*if (length(name) >= 8)
     *temp letter8 name#8
*if (length(name) >= 9)
     *temp letter9 name#9

@Lan @Nocturnal_Stillness
I don’t see how doing anything with the variables will fix it. The problem is that the quicktest is continuing into the *if statement when it shouldn’t.

What is the actual error message you currently get? The one you mentioned about not reading the sixth letter sounded like an issue with the variables itself which is why I suggested creating them as opposed to *temp as I have had quicktest issues with *temp that were fixed by just creating them.

Error: line 158: There is no character at position 7. “Hiroas” is only 6 characters long.

The problem isn’t with the *temp variable, it’s with the name#7 command. name#7 tries to retrieve the 7th letter, but since there is no 7th letter in Hiroas, it returns with an error.

have you tried *if not(choice_quicktest)

Could you create two different *labels that lead to different places depending on if you choose a name from the list or if you input a name? It seems to me that this might eliminate the problem of one of the list names not having enough characters to pass the same check as the input_text names.

1 Like

Took a lot of retyping, but I tried the *if not method. Nothing changed.

No, as an inputted name isn’t guaranteed to be a full 9 letters long either.

If “passing quicktest” is your only concern, I have a temporary solution: *comment out all your intricate system and add default naming for quicktest to pick. Doesn’t solve your problem entirely, but if you want your game to pass quicktest as submission req, HG can understand that.

Quicktest always create two copy (or more) of their instance when encountering a set of conditional checks. That’s why there’s no reliable way to force it without commenting the lines you don’t want quicktest to test.

As mentioned, there’s no way to get Quicktest to skip lines of code without commenting said lines out. So as long as you have *temp letter9 name#9 in the code, you’re going to get an error anytime Quicktest tests that line and name is eight characters or less.

By using a loop and an array, you can eliminate the statements that give Quicktest problems.

Alternatively, you could just set name to something with nine or more characters when Quicktest is running.

*label named
*if (choice_quicktest)
     *set name "123456789"