Issues with “@“ commands after “if” function
Igorofigor
10 Oct 2022, 20:48I 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?
mrangel
11 Oct 2022, 11:51A 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)
Igorofigor
12 Oct 2022, 10:19Thank you! It worked.