BUGFIX: Cone Light Aura when grid size 1 (32.3)

Developer discussion regarding MapTool 1.4

Moderators: dorpond, trevor, Azhrei

Forum rules
Posting now open to all registered forum users.
User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

BUGFIX: Cone Light Aura when grid size 1 (32.3)

Post by Jagged »

From this discussion thread.

This issue has been fixed in the SightType class but the bug still exists in the Light class. Since these two classes have a large section of duplicated code to produce Square, Circle and Cone areas my intention is to refactor these into functions of the Grid class from which all grid types inherit.

Then any future bug fixes or changes in this area will only need to be applied in one place.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: BUGFIX: Cone Light Aura when grid size 1 (32.3)

Post by Jagged »

meleeAura.jpg
meleeAura.jpg (115.12 KiB) Viewed 3714 times
Okay, that didn't take long. As I said, the bug seems to be fixed in SightType but not in Light. This is the Melee Reach aura on a Map with Units Per Cell set to 1.

I would appreciate it if other people could test this before I submit a pull request. I have used all the Sight, Light and Aura definitions I could find, but thats not that many. To test it you would need to pull my branch ConeLightFix. If you've not pulled other people's branches before, remember to check the branch out first, don't pull the branch into one of your existing branches.

cheers

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: BUGFIX: Cone Light Aura when grid size 1 (32.3)

Post by RPTroll »

Thank you!

I'll give it a try a little later today (I hope).
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: BUGFIX: Cone Light Aura when grid size 1 (32.3)

Post by Jagged »

Okay, trying to do some more testing. Looking in the code, Light seems to have a facing Offset, just like sight. However, for the life of me, I cannot set up a Light or Aura with an offset.

For Sight I would do something like:

Code: Select all

Hindsight: cone arc=180 offset=180 distance=17.5 
Anyone know how you format that for Light?

PS: seems odd that Sight and Light have different formats? :shock:

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: BUGFIX: Cone Light Aura when grid size 1 (32.3)

Post by aliasmask »

Heh, I was just mentioning this to the MOTE people. I think light, aura and sight should have the same formats. AFAIK, lights don't have an offset. Also, lights can have multiple sources/lights while aura only get 1.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: BUGFIX: Cone Light Aura when grid size 1 (32.3)

Post by Jagged »

The Light class has code for an offset, but I can't see a way of setting it in the Campaign Properties screen.

It would seem odd that you couldn't set an offset on light. How else are you going to have rear red lights and white headlights? :)

Also, is it possible to have a vision setting where you could see 30 foot forward by only 15 feet behind? Is it possible to merge two sight definitions into one line?

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

Re: BUGFIX: Cone Light Aura when grid size 1 (32.3)

Post by JamzTheMan »

Jagged wrote:The Light class has code for an offset, but I can't see a way of setting it in the Campaign Properties screen.

It would seem odd that you couldn't set an offset on light. How else are you going to have rear red lights and white headlights? :)

Also, is it possible to have a vision setting where you could see 30 foot forward by only 15 feet behind? Is it possible to merge two sight definitions into one line?
Hmm, it would be awesome if we could have this. I was going to look into it myself later. I wanted it for an "Darkness" effect. eg. take this image for instance:
Darkness
Radius 20-ft (Darkness).png
Radius 20-ft (Darkness).png (198.97 KiB) Viewed 3676 times
...

Like Web and other "Radius" templates, they need to center on a grid corner. So, you either need to turn snap to grid off, then place it manually, or like I did, I "offset" the image for the token so when it's SnappedToGrid, it perfectly aligns with the grid.

The problem is, I then add a "negative" light source to emulate the "Darkness" and it's off by half a cell. It would be nice to "center" the light with the "center" of the image, ie take into account it's "offsetx/y".

I couldn't think of another example, but the headlights example is a good one!
-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
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: BUGFIX: Cone Light Aura when grid size 1 (32.3)

Post by aliasmask »

JamzTheMan wrote:Like Web and other "Radius" templates, they need to center on a grid corner. So, you either need to turn snap to grid off, then place it manually, or like I did, I "offset" the image for the token so when it's SnappedToGrid, it perfectly aligns with the grid.
The snap is based on the footprint so if you change the size to large you can change back to freesize and it'll keep the large footprint thus making the center on the grid.

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

Re: BUGFIX: Cone Light Aura when grid size 1 (32.3)

Post by JamzTheMan »

not really, this is what I get...
Spoiler
templates.jpg
templates.jpg (389.77 KiB) Viewed 3672 times
-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
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: BUGFIX: Cone Light Aura when grid size 1 (32.3)

Post by aliasmask »

Here's what I mean. All of these are free size.
Attachments
template example.jpg
template example.jpg (93.39 KiB) Viewed 3669 times

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

Re: BUGFIX: Cone Light Aura when grid size 1 (32.3)

Post by JamzTheMan »

wait... what.... what holy hell magic is this???

Ok, that's freaky cool, never knew this. But WHY does this happen again?

PS prob still need offsets but thanks for fixing my issue :)
-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
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: BUGFIX: Cone Light Aura when grid size 1 (32.3)

Post by aliasmask »

It's all about the center of the token. If you have a 400x400 image it will be centered in the middle of the footprint. So, a medium footprint's center is in the middle of the square while a large token footprint's is at the grid crossing.

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

Re: BUGFIX: Cone Light Aura when grid size 1 (32.3)

Post by JamzTheMan »

So does the freesize not get a center?
-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: BUGFIX: Cone Light Aura when grid size 1 (32.3)

Post by wolph42 »

What am is saying is that in case of free size image, it "remembers" the footprint of the last set preset size(medium, large, huge,etc). And uses that to snap the picture.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: BUGFIX: Cone Light Aura when grid size 1 (32.3)

Post by Jagged »

Just for reference: In the case of Light and Sight, Offset should not be confused with grid offset and is a measurement in degrees away from the angle of facing and is only applicable to cones.
Last edited by Jagged on Fri May 08, 2015 8:12 am, edited 1 time in total.

Post Reply

Return to “MapTool 1.4”