FEATURE: onTokenFacing

Developer discussion regarding MapTool 1.4

Moderators: dorpond, trevor, Azhrei

Forum rules
Posting now open to all registered forum users.
Post Reply
User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

FEATURE: onTokenFacing

Post by wolph42 »

similar to onTokenMove. A macro that is triggered as soon as the facing of a token changes. It would also require its 'onMultipleTokenFacing' variant similar to onMultipleTokenMove.

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

Re: FEATURE: onTokenFacing

Post by JamzTheMan »

wolph42 wrote:similar to onTokenMove. A macro that is triggered as soon as the facing of a token changes. It would also require its 'onMultipleTokenFacing' variant similar to onMultipleTokenMove.
Would this require a delay? I only worry that if you meta+mousewheel and spin, it could fire off 30, 60, 100 times rapidly for each 1 degree change?

Or at least a caveat as large macro calls could cause long delays?
-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: FEATURE: onTokenFacing

Post by wolph42 »

JamzTheMan wrote:
wolph42 wrote:similar to onTokenMove. A macro that is triggered as soon as the facing of a token changes. It would also require its 'onMultipleTokenFacing' variant similar to onMultipleTokenMove.
Would this require a delay? I only worry that if you meta+mousewheel and spin, it could fire off 30, 60, 100 times rapidly for each 1 degree change?

Or at least a caveat as large macro calls could cause long delays?
if there was a mouse click event handler you could use 'mouse button release' event as trigger. but IRC theres also the possibility to rotate a token without the mouse... perhaps a delay would be in order then. Although i never use that method.

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

Re: FEATURE: onTokenFacing

Post by JamzTheMan »

The problem is, MouseWheel is a different event. It's like a scroll. There really isn't a mousePress and MouseRelease event.
-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: FEATURE: onTokenFacing

Post by wolph42 »

JamzTheMan wrote:The problem is, MouseWheel is a different event. It's like a scroll. There really isn't a mousePress and MouseRelease event.
ah right ofcourse. hmm... ok another try: onMouseOff event. That is when you move your mouse away from the token. In case of mouseless interaction i would guess it triggers when the token is deselected.

...maybe it should just trigger onDeselectToken(s)... god this is complicated, if you select three tokens, rotate them and then select one of the three (so deselecting the other), what happens then? So maybe on ANY select/deselect event the event triggers?

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

Re: FEATURE: onTokenFacing

Post by JamzTheMan »

Ya, it's one of those funny ones. Simple in idea, lots of gotchas on implementation. I thought of a delay like how ToolTips work, they only fire after x seconds onHover. But firing onTokenChange after x ms after the last change detected could cause events to fire out of order.
-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: FEATURE: onTokenFacing

Post by wolph42 »

JamzTheMan wrote:Ya, it's one of those funny ones. Simple in idea, lots of gotchas on implementation. I thought of a delay like how ToolTips work, they only fire after x seconds onHover. But firing onTokenChange after x ms after the last change detected could cause events to fire out of order.
indeed. so i guess (if possible) to use the onAnyTokenSelectionChange event to trigger a macro after rotating a selection of tokens.

by the way. how does that work with cone lighting and FoW. does the FoW clear while rotating the cone of light, or just after you stop rotating or does it not clear at all only after you 'wiggle' your token?

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

Re: FEATURE: onTokenFacing

Post by JamzTheMan »

I'd have to check but I'm pretty sure it clears as you rotate, I know the light moves as you rotate (had some fun with flashlights once).

And I'm not saying we CAN'T do it on mousewheelchange, it may just fire off a lot of events. Depending on what you are doing it may be acceptable. There are other things that can get you in just as much trouble if coded badly or irresponsibly.
-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: FEATURE: onTokenFacing

Post by wolph42 »

JamzTheMan wrote:I'd have to check but I'm pretty sure it clears as you rotate, I know the light moves as you rotate (had some fun with flashlights once).
I know about the light, I was wondering about the fow. but let me elaborate: IF fow clears as you rotate then I *think* you want at least the option to have the macro run also on every rotation step (really tricky I know) for the simple fact that if you *look* at something you fire off the event. Then again having it firing off every step (don't know how many steps 360 is?) may screw things up really badly.
Maybe we need some test cases to see what is required.

for now i would stay with the onAnyTokenSelectionChange event.

Post Reply

Return to “MapTool 1.4”