I tried to make time in a squiffy game with attributes for the hours and minutes, and AM/PM, but something doesn't work.
@set hour = 10
@set min = 0
@unset pm
[[]]:
@inc min 15
{if min > 59:
@set min = 0
@inc hour
{if hour > 12:
@set hour = 1
{if pm:
@unset pm
}{else:
@set pm
}
}
}
Can you help at all?
As far as I understand it, @set
has to appear on its own on a line; because it's processed outside of the text processor. You can't use it inside an if statement.
If you want to set attributes conditionally, you need to use the short forms of the operators.
@set hour = 10
@set min = 0
@unset pm
[[]]:
@inc min 15
{if min > 59:
{@min=0,hour+=1}
{if hour > 12:
{@hour=1}
{if pm:
{@not pm}
}{else:
{@pm}
}
}
}