getState: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
m (Updated with recent version changes.)
Line 1: Line 1:
{{stub}}
{{stub|Examples using current functionality.}}
{{MacroFunction
{{MacroFunction
|name=getState
|name=getState
|version=1.3b40
|version=1.3b40
|description=
|description=
Returns 1 if the specified [[Token:state|Token State]] is set on the [[Token:Current Token|Current Token]] otherwise it returns 0.
Checks if the specified [[State]] is set on a token, return {{true}} or {{false}}.


|usage=
|usage=
Line 10: Line 10:
getState(state)
getState(state)
</source>
</source>
'''Parameter'''
<source lang="mtmacro" line>
* {{code|state}} - The name of the state to check for on the current token.
getState(state, id)
</source>
'''Parameters'''
{{param|state|The name of the state to check for.}}
{{param|id|The token {{code|id}} of the token to check for the state, defaults to the [[Current Token]].}}


|example=
|example=
Line 17: Line 21:
[if(getState("Dead"), "You are dead!", "You are not dead (yet!)")]
[if(getState("Dead"), "You are dead!", "You are not dead (yet!)")]
</source>
</source>
|also=
[[State]],
[[setState|setState()]]
|changes=
{{change|1.3b51|Added {{code|id}} parameter option.}}


}}
}}
[[Category:State Function]]
[[Category:State Function]]
[[Category:Token Function]]
[[Category:Token Function]]

Revision as of 01:05, 31 March 2009

 This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.
 This article needs: Examples using current functionality.

getState() Function

Introduced in version 1.3b40
Checks if the specified State is set on a token, return true(1) or false(0).

Usage

getState(state)
getState(state, id)

Parameters

  • state - The name of the state to check for.
  • id - The token id of the token to check for the state, defaults to the Current Token.

Example

[if(getState("Dead"), "You are dead!", "You are not dead (yet!)")]

See Also

Version Changes

  • 1.3b51 - Added id parameter option.