VBL, MBL, and VBL/MBL questions.

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
User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

VBL, MBL, and VBL/MBL questions.

Post by Full Bleed »

Is there a way to look at a particular X,Y coordinate and check whether the VBL in it is actually VBL, MBL or VBL/MBL?
Last edited by Full Bleed on Sat Aug 22, 2020 6:14 am, edited 1 time in total.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

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

Re: Check for VBL type in a square.

Post by Full Bleed »

Is there a way to check the percentage of VBL in a particular X,Y grid coordinate?
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

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

Re: VBL, MBL, and VBL/MBL questions.

Post by Full Bleed »

Ok, going to try a (hopefully) easier question...

How do you look in a particular X,Y grid location and know whether or not there is VBL there? I was assuming that Wiki: getVBL() would do this, but I can't get it to work.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: VBL, MBL, and VBL/MBL questions.

Post by Phergus »

Only works for square grids but the basic idea.

Code: Select all

[h: res = input(
	"cx|0|X:|",
	"cy|0|Y:|"
	)]
[h: abort(res)]
[h: w = json.get(json.get(getInfo("map"),"grid"),"size")]
[h:rectangle = json.set("{'shape':'rectangle'}", "x", cx*w, "y", cy*w, "w", w,"h", w,"fill",1)]
[h:vblData   = getVBL(rectangle , 0)]
<pre>[r: json.indent(vblData)]</pre>

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

Re: VBL, MBL, and VBL/MBL questions.

Post by Full Bleed »

Phergus wrote:
Sat Aug 22, 2020 11:48 am
Only works for square grids but the basic idea.

Code: Select all

[h: res = input(
	"cx|0|X:|",
	"cy|0|Y:|"
	)]
[h: abort(res)]
[h: w = json.get(json.get(getInfo("map"),"grid"),"size")]
[h:rectangle = json.set("{'shape':'rectangle'}", "x", cx*w, "y", cy*w, "w", w,"h", w,"fill",1)]
[h:vblData   = getVBL(rectangle , 0)]
<pre>[r: json.indent(vblData)]</pre>
Thanks.

My problem was knowing to multiply the X,Y by the gridsize to generate a single pixel coordinate in square (upper let hand corner it looks like.) I have to do something similar when using isVisible to see if a token can see the center of a square (in that case I have to add half of the gridsize to the X,Y as well to grab the center to look at.) I'm pretty sure I tested using that number and it didn't work (but, who knows what else I might have done wrong.) For both isVisible and getVBL it's really not clear in the wiki that the X,Y coordinates they are asking for is *not* the X,Y that MT provides onscreen... and you have to find and use a pixel coordinate instead.

Looks like I'll create a function to check the return data in getVBL for info in the returned "points" field.

And some functions to pull pixel coordinates from corners and centers of X,Y as well. This has bitten me for the last time! ;)


Lastly, from what I can see, there is no way to tell what kind of VBL getVBL returns from the data (VBL, MBL, or VBL/MBL.) So I'll put in a separate feature request for that.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: VBL, MBL, and VBL/MBL questions.

Post by Phergus »

It appears that Wiki: getVBL() doesn't detect MBL at all.

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

Re: VBL, MBL, and VBL/MBL questions.

Post by Full Bleed »

Phergus wrote:
Sat Aug 22, 2020 4:38 pm
It appears that Wiki: getVBL() doesn't detect MBL at all.
I was just learning that... since it was applied/viewed with the same tools I'd, apparently, made a bad assumption. Which means MBL and VBL/MBL needs their own functions or maybe (per my freq) a more unified set of functions for "blocking" with a type parameter (Vision, Movement, and Vision/Movement).
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

Post Reply

Return to “Macros”