VBL, MBL, and VBL/MBL questions.
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
VBL, MBL, and VBL/MBL questions.
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."
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: Check for VBL type in a square.
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."
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: VBL, MBL, and VBL/MBL questions.
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.
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."
Re: VBL, MBL, and VBL/MBL questions.
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>
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: VBL, MBL, and VBL/MBL questions.
Thanks.Phergus wrote: ↑Sat Aug 22, 2020 11:48 amOnly 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>
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."
Re: VBL, MBL, and VBL/MBL questions.
It appears that Wiki: getVBL() doesn't detect MBL at all.
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: VBL, MBL, and VBL/MBL questions.
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."