I have an issue with making some functions work.
the code is:
{if aware=1:@dec health 5}
It triggers properly, but instead of performing the attribute’s function it just prints it.
What can be the cause of this problem?
A section is broken up into three parts:
js
- javascript, which has to come before the text and starts each line with 4 spacesattributes
- attribute lines start with a @
and must be the only thing on the line (like @dec
and @set
)text
- contains the section's text, including text processor commands (which come inside {
/}
pairs)You can't put an attribute line in the text section. You need to use the equivalent text processor command instead, which would be:
{if aware=1:{@health-=5}}
You use =
to set an attribute, -=
to decrease it, and +=
to increase it.
(off the top of my head… don't actually have Squiffy installed here)