<<if (($strength + $dexterity)) + (($charisma + $constitution)) + (($wisdom + $intelligence)) > 65>>
Sorry, player! Your stats are too high! Please go back and reset them.
<<back>>
<</if>>
<<if (($strength + $dexterity)) + (($charisma + $constitution)) + (($wisdom + $intelligence)) <= 65>>
Okay, your stats are above or equal to 65! Let's check to make sure nothing is above 20...
<</if>>
<<if (($strength or $dexterity)) or (($charisma or $constitution)) or (($wisdom or $intelligence)) > 20>>
Sorry, player! One or more of your skills are above the number 20. Please go back and rectify this.
<<back>>
<</if>>
<<if (($strength or $dexterity)) or (($charisma or $constitution)) or (($wisdom or $intelligence)) <= 20>>
Okay, it looks like everything is all set! Go ahead to the next set of questions.
[[Next.|Last set of questions.]]
<</if>>
Could someone please tell me why this isn’t working? I’ve tried with parenthesis, without parenthesis, and everything in between, but STILL all three dialogues show when my stats do not match what is in the <> statement. I also checked to make sure they aren’t being set elsewhere. Please help!
I don’t know much about Sugarcube, but unless comparison expressions work very differently to almost every other programming language, I’d be surprised if this is doing what you expect. What happens if you write it like this?
<<if ($strength > 20) or ($dexterity > 20) or ($charisma > 20) or ($constitution > 20) or ($wisdom > 20) or ($intelligence > 20)>>
Oh shoot! You fixed two of the lines of code like that! Thank you so much, the only one still not working is the top one!!! Thank you so so much!! Two out of three is such a big help ;w;
For anyone in the future who has this issue with the top type of math problem: set your variables in StoryInit, then within the textbox, don’t have a set number! Just do <<textbox “$var” “”>>
What are you trying to do with all those parentheses in the top lines? If the intent of the code is just to check if all the stat values added together are > or <= 65, then just deleting the parentheses should work fine, but I’m wondering if there’s a reason you’re trying to group subsets of stats together like this?