Back to All

We Need Mulitple Expression Conditions

Custom vars and logic operations are, of course, a necessary part of implementing a bot. And the current implementation affords us that. But we need the ability to have multiple expressions in a condition. Otherwise, we have to nest conditional statements, which is ungainly.

For instance, in the following example, we want to display the text only if variable KILLBOT_SEEN is 1 AND variable KILLBOT_HAS_LEFT is 0:

[IF([showVar=KILLBOT_SEEN]=1){[IF([showVar=KILLBOT_HAS_LEFT]=0){Killbot 9000 is still standing there. Its various sharp and pointy bits whir and glint in the muted light.}]}]

It would be preferable to write:

[IF([showVar=KILLBOT_SEEN]=1&[showVar=KILLBOT_HAS_LEFT]=0){Killbot 9000 is still standing there. Its various sharp and pointy bits whir and glint in the muted light.}]

That doesn't seem like much difference, but if you have multiple levels of nesting, it gets ugly quick. You can't space them out visually like code, because the returns are included in the chatbot output.

[IF([showVar=KILLBOTSEEN]=0){In the hallway outside your door stands a silvery mechanical beast with ten or more arms, each sporting a fairly dangerous looking pincer, blade, saw or other implement of apparent mayhem. Its glowing red eyes regard you with steely indifference.}]
[IF([showVar=KILLBOTSEEN]=1){[IF([showVar=KILLBOTLEFT]=0){Killbot 9000 is still standing there. Its various sharp and pointy bits whir and glint in the muted light.}]}]

[IF([showVar=FREAKOUT]=2){Two powerful clamps that could easily snap you in half clack open and shut, slowly at first, then more rapidly. A deep thrum begins to emanate from the bowels of the gleaming beast.}][IF([showVar=FREAKOUT]=3){Several intense laser beams flick around your body then come to a stop just over the spot where your heart is beginning to gallop wildly in your chest.}][IF([showVar=KILLBOTSEEN]=1){[IF([showVar=KILLBOTLEFT]=1){The hallway is empty.}]}]
[customVar KILLBOTSEEN=1]