setState: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: ==Function setState== Sets the value of the Token:Token State on the Token:Current Token. If The value is 0 then the Token:Token State is unset if it is non zero then it is ...)
 
No edit summary
Line 1: Line 1:
==Function setState==
==Function setState==
Sets the value of the [[Token:Token State|Token State]] on the [[Token:Current Token|Current Token]]. If The value is 0 then the [[Token: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===
Line 8: Line 8:


===Examples===
===Examples===
To set the "Dead" [[Token: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>
[h: setState("Dead", 1)]
[h: setState("Dead", 1)]
</source>
</source>


To reset the "Dead" [[Token:Token State|Token State]] on the [[Token:Current Token|Current Token]]
To reset the "Dead" [[Token:state|Token State]] on the [[Token:Current Token|Current Token]]
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: setState("Dead", 0)]
[h: setState("Dead", 0)]
</source>
</source>

Revision as of 23:22, 21 December 2008

Function setState

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)]