RPTools/maptool

[Bug]: Light functions do not know the "Unique" light Type.

Closed this issue · 6 comments

Describe the Bug

setLight(), getLights(), and hasLightSource() can not access the "Unique" light Type.

To Reproduce

  1. Add a unique light to a token.
  2. Attempt to use functions with the type parameter set to "Unique".

Error message:

Unknown light type "Unique" in function [functionName]

Expected Behaviour

Light functions should have access to Unique as a type.

Screenshots

No response

MapTool Info

1.18.3

Desktop

Win11

Additional Context

getLights() and hasLightSource() can find unique lights on a token, but not by Type.

Use $token as the type.

Use $token as the type.

Getting errors with:

[r: setLight($token, "Lamp", 0)]

org.antlr.v4.runtime.misc.ParseCancellationException

[r: setLight("$token", "Lamp", 0)]

java.lang.IllegalArgumentException: Illegal group reference

Shouldn't dollar signs be escaped in MT script?

Shouldn't dollar signs be escaped in MT script?

I thought the same... tried using single and double / and still got errors.

I've tested out setLight() with an impersonated token and it seems to work fine.

Token has this light source:

Unique Candle - 5: circle 5 10#0000ff
Image

And the light can be turned on or off with:

[r: setLight("\$token", "Unique Candle - 5", true)]

or

[r: setLight("\$token", "Unique Candle - 5", false)]

Doh. I was escaping with a forward slash. :/