Quick question about multiple *if formatting

When doing multiple *ifs, such as:

*if (charmed_t) =true and (mc_build) ="slender

Do you have to put a () bracketing the whole *if? A bit confused, having to re-learn/drop some incorrect stuff I learned before about COG coding.

First off, the placement of the parentheses are incorrect.

From the wiki:

Because you are including two variables/conditions, you need to have two sets of parentheses around your conditional statement. A pair of parentheses around your charmed_t = true condition and another pair surrounding your mc_build = "slender".

The second pair of parentheses needs to encase both of these separate conditional statements so the CSIDE can know what you mean.

So to answer your question, yes. You need the bracket your entire conditional statement. The more variables you add to your conditional also means that you need to add more parentheses to the left side of the conditional otherwise you’ll return an error.

Additionally, you’ll need to close your string variable for the mc_build with another quotation mark or else you’ll return an error and need to input a single space between the equation sign and your variables (true, slender) or else you’ll return with another error.

Your code should look like this:

*if ((charmed_t = true) and (mc_build = "slender"))
         Conditional text based on charmed_t and slender build goes here.
3 Likes

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the @moderators.