setHasSight: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 9: Line 9:
<source lang="mtmacro" line>
<source lang="mtmacro" line>
setHasSight(state)
setHasSight(state)
setHasSight(state, id)
setHasSight(state, id, mapname)
</source>
</source>


'''Parameters'''
'''Parameters'''
{{param|state|Boolean - true to enable sight, false to disable }}
{{param|state|Boolean - true to enable sight, false to disable }}
{{param|id|The {{code|id}} of the token to set the sight of.  Defaults to the [[Current Token]]. {{TrustedParameter}} }}
{{param|mapname|The name of the map to find the token.  Defaults to the current map.}}


|example=
|example=
Line 20: Line 25:
</source>
</source>
Returns: Empty String.
Returns: Empty String.
|changes=
{{change|1.5.4|Added {{code|id}} and {{code|mapname}} parameter options.}}


}}
}}
[[Category:Sight Function]]
[[Category:Sight Function]]

Revision as of 08:28, 18 August 2019

setHasSight() Function

Introduced in version 1.3b48
Enables/disables sight for the Current Token. If the argument is 0 (false) sight will be disabled on the Current Token. If it is non-zero (true) sight is enabled.

Usage

setHasSight(state)
setHasSight(state, id)
setHasSight(state, id, mapname)

Parameters

  • state - Boolean - true to enable sight, false to disable
  • id - The id of the token to set the sight of. Defaults to the Current Token.

     Note: This parameter can only be used in a Trusted Macro

  • mapname - The name of the map to find the token. Defaults to the current map.

Example

Enables sight for Current Token
[h: setHasSight(1)]
Returns: Empty String.


Version Changes

  • 1.5.4 - Added id and mapname parameter options.