[patch] VBL Macro Functions

Notes on testing the latest builds of MapTool

Moderators: dorpond, trevor, Azhrei

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

[patch] VBL Macro Functions

Post by JamzTheMan »

OK, here's the patch for my VBL macro functions. If accepted, let me know how you want it documented for who ever updates the Wiki?

Edit: Updated patch file.
Edit: Added version 3 of patch.
Attachments
Patch - VBL Macro Functions v3.txt
Corrected 1 pixel offset error.
(27.91 KiB) Downloaded 115 times
patch - VBL Macro Functions.txt
Edited patch per Wolf's comments.
(27.3 KiB) Downloaded 121 times
Last edited by JamzTheMan on Mon Mar 11, 2013 8:59 pm, edited 3 times in total.
-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

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: [patch] VBL Macro Functions

Post by wolph42 »

jamz, I had a look at your patch and noticed (for now) two things:

- In your first comment you do not declare all the new functions, just the first four (of the 7 you created).
- you have created a function: isSnapToGrid but that already exists in b87: Wiki: isSnapToGrid()

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

Re: [patch] VBL Macro Functions

Post by JamzTheMan »

wolph42 wrote:jamz, I had a look at your patch and noticed (for now) two things:

- In your first comment you do not declare all the new functions, just the first four (of the 7 you created).
- you have created a function: isSnapToGrid but that already exists in b87: Wiki: isSnapToGrid()

Calling me out on my Code comments eh? :)

Ok, fixed and removed the isSnapToGrid function. The patch was created before someone advised it already existed.
-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

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: [patch] VBL Macro Functions

Post by wolph42 »

Well considering the fact that I'm a female-canine-in-heat when it concerns documentation, it's the *only* comment I had...

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [patch] VBL Macro Functions

Post by Azhrei »

Just an update. I've grabbed a copy of the code and will be looking at it while I do my J7 testing in the next few days... Thanks, JTM! :)

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

Re: [patch] VBL Macro Functions

Post by JamzTheMan »

Azhrei wrote:Just an update. I've grabbed a copy of the code and will be looking at it while I do my J7 testing in the next few days... Thanks, JTM! :)

Cool, I'm off the next few days as well so if you have any questions, let me know.

Note, I DO have some updates to the patch, but nothing major, just some simple changes to x/y coordinates math to align with Wolf's request. Core structure remains the same.
-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

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [patch] VBL Macro Functions

Post by Azhrei »

You mentioned here on Feb 27 that you were going to update the patch, but the attachment in the OP hasn't been updated since Feb 21. Do you have an update to make?

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

Re: [patch] VBL Macro Functions

Post by JamzTheMan »

Azhrei wrote:You mentioned here on Feb 27 that you were going to update the patch, but the attachment in the OP hasn't been updated since Feb 21. Do you have an update to make?
I do, I was waiting on an ok from the original requester, ie the end user, to test :)

I will see if i can get an updated patch posted tonight.
-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

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

Re: [patch] VBL Macro Functions

Post by JamzTheMan »

Az, I added the latest Patch as v2. This patch is based off the trunk now (although it should make no difference in this case).

Consider it final bearing any bug fixes.
-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

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: [patch] VBL Macro Functions

Post by wolph42 »

JamzTheMan wrote:
Azhrei wrote:You mentioned here on Feb 27 that you were going to update the patch, but the attachment in the OP hasn't been updated since Feb 21. Do you have an update to make?
I do, I was waiting on an ok from the original requester, ie the end user, to test :)

I will see if i can get an updated patch posted tonight.
bungus! I did promise that and it completely slipped my mind. My sincerest apologies.
Ok I did some testing, first the doors in my campaign: still work perfectly.
Then some testing on a map and... probly an issue but not sure, this code:

Code: Select all

[ShapesJSON = json.set("{}","shape","rectangle", "x", 50, "y", 100, "w", 100, "h", 100, "r", 0, "fill", 0, "thickness", 10, "scale", 0)]
[r: drawVBL(ShapesJSON) ] 
produces this VBL:
Spoiler
Untitled picture.png
Untitled picture.png (43.07 KiB) Viewed 7261 times
it seems that there is an -1 pixel offset in the VBL rectangle.

So I did the same test but then with a 'cross' shape and came up with:
Spoiler
Untitled picture1.png
Untitled picture1.png (48.97 KiB) Viewed 7261 times
where I do NOT see the -1 offset. So I think there is an issue with the rectangle.

Finally I did a test with a cut out:

Code: Select all

[ShapesJSON = json.set("{}","shape","rectangle", "x",50, "y", 100, "w", 100, "h", 100, "r", 0, "fill", 0, "thickness", 10, "scale", 0)]
[drawVBL(ShapesJSON) ]

[ShapesJSON = json.set("{}","shape","rectangle", "x", 52, "y", 102, "w", 98, "h", 98, "r", 0, "fill", 0, "thickness", 10, "scale", 0)]
[eraseVBL(ShapesJSON) ] 
which resulted in this
Spoiler
Untitled picture2.png
Untitled picture2.png (46.25 KiB) Viewed 7261 times
im not sure what to make of that, but I *think* that should not happen.


edit:
here the test macro code

Code: Select all

[h:eraseVBL(json.set("{}","shape","rectangle", "x", -1000, "y", -1000, "w", 10000, "h", 10000, "r", 0, "fill", 1, "thickness", 10, "scale", 0)) ]

[ShapesJSON1 = json.set("{}","shape","rectangle", "x", 50, "y", 100, "w", 100, "h", 100, "r", 0, "fill", 0, "thickness", 10, "scale", 0)]
[r: drawVBL(ShapesJSON1) ]

[ShapesJSON2 = json.set("{}","shape","rectangle", "x",200, "y", 100, "w", 100, "h", 100, "r", 0, "fill", 0, "thickness", 10, "scale", 0)]
[drawVBL(ShapesJSON2) ]

[ShapesJSON3 = json.set("{}","shape","rectangle", "x", 202, "y", 102, "w", 98, "h", 98, "r", 0, "fill", 0, "thickness", 10, "scale", 0)]
[eraseVBL(ShapesJSON3) ]

[ShapesJSON4 = json.set("{}","shape","cross", "x", 350, "y", 100, "w", 100, "h", 100, "r", 0, "fill", 0, "thickness", 10, "scale", 0)]
[r: drawVBL(ShapesJSON4) ]

 
you can copy paste that anywhere and run it.

edit: updated the test code, to always erase at run and then plot the VBL (much simpler)

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

Re: [patch] VBL Macro Functions

Post by JamzTheMan »

No problem, thanks for the tests. It's weird given i did several tests a well and never add the 1 pixel off (after fixing).

I'll give your macros a go tonight and see what I get.
-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

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: [patch] VBL Macro Functions

Post by wolph42 »

JamzTheMan wrote:No problem, thanks for the tests. It's weird given i did several tests a well and never add the 1 pixel off (after fixing).

I'll give your macros a go tonight and see what I get.
thanks. btw, I used the bag of tricks campaign file as test environment. The test macros are there as well.

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

Re: [patch] VBL Macro Functions

Post by JamzTheMan »

OK, that was an easy (read dumb error) fix.

My test macro was set with an x/y of 1/1 vs 0/0 and of course copied that macro several times. Explains a few things lol, must have been a late night. But that's why we have external testers, unit tests only take you so far, thanks Wolf!

v2 removed, uploaded v3 of the patch.
-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

Post Reply

Return to “Testing”