setState: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
m (Applied Template:MacroFunction)
Line 1: Line 1:
==Function setState==
{{MacroFunction
|name=setState
|description=
Sets the value of the [[Token:state|Token State]] on the [[Token:Current Token|Current Token]]. If The value is 0 then the [[Token:state|Token State]] is unset if it is non zero then it is set.
Sets the value of the [[Token:state|Token State]] on the [[Token:Current Token|Current Token]]. If The value is 0 then the [[Token:state|Token State]] is unset if it is non zero then it is set.


===Usage===
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: setState(name, value)]
[h: setState(name, value)]
</source>
</source>


===Examples===
|examples=
To set the "Dead" [[Token:state|Token State]] on the [[Token:Current Token|Current Token]]
To set the "Dead" [[Token:state|Token State]] on the [[Token:Current Token|Current Token]]
<source lang="mtmacro" line>
<source lang="mtmacro" line>
Line 17: Line 19:
[h: setState("Dead", 0)]
[h: setState("Dead", 0)]
</source>
</source>
}}
[[Category:State Function]]

Revision as of 04:37, 9 March 2009

setState() Function

Sets the value of the Token State on the Current Token. If The value is 0 then the Token State is unset if it is non zero then it is set.

Usage

[h: setState(name, value)]

Examples

To set the "Dead" Token State on the Current Token
[h: setState("Dead", 1)]

To reset the "Dead" Token State on the Current Token

[h: setState("Dead", 0)]