Boolean - if/else

PrototypeC3V3
08 Jan 2019, 05:53
@set not map_seen

- [[look for a map]]
- [[search online]]

[[look for a map]]:
@set map_seen

[[search online]]

[[search online]]:

{if map_seen=true: map seen}{else: map not seen}

It returns "map not seen" no matter which road I take.
What am I doing wrong?


K.V.
09 Jan 2019, 03:22

Hello.

Try this:

@set map_seen=false

- [[look for a map]]
- [[search online]]

[[look for a map]]:
@set map_seen=true

[[search online]]

[[search online]]:

{if map_seen=true: map seen}{else: map not seen}

PrototypeC3V3
09 Jan 2019, 23:29

Got it to work with your code, but had to add spaces for the @set command

@set map_seen = true"

instead of

@set map_seen=true

Which is very annoying since that doesn't work inside {if:}{else:} commands, inside those you have to keep them without spaces:

{if map_seen=true: map seen}{else: map not seen}

Thanks for your help!


Valgardur
10 Jan 2019, 08:44

Do you even have to print out =true/=false?

I always use:

@set map_seen
@set not map_seen
{@not map_seen}
{@map_seen}


Valgardur
10 Jan 2019, 09:23

Yeah, your first example works for me if you just remove the "=true"-part from the last section:

{if map_seen=true: map seen}{else: map not seen}

I've seen this "bug" before. Even if its set as false/true in the debug-window in the bottom, it doesnt activate in the output. Don't know why. It has something to do with combining (for example) "@not (factor)" with "@(factor)=false".


K.V.
11 Jan 2019, 02:31

It may be because I tested that in the scratchpad thing in the Squiffy documentation instead of testing it in the current version of Squiffy.


PrototypeC3V3
16 Jan 2019, 22:11

Is the scratchpad not up to date?