Because these are amongst the most common troubles people run into when starting to code, a few things:
- Sometimes, when quicktest tells you a goto is needed at line X, it might mean the line above it. Often happens when a goto is missing in a choicebody. Don’t worry when QT tells you there’s no goto at line X yet there is one in the choice on that line. The goto might be missing in the last line of the previous choice.
- the if-elseif-else structure is not always needed. If you want things to end at the same bit of text, you can do like this:
Text A
*if (x = 1)
flavortext 1
*if ((x = 2) or (x = 3))
flavortext 2
*if (x = 4)
flavortext 3
text B
this will result in the same as either
Text A
*if (x = 1)
flavortext 1
*goto b
*elseif ((x = 2) or (x = 3))
flavortext 2
*goto b
*else
flavortext 3
*goto b
*label b
text B
or
Text A
*if (x = 1)
flavortext 1
*goto b
*elseif (x = 4)
flavortext 3
*goto b
*else
flavortext 2
*goto b
*label b
text B
- The if-elseif-else structure comes in handy when all conditions go to different labels. When only one or two conditions go elsewhere, you can split things like this:
*if (x =1)
*goto x
*else
*goto y
or
*if ((x =1) or (x =3))
*goto x
*else
*goto y
- I wish I could tell you how exactly the hierarchy of parenthesis goes, but I’m not too certain myself (someone add what they can here), but I think it’s like this (correct me if I’m wrong)
((x =1) and (x =2))
or
((x =1) or (x =2))
checks if all/either condition listed applies
(x =1) and ((y =1) or (z =2))
checks if x is 1 and if either y is 1 or z is 2.
(x =1) or ((y =2) and (z =1))
applies a condition if either x is 1 or if y is 2 and z is 1
I hope I got this right.
Anyway, I think these are the biggest bits that people trip over. Don’t worry about it, you’ll get there Happy coding