The Case of the Disappearing *if

Ok so I’ve never done this before and the answer might be staring me right in the face but I can’t seem to get it.
I’m having trouble with something to do with the *if command.
What I’ve put down is

        [i] Not really… [/i] You say in your mind.
        *line_break
        A countdown projects between the both of you: 3, 2, 1…
        *if (focus="brawler")
            blah blah blah 
            *line_break

But in the actual game it just shows the

 [i] Not really… [/i] You say in your mind.
        *line_break
        A countdown projects between the both of you: 3, 2, 1…

and the everything under the *if part doesn’t show up. If I need to post more of the script then I can

I guess the obvious question is whether focus does in fact = brawler.

2 Likes

First:

Line_break is misused. Just use double-return for a new paragraph.

Second, as @Gower says, you need to make sure the variable is, in fact, true.

Also, make sure you have a space between focus = “brawler”. The code doesn’t always read it properly, without the proper spacing.

Just to correct one thing, it is perfectly fine to have an *if without an *else.

If the “if” statement is false (aka, if focus doesn’t = brawler) then the stuff under *if will be skipped, and the code will just move down to the next thing.

Also, as a side note, you can do

*if focus = “brawler”

The parentheses are not needed.

2 Likes

Ah, really? I’ve had it give me issues before, but that’s totally possibly due to some other issues in my code. I usually fix multiple things at once.

Disregard. My b :slight_smile:

1 Like

The “falling out of if” error happens in choices where all available options are gated off with *ifs. That’s where you should use else and elseif, to reassure quicktest that there will always be at least one selectable choice. When you’re just using *if to set variable text on a page, there’s no need for elses or gotos.

1 Like

I’ll just link my old thread on interaction between if/if - if/elseif/else

Oh god, am I always that cringey that time? Those emojis.

4 Likes

Sounds like we have a variety of Encyclopedia Browns on the case, no 25 cents a day required.

1 Like