getLights: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Added version.)
mNo edit summary
Line 9: Line 9:
|usage=
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: lights = getLights()]
getLights()
[h: lights = getLights(type)]
</source>
[h: lights = getLights(type, delim)]
<source lang="mtmacro" line>
[h: lights = getLights("*", delim)]
getLights(type)
</source>
<source lang="mtmacro" line>
getLights(type, delim)
</source>
</source>
Where  
Where  

Revision as of 12:43, 10 March 2009

getLights() Function

Introduced in version 1.3b48
Returns a string list containing the names of the light sources that are on for the Current Token. The type of the value returned depends on the delimiter parameter.
  • If the delimiter is not specified then a string list is returned with the default value of ',' is used.
  • If the delimiter "json" then a json array is returned.
  • Otherwise a string list is returned with the delimiter passed in.

Usage

getLights()
getLights(type)
getLights(type, delim)

Where

  • type is the type of light source (e.g. "Generic" or "D20"). If it is not specified then all light sources that are on for the token are returned.
  • delim is the delimiter used to separate values in the string list. If it is not specified then it defaults to ","

If you want to specify the delimiter but still want to fetch all of the light source types then you can use the special value "*" for type.

Examples

To get a string list of all of the [LightSource:light source]]s that the current token has on.
[getLights()]

To get a string list of the [LightSource:light source]]s that the current token has on with the lighet source type of "Generic".

[getLights("Generic")]

Version Changes

  • 1.3b49 - Added "json" delimiter option.