I have encountered an issue with an *if…*else block not working inside a much larger file where other *if…*else commands are working.
During testing, I discovered that a block seemed to be getting skipped. I worked out that it doesn’t get skipped if I don’t use any *else statements.
I don’t understand why this particular block is having problems, but other similar blocks elsewhere in my code are fine.
I have implicit flow control on if that matters. I have confirmed that the two variables used in the *ifs are correctly defined either in the startup.txt file or in the current scene file (and not double-defined or anything). I don’t get any errors, the block is just ignored.
This how I’d like to write the code, but it’s not working, as shown in the first screenshot. Note that the “Separate? ${separate}” line is there for debugging purposes.
*comment Narrowing Target <section>
*comment Narrowing Target - VC <sub-section>
*comment You can get here without referencing specific evidence
*label victorCrawford
*set narrowingTarget true
*page_break
Separate? ${separate}
*comment Update time remaining <review>
*comment You decided to investigate separately
*comment This block seems to be getting skipped entirely <review>
*if (separate)
*comment Whitney is offended by you
*if WCrelScore < 4
"Alright, Sonnia and I will investigate together now," Whitney tells you. "You're free to do whatever you want."
*goto investigateSeparately
*comment Whitney is annoyed with you
*comment An else here doesn't seem to work <review>
*comment *if WCrelScore >= 4
*else
"Alright," Whitney says. "We can split up here if you still want to do that."
*choice
#Investigate with Whitney and Sonnia.
"I've changed my mind," you respond. "I'd like to continue the investigation together."
"Oh good," Whitney smiles. "Glad to hear it."
*set WCshortTerm ""
*goto dramaticRetelling
#Investigate on your own.
"Sure, we'll leave you be."
*goto investigateSeparately
*comment You decided to continue to investigate together
*comment An else here doesn't seem to work <review>
*comment *if (separate = false)
*else
*comment Whitney is offended by you
*if WCrelScore < 4
*goto boringRetelling
*comment Whitney is happy
*comment An else here doesn't seem to work <review>
*comment *if WCrelScore >= 4
*else
*goto dramaticRetelling
If I replace all of the *else commands with *if commands that effectively do the same thing, it works, as shown in the second screenshot.
Issue occurs:
Issue does not occur: