exposeFOW: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page exposeFOW to ExposeFOW without leaving a redirect: Converting page title to first-letter uppercase)
m (Text replacement - "<source" to "<syntaxhighlight")
 
(3 intermediate revisions by 2 users not shown)
Line 4: Line 4:
|trusted=true
|trusted=true
| description=
| description=
Clears the Fog of War (FOW) for all '''selected''' tokens on the current map according to their sight settings. An optional {{code|mapName}} parameter allows exposure on maps other than the current map.  ''Note that unless the optional {{code|tokens}} parameter is provided there must be tokens selected on the map.''
Clears the Fog of War (FOW) for all '''selected''' tokens on the current map according to their sight settings. An optional {{code|mapRef}} parameter allows exposure on maps other than the current map.  ''Note that unless the optional {{code|tokens}} parameter is provided there must be tokens selected on the map.''


| usage=
| usage=
<source lang="mtmacro">
<syntaxhighlight lang="mtmacro">
exposeFOW()
exposeFOW()
exposeFOW(mapname)
exposeFOW(mapRef)
exposeFOW(mapName,tokens)
exposeFOW(mapRef,tokens)
exposeFOW(mapName,tokens, delim)
exposeFOW(mapRef,tokens, delim)
</source>
</syntaxhighlight>
'''Parameters'''
'''Parameters'''
{{param|mapname|Optional map name.}}
{{param|mapRef|Optional.  Name or ID of the map.}}
{{param|tokens|Optional delimited string list or JSON array of tokens.}}
{{param|tokens|Optional delimited string list or JSON array of tokens.}}
{{param|delim|Delimiter for tokens parameter.  Defaults to ",".  Use "json" for a JSON array.}}
{{param|delim|Delimiter for tokens parameter.  Defaults to ",".  Use "json" for a JSON array.}}


| example=
| example=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
<!-- Expose FoW for selected tokens on current map. -->
<!-- Expose FoW for selected tokens on current map. -->
[h: exposeFOW()]
[h: exposeFOW()]
Line 30: Line 30:
<!-- Expose FoW for indicated tokens in a JSON array on the named map. -->
<!-- Expose FoW for indicated tokens in a JSON array on the named map. -->
[h: exposeFOW("Pit of Despair",'["Westley", "Count Rugen"]', "json")]
[h: exposeFOW("Pit of Despair",'["Westley", "Count Rugen"]', "json")]
</source>
</syntaxhighlight>
| changes=
| changes=
* '''1.5.4''' - Added tokens and delim parameters.
* '''1.5.4''' - Added tokens and delim parameters.

Latest revision as of 23:59, 14 March 2023

exposeFOW() Function

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

Introduced in version 1.3b76
Clears the Fog of War (FOW) for all selected tokens on the current map according to their sight settings. An optional mapRef parameter allows exposure on maps other than the current map. Note that unless the optional tokens parameter is provided there must be tokens selected on the map.

Usage

exposeFOW()
exposeFOW(mapRef)
exposeFOW(mapRef,tokens)
exposeFOW(mapRef,tokens, delim)

Parameters

  • mapRef - Optional. Name or ID of the map.
  • tokens - Optional delimited string list or JSON array of tokens.
  • delim - Delimiter for tokens parameter. Defaults to ",". Use "json" for a JSON array.

Example

<!-- Expose FoW for selected tokens on current map. -->
[h: exposeFOW()]
<!-- Expose FoW for selected tokens on the named map. -->
[h: exposeFOW("Pit of Despair")]
<!-- Expose FoW for indicated tokens on the named map. -->
[h: exposeFOW("Pit of Despair", "Westley, Count Rugen")]
<!-- Expose FoW for indicated tokens, in a list delimited by a colon (":"), on the named map. -->
[h: exposeFOW("Pit of Despair", "Westley:Count Rugen", ":")])]
<!-- Expose FoW for indicated tokens in a JSON array on the named map. -->
[h: exposeFOW("Pit of Despair",'["Westley", "Count Rugen"]', "json")]


Version Changes

  • 1.5.4 - Added tokens and delim parameters.