setLight: Difference between revisions
Jump to navigation
Jump to search
Verisimilar (talk | contribs) m (Macros:Functions:setLight moved to setLight) |
No edit summary |
||
(8 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
{{MacroFunction | {{MacroFunction | ||
|name=setLight | |name=setLight | ||
|description | |version=1.3b48 | ||
Sets the [[ | |description= | ||
Sets the [[Introduction to Lights and Sights|light source]]s of the [[Current Token|Current Token]]. If the value is {{false}} then the [[Introduction to Lights and Sights|light source]] is turned off; otherwise, it is turned on. | |||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
setLight(type, name, value) | |||
</ | setLight(type, name, value, id) | ||
setLight(type, name, value, id, mapRef) | |||
</syntaxhighlight> | |||
'''Parameters''' | |||
{{param|type|The light source type, (e.g. "Generic", "D20").}} | |||
{{param|name|The name of the [[Introduction to Lights and Sights|light source]].}} | |||
{{param|value|If {{true}} sets the light on, if {{false}} turns it off.}} | |||
{{param|id|The token {{code|id}} of the token to change the light sources, defaults to the [[Current Token]]. {{TrustedParameter}} }} | |||
{{param|mapRef|The Name or ID of the map to find the token. Defaults to the current map.}} | |||
|example= | |example= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[h: setLight("D20", "Candle - 5", 1)] | [h: setLight("D20", "Candle - 5", 1)] | ||
</ | </syntaxhighlight> | ||
|changes= | |||
{{change|1.5.4|Added {{code|id}} and {{code|mapname}} parameter options.}} | |||
}} | }} | ||
[[Category:Light Function]] | [[Category:Light Function]] | ||
[[Category:Token Function]] |
Latest revision as of 23:59, 22 August 2023
setLight() Function
• Introduced in version 1.3b48
Sets the light sources of the Current Token. If the value is
false
(0
) then the light source is turned off; otherwise, it is turned on.Usage
setLight(type, name, value)
setLight(type, name, value, id)
setLight(type, name, value, id, mapRef)
Parameters
type
- The light source type, (e.g. "Generic", "D20").name
- The name of the light source.value
- Iftrue
(1
) sets the light on, iffalse
(0
) turns it off.id
- The tokenid
of the token to change the light sources, 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
[h: setLight("D20", "Candle - 5", 1)]
Version Changes
- 1.5.4 - Added
id
andmapname
parameter options.