Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).
So I've used these in the past and I'm trying to set up an encounter where the rooms will move around.
But even the simplest call to these methods is producing an error. Got the macro down to its simplest possible form (its on a library token) but when I call it, it just throws an unhelpful error.
So on the basis of another post, I clicked off "General Debugging" and "Macro Handling" in the advanced tab before launching map tool. Went to where the VBL macro isn't working and ran it, got the error.
But when I looked at the log.txt file in the .maptool, there is nothing in the file. I ran some other macros that work properly, no problem...but nothing gets added to the log.txt file.
Is there something else I need to check off/enable to be able to look for the actual error in the log file?
Usually when there is an issue like this for me, it's a JSON thing. IIRC I believe you are just setting a "string" that is formatted like a JSON. Try using the JSON functions to actually create a JSON array/object and pass that instead.
Try this code from the wiki, and I believe the key is the final json.append creates a proper JSON array.
Note: You can probably use other notations, but I believe your core issue is the parameter is "A JSON Array of JSON objects, one of the latter for each VBL shape." You are only creating an Object. Just put your OBJ of 1 into an JSON Array and it should work.
However, I was able to get logging working and it showed this...
2016-02-01 15:09:33,731 [client.MapToolLineParser:1301] DEBUG - "VBL@Lib:PC_CombatMacros"
2016-02-01 15:09:33,732 [client.MapToolLineParser:1301] DEBUG - ""
2016-02-01 15:09:33,733 [client.MapToolLineParser:1301] DEBUG - rectangle = "{'shape':'rectangle','x':50,'y':50,'w':100,'h':200,'r':45,'fill':1,'thickness':1,'scale':0}"
2016-02-01 15:09:33,734 [client.MapToolLineParser:1301] DEBUG - cross = "{'shape':'cross','x':-50,'y':-50,'w':50,'h':100,'r':30,'fill':1,'thickness':1,'scale':2}"
2016-02-01 15:09:33,735 [client.MapToolLineParser:1301] DEBUG - circle = "{'shape':'circle', 'X':50, 'Y':100, 'radius':200, 'thickness':3, 'fill':0, 'sides':12,'r':45}"
2016-02-01 15:09:33,736 [client.MapToolLineParser:1301] DEBUG - polygon = "{'shape':'polygon','r':0,'close':1,'thickness':10,'points':[{'x':0,'y':0},{'x':200,'y':200},{'x':150,'y':10}]}"
2016-02-01 15:09:33,737 [client.MapToolLineParser:1301] DEBUG - objectArrary = json.append('',rectangle, cross, circle, polygon)
2016-02-01 15:09:33,739 [client.MapToolLineParser:1301] DEBUG - drawVBL(objectArrary)
2016-02-01 15:09:33,741 [client.MapToolLineParser:1316] DEBUG - net.rptools.parser.ParserException: You do not have permission to call the "drawVBL" function.
2016-02-01 15:09:33,742 [client.MapToolLineParser:1264] INFO - [h:rectangle = "{'shape':'rectangle','x':50,'y':50,'w':100,'h':200,'r':45,'fill':1,'thickness':1,'scale':0}"]
[h:cross = "{'shape':'cross','x':-50,'y':-50,'w':50,'h':100,'r':30,'fill':1,'thickness':1,'scale':2}"]
[h:circle = "{'shape':'circle', 'X':50, 'Y':100, 'radius':200, 'thickness':3, 'fill':0, 'sides':12,'r':45}"]
[h:polygon = "{'shape':'polygon','r':0,'close':1,'thickness':10,'points':[{'x':0,'y':0},{'x':200,'y':200},{'x':150,'y':10}]}"]
[h:objectArrary = json.append('',rectangle, cross, circle, polygon)]
[h:drawVBL(objectArrary)]
net.rptools.parser.ParserException: You do not have permission to call the "drawVBL" function.
Why would it say I don't have permission to call the drawVBL function? its in a library token "Lib:PC_CombatMacros"...shouldn't any library token be able to call this?
I have it on a library token "Lib:HellsHold"...the other macros on that library token have been working fine.
"with player editable turned off on macro"...where would I see this setting on the macro? The only checkbox checked off on that macro is the "Auto Execute" one. Am I missing something else?
So closest thing I found to "player editable" was under Preferences/Application, "Allow players to edit macros". I turned that off (don't know why it was checked on), closed maptool, re-opened it...and I get the same error, logs still show, "You do not have permission to call the erase/draw VBL function".
Okay, think I got it (not sure I totally understand it but it works). The calling token was on the Background layer. Once I moved it to the Token layer, then it worked without issue.