[patch] VBL Macro Functions
Moderators: dorpond, trevor, Azhrei
- JamzTheMan
- Great Wyrm
- Posts: 1872
- Joined: Mon May 10, 2010 12:59 pm
- Location: Chicagoland
- Contact:
[patch] VBL Macro Functions
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.
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 117 times
-
- patch - VBL Macro Functions.txt
- Edited patch per Wolf's comments.
- (27.3 KiB) Downloaded 124 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
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork
Re: [patch] VBL Macro Functions
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()
- 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()
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
- JamzTheMan
- Great Wyrm
- Posts: 1872
- Joined: Mon May 10, 2010 12:59 pm
- Location: Chicagoland
- Contact:
Re: [patch] VBL Macro Functions
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
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork
Re: [patch] VBL Macro Functions
Well considering the fact that I'm a female-canine-in-heat when it concerns documentation, it's the *only* comment I had...
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: [patch] VBL Macro Functions
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!
- JamzTheMan
- Great Wyrm
- Posts: 1872
- Joined: Mon May 10, 2010 12:59 pm
- Location: Chicagoland
- Contact:
Re: [patch] VBL Macro Functions
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
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork
Re: [patch] VBL Macro Functions
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?
- JamzTheMan
- Great Wyrm
- Posts: 1872
- Joined: Mon May 10, 2010 12:59 pm
- Location: Chicagoland
- Contact:
Re: [patch] VBL Macro Functions
I do, I was waiting on an ok from the original requester, ie the end user, to testAzhrei 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 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
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork
- JamzTheMan
- Great Wyrm
- Posts: 1872
- Joined: Mon May 10, 2010 12:59 pm
- Location: Chicagoland
- Contact:
Re: [patch] VBL Macro Functions
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.
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
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork
Re: [patch] VBL Macro Functions
bungus! I did promise that and it completely slipped my mind. My sincerest apologies.JamzTheMan wrote:I do, I was waiting on an ok from the original requester, ie the end user, to testAzhrei 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 will see if i can get an updated patch posted tonight.
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) ]
Spoiler
So I did the same test but then with a 'cross' shape and came up with:
Spoiler
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) ]
Spoiler
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) ]
edit: updated the test code, to always erase at run and then plot the VBL (much simpler)
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
- JamzTheMan
- Great Wyrm
- Posts: 1872
- Joined: Mon May 10, 2010 12:59 pm
- Location: Chicagoland
- Contact:
Re: [patch] VBL Macro Functions
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.
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
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork
Re: [patch] VBL Macro Functions
thanks. btw, I used the bag of tricks campaign file as test environment. The test macros are there as well.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.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
- JamzTheMan
- Great Wyrm
- Posts: 1872
- Joined: Mon May 10, 2010 12:59 pm
- Location: Chicagoland
- Contact:
Re: [patch] VBL Macro Functions
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.
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
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork