setState: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Added version, cleaned up formatting.)
Line 1: Line 1:
{{stub}}
{{MacroFunction
{{MacroFunction
|name=setState
|name=setState
|version=1.3b40
|description=
|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.
Line 6: Line 8:
|usage=
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: setState(name, value)]
setState(state, value)
</source>
</source>
'''Parameters'''
* {{code|state}} - The name of the state to set on the current token.
* {{code|value}} - The value of the state to set, {{code|true}}({{code|1}}) or {{code|false}}({{code|0}}).


|examples=
|examples=

Revision as of 09:52, 10 March 2009

 This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.

setState() Function

Introduced in version 1.3b40
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

setState(state, value)

Parameters

  • state - The name of the state to set on the current token.
  • value - The value of the state to set, true(1) or false(0).

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