issue with eraseVBL/drawVBL

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

issue with eraseVBL/drawVBL

Post by xavram »

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.

Code: Select all

[h:rectangle	= "{'shape':'rectangle','x':-100,'y':200,'w':300,'h':300,'fill':1,'thickness':1}"]
[h:drawVBL(rectangle)]
I mean, it doesn't get any simpler than that does it?

Using 1.3 b91, same as I've always used. Very strange.

xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

Re: issue with eraseVBL/drawVBL

Post by xavram »

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?

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: issue with eraseVBL/drawVBL

Post by JamzTheMan »

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.

[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)]


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.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

Re: issue with eraseVBL/drawVBL

Post by xavram »

Copied this exacty, still no dice.

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?

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: issue with eraseVBL/drawVBL

Post by aliasmask »

Wiki: drawVBL() is a trusted macro so needs to be on lib token with player editable turned off on macro.

xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

Re: issue with eraseVBL/drawVBL

Post by xavram »

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?

xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

Re: issue with eraseVBL/drawVBL

Post by xavram »

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".

Gaaah...

xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

Re: issue with eraseVBL/drawVBL

Post by xavram »

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.

Phew, losing my mind there...

Post Reply

Return to “Macros”