Adding an IF-description for a character trait

The characters involved in my story has a few attributes thats displayed on each page. However, instead of just showing a number, I also want to show a description after the number to add more flavour.

For instance, one of the character traits is Strength:

Strength: {strength}{if strength<2: (very weak){if strength=2-3: (weak)}}

I succeed in showing the first description (very weak), but moving up to the next level of description (weak) doesnt work as I want it. I need the description to be added for two numbers (in this case 2 and 3). As you can see in my command line the most obvious way doesnt work. How should I write it correctly?


Okay, first a bit of a warning, computers being the literal machines they are see 2-3 and tend to think "2 minus 3" which is -1. Some languages do support ranges, but instead of a dash they use two full stops like 1..10 for one to ten ... unfortunately Squiffy isn't one of them.

But all is not lost! What we can do instead is nest two if statements to test for a range.

Try this:

**Strength:** {strength}{if strength<2: (very weak)}{if strength>=2:{if strength<=3: (weak)}}

Changing the 2 and 3 can make any inclusive range, so this works:

{if value>=10:{if value<=25:{value} is in between 10 and 25 inclusive}}

A quick and dirty (for this use) would be...

{strength}
{if strength<2:(very weak)}
{else: (weak)}

Thank you CrisisSDK, perfect!

I did solve it temporarily by using else:-command, but since I needed seven different descriptions for Strength, the first one works better.


Log in to post a reply.

Support

Forums