setHasSight: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: ==Function setHasSight== Sets if the Token:Current Token has Token:Sight or not. If the argument is 0 the Token:Current Token does not have Token:Sight if it is non zer...)
 
No edit summary
 
(10 intermediate revisions by 6 users not shown)
Line 1: Line 1:
==Function setHasSight==
{{MacroFunction
Sets if the [[Token:Current Token|Current Token]] has [[Token:Sight|Sight]] or not. If the argument is 0 the [[Token:Current Token|Current Token]] does not have [[Token:Sight|Sight]] if it is non zero then it does.
|name=setHasSight
|version=1.3b48
|trusted=false
|description=
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.


You can not set the [[Token:Sight|Sight]] of a [[Token:NPC|NPC]] [[Token:Token|Token]].
|usage=
<syntaxhighlight lang="mtmacro" line>
setHasSight(state)
setHasSight(state, id)
setHasSight(state, id, mapRef)
</syntaxhighlight>


===Usage===
'''Parameters'''
<source lang="mtmacro" line>
{{param|state|Boolean - true to enable sight, false to disable }}
[h: setHasSight(val)]
{{param|id|The {{code|id}} of the token to set the sight of.  Defaults to the [[Current Token]]. {{TrustedParameter}} }}
</source>
{{param|mapRef|The Name or ID of the map to find the token.  Defaults to the current map.}}
 
 
|example=
Enables sight for [[Current Token]]
<syntaxhighlight lang="mtmacro" line>
[h: setHasSight(1)]
</syntaxhighlight>
Returns: Empty String.
 
|changes=
{{change|1.5.4|Added {{code|id}} and {{code|mapname}} parameter options.}}
 
 
}}
[[Category:Sight Function]]

Latest revision as of 23:59, 14 March 2023

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, mapRef)

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

  • mapRef - The Name or ID 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.