Is there a better way to do OR/NAND?

RejectTed

Really Experienced
I'm fiddling around with game mode and have a bit where the I want something to be displayed if two things are true and something else if one or both are false. Right now I have something like:
{if A=true}{if B=true} text 1 {else} text 2 {endif}{esle} text 2 {endif}
I don't really like this. It feels a bit complicated, and I'm kinda worried I'll forget to edit one version of text 2 if I need to make changes. I guess writing the same text twice just goes against my (admittedly limited) programming experience. Is there a better way? I know if you're doing something similar with chapters you can use link chapters to avoid duplicate chapters.
 
There is currently no better solution.
I second that.


I know if you're doing something similar with chapters you can use link chapters to avoid duplicate chapters.
Well, that approach can also be used to precalculate the value before opening the chapter.
So you would need 4 link chapters per chapter option that leads to the chapter.

{if precalculated = true} text 1 {else} text 2 {endif}


If the boolean values of both variables can only be switched (true to false and false to true,) you could also use a numerical variable to precalculate the option.
(This approach doesn't need any additional chapters.)
If either of the variables is switched from false to true, additionally add the score change
precalculated + 1
If either of the variables is switched from true to false, additionally add the score change
precalculated - 1

{if precalculated > 1} text 1 {else} text 2 {endif}
 
There is currently no better solution.
Yeah, I figured there wasn't. Thanks though.
I second that.



Well, that approach can also be used to precalculate the value before opening the chapter.
So you would need 4 link chapters per chapter option that leads to the chapter.

{if precalculated = true} text 1 {else} text 2 {endif}


If the boolean values of both variables can only be switched (true to false and false to true,) you could also use a numerical variable to precalculate the option.
(This approach doesn't need any additional chapters.)
If either of the variables is switched from false to true, additionally add the score change
precalculated + 1
If either of the variables is switched from true to false, additionally add the score change
precalculated - 1

{if precalculated > 1} text 1 {else} text 2 {endif}
These are a bit too much work for the current job, but I'll keep them in mindfor the future.
 
Back
Top