p4535992 / foundryvtt-arms-reach

FoundryVTT Door little Utilities, Arms Reach for door
MIT License
3 stars 4 forks source link

Feature Request - Integration with Stairways #7

Closed Deuterazamus closed 3 years ago

Deuterazamus commented 3 years ago

Stairways is neat module that creates door-like items on the canvas in order to represent portals/gateways/stairs and so on. This are a few examples of the widgets it creates:

image image image

I'd really like to control the proximity activation of such widgets using FVTT-AR. Would it be possible to integrate the two modules?

Edit: I've had a brief interaction with Stairways's dev (SWW13) and he suggest this

Deuterazamus commented 3 years ago

I've been testing the new experimental integration without much success. After a quick debug I found the (possible) problem: the data available in the PreStairwayTeleport refers to the target stairway, not the one being clicked on. Let me grab a screenshot to explain the problem... image The image above refers to a player account controlling the token next to the "A qua" stairway that has clicked that stairway. As you can see the stairway that is passed in the data object is the far one, the target of the one being clicked. StairwaysReach then uses that data to compute the distance between the token and the stairway and of course complains about being too far and cancels the teleport.

p4535992 commented 3 years ago

Thanks for these feedbacks, I also noticed something similar, I would say that it is a problem with the "Stairsways" module since I use its Hook. I will try to investigate the problem.

Deuterazamus commented 3 years ago

Stairways 0.5.3 adds sourceData to the hook, but now it seems that the distance is not computed correclty. In my test map I have a 70px grid square, while debugging I replaced targetData with sourceData on the fly, landing in StairwayReach with the correct data, however but the result of getManhattanBetween returns 210 despite having the token right next to the stairway. This leads to isNotNearEnough being true

Deuterazamus commented 3 years ago

Tested working correctly using FVTT-AR 1.0.11 and Stairways 0.5.3! Thank you so much!

p4535992 commented 3 years ago

^^