For some reason, when I make the choice *if (crossbow =true)#Shoot, I for some reason get the error “2-village line 828: Non-existent variable ‘shoot’”
My code looks like this:
*choice
*if (greatsword =true)#Charge them
*comment fight goes outside
*set demons -6
*if (crossbow =true)#Shoot one of them
*set demons -1
*if (greatsword =true)#Use a wide horizontal swing
*set demons -2
*if (shortsword =true)#Kill the first one to reach you
*if (clearhouse =false)#Flip up a table to use as a shield
*set head +1
#Dodge out of their way
#There's no end of them...
I’m using the automatic “random tester,” that’s what’s picking it up. Presumably I would get the same error for the other choices if the random test got that far.
I’ve also tried supplementing *if with *selectable_if to the same effect.
Also, if I put a space between between the check and the option, I instead get
“2-village line 1755: Expected choice body”
I don’t even know where to start with that.
Are you remembering to finish every choice with a *goto statement? You can only fall out of a *fake_choice (unless they’ve changed it with the last update…)
You can’t have empty choices, you need *gotos after each choice, and your *if statements are unneccesarily complicated.
If you use *fake_choice, you don’t need gotos if you want them to all go to the same place.
*choice
*if (greatsword) #Charge them
*comment fight goes outside
*set demons -6
*goto Blah
*if (crossbow) #Shoot one of them
*set demons -1
*goto Blah
*if (greatsword) #Use a wide horizontal swing
*set demons -2
*goto Blah
*if (shortsword) #Kill the first one to reach you
*set something
*goto Blah
*if not (clearhouse) #Flip up a table to use as a shield
*set head +1
*goto Blah
#Dodge out of their way
There's no end of them...
*goto Blah
*label Blah
*comment fight goes outside
*set demons -6
*could be 4 or 3
Timidity has no place when fighting the forces of Satan.
The 4th line looks like a comment, but hasn’t been commented out. (Sometimes when you don’t know where an error is, it’s a lot earlier in the code than the error message claims.)
[quote=“Interestedparty, post:6, topic:27035”]
I kept getting the “2-village line 1755: Expected choice body”[/quote]
Okay, well, that’s way later than line 828, so I expect that is fixing the issue at hand… but at the end you have “#Dodge out of their way” and “#There’s no end of them…” and neither of these choices have anything under them. I think that must be the “expected choice body.” So if you just stick some *goto under each of those two choices, and you do the separate line *if thing, does that clear the error?
Check the other choices I find the error could be on a different line if you accidentally put shoot in a (insert variable) slot further down on the same indent