Mini Macro Challenges (Interest)

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

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Mini Macro Challenges (Interest)

Post by Full Bleed »

Full Bleed wrote:
Thu Aug 27, 2020 12:26 pm
Note2: After just looking at multiple VBL object grids, it looks like the first coordinate pair is used as a kind of "break" between additional shapes. So getting those shapes might not be that hard after all...
So, I went through the trouble of identifying multiple VBL objects in a single grid (which ended up being harder than I thought) and I just found out that hollow objects (square, circle, an custom hollow polyline objects) provide vbl data that *looks* like two shapes. And, unfortunately, I don't see a way to identify that the interior "hollow" shape is subtractive from the raw getVBL data while other separate shapes would be additive. That means that I either go with the original method that's more accurate with one contiguous shape (even with hollow spots) or one that's more accurate with multiple shapes (but is additive with hollow shapes.)

Sample Solid Rectangle:
Spoiler
[{
"generated": 1,
"shape": "polygon",
"fill": 1,
"close": 1,
"thickness": 0,
"points": [
{
"x": 6126,
"y": 5127
},
{
"x": 6126,
"y": 5176
},
{
"x": 6177,
"y": 5176
},
{
"x": 6177,
"y": 5127
},
{
"x": 6126,
"y": 5127
}
]
}]
All rectangles are 5 points (the starting coords appears twice.)

Sample Hollow Rectangle:
Spoiler
[{
"generated": 1,
"shape": "polygon",
"fill": 1,
"close": 1,
"thickness": 0,
"points": [
{
"x": 6281,
"y": 5129
},
{
"x": 6281,
"y": 5175
},
{
"x": 6232,
"y": 5175
},
{
"x": 6232,
"y": 5129
},
{
"x": 6281,
"y": 5129
},
{
"x": 6281,
"y": 5129
},
{
"x": 6230,
"y": 5127
},
{
"x": 6230,
"y": 5177
},
{
"x": 6283,
"y": 5177
},
{
"x": 6283,
"y": 5127
},
{
"x": 6230,
"y": 5127
}
]
}]
You can see how MT uses that first pair to indicate additional shapes in the vbl data. Near the middle of the list, where that first set repeats, you can see the beginning of the interior rectangle shape.

Despite wasting a bunch of time identifying multiple shapes in the data I'm probably going to get more accurate usage out of using what works with an expectation of a single contiguous shape in the grid since that's more likely for me.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
JoeDuncan
Giant
Posts: 118
Joined: Sun Nov 22, 2020 9:02 pm

Re: Mini Macro Challenges (Interest)

Post by JoeDuncan »

aliasmask wrote:
Thu Jul 09, 2020 2:21 pm
The methods to detect when tokens or other things that are moved over relies on the stamp or footprint, but registers which grid cell they're in. So, no real way to full eliminate the grid.
You could solve this with (*shameless plug*) my JUH libraries by starting an interval timer to check pixel positions of tokens vs pixel positions of hit boxes etc...
"Joe's Ugly Hacks - Get 'em while their hot! Guaranteed ugliest hacks around or your money back!"

Post Reply

Return to “Macros”