I am working on an add-on where I create a number of maps with a few tokens on during onFirstInit. This is working fine, except for one token.
I get this error:
00:28:06.190 DEBUG net.rptools.maptool.client.MapToolLineParser - screenTexture = "lib://" + ns + "/assets/images/bgtexture.png"
00:28:06.190 DEBUG net.rptools.maptool.client.MapToolLineParser - tokenId = createToken(
json.set("{}",
"name","Image:Texture",
"tokenImage", screenTexture,
"size","Native",
"layer", "Hidden"
)
)
00:28:06.192 DEBUG net.rptools.maptool.client.MapToolLineParser - net.rptools.parser.ParserException: Argument number 1 invalid argument type for function "copyToken".
00:28:06.192 ERROR net.rptools.maptool.client.swing.MapToolEventQueue - java.util.concurrent.CompletionException: net.rptools.parser.ParserException: Argument number 1 invalid argument type for function "copyToken".
java.util.concurrent.CompletionException: net.rptools.parser.ParserException: Argument number 1 invalid argument type for function "copyToken".
I have copied the code from another token which is created fine, and just edited a couple of values and then I get this.
The code for creating the token looks like this:
[h:screenTexture = "lib://" + ns + "/assets/images/bgtexture.png"]
[h:tokenId = createToken(
json.set("{}",
"name","Image:Texture",
"tokenImage", screenTexture,
"size","Native",
"layer", "Hidden"
)
)]
The exact same syntax is used several times successfully with other tokens, only different is the values of the json.
Any ideas on what I am missing here?
And would anyone with half an idea what they're doing (i.e. anyone but me) please improve the error message from createToken?! ๐