FEATURE: onTokenFacing
Moderators: dorpond, trevor, Azhrei
Forum rules
Posting now open to all registered forum users.
Posting now open to all registered forum users.
FEATURE: onTokenFacing
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.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
- JamzTheMan
- Great Wyrm
- Posts: 1872
- Joined: Mon May 10, 2010 12:59 pm
- Location: Chicagoland
- Contact:
Re: FEATURE: onTokenFacing
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?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.
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
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork
Re: FEATURE: onTokenFacing
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.JamzTheMan wrote: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?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.
Or at least a caveat as large macro calls could cause long delays?
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
- JamzTheMan
- Great Wyrm
- Posts: 1872
- Joined: Mon May 10, 2010 12:59 pm
- Location: Chicagoland
- Contact:
Re: FEATURE: onTokenFacing
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
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork
Re: FEATURE: onTokenFacing
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.JamzTheMan wrote:The problem is, MouseWheel is a different event. It's like a scroll. There really isn't a mousePress and MouseRelease event.
...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?
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
- JamzTheMan
- Great Wyrm
- Posts: 1872
- Joined: Mon May 10, 2010 12:59 pm
- Location: Chicagoland
- Contact:
Re: FEATURE: onTokenFacing
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
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork
Re: FEATURE: onTokenFacing
indeed. so i guess (if possible) to use the onAnyTokenSelectionChange event to trigger a macro after rotating a selection of tokens.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.
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?
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
- JamzTheMan
- Great Wyrm
- Posts: 1872
- Joined: Mon May 10, 2010 12:59 pm
- Location: Chicagoland
- Contact:
Re: FEATURE: onTokenFacing
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.
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
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork
Re: FEATURE: onTokenFacing
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.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).
Maybe we need some test cases to see what is required.
for now i would stay with the onAnyTokenSelectionChange event.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS