Comments (6)
Add third parameter to the call that holds a return value object:
const result = { distance: 0 };
Hooks.call('ReplaceArmsReachInteraction', doorData, result);
// and then do something with `result.distance`
And then you'd hook into it something like:
Hooks.on('ReplaceArmsReachInteraction', (doorData, result) => result.distance = 5);
from foundryvtt-arms-reach.
Hi, ty for the feedback.
Forgive me I don't know anything about Pathfinder, could you try to better describe which feature you would like to be integrated?
Would you like to have the possibility to set the distance instead of in grid of squares in units of measure such as "ft" or "mt"?
I always try to make this module as independent as possible from the system used, and eventually I add additional settings to manage the use cases of the various game systems.
from foundryvtt-arms-reach.
More of an ability to override the distance calculation, with a hook or something.
But if you want to implement it directly: It's essentially using actor.data.data.range.melee
for checking the appropriate distance at which to allow opening things, preferably with minimum distance of 1 grid cell (Math.max(5, actor.data.data.range.melee)
pretty much). That variable stores its distance in feet as is normal for the system.
It doesn't need to be exact distance, but simply using that variable for determining it.
Tho I still think it's better to just provide a hook for it that a module or even the game system could fill independently (so any system could have their custom thing fairly trivially), since this would probably not work for people who use the alternative metric system.
But speaking of it, option of ignoring cell distance would be nice for people who play gridless regardless of system (which is also a by rules option for PF1).
Sorry if this doesn't clear it up sufficiently.
from foundryvtt-arms-reach.
Hei mkahvl, i'm trying to integrate a hook for "replace" my standard calculation distance, but i encounter some issue on the developing..... here the code i have in mind:
const resultExplicitComputeDistance = Hooks.call('ReplaceArmsReachInteraction', doorData);
// undefined|null|Nan go with the standard compute distance
if(resultExplicitComputeDistance && typeof(resultExplicitComputeDistance) == 'number'){
// 0 : Custom compute distance fail
if (<number>resultExplicitComputeDistance === 0) {
isNotNearEnough = false;
}
// 1 : Custom compute success
else if (<number>resultExplicitComputeDistance === 1) {
isNotNearEnough = true;
}
// 2 : If Custom compute distance fail fallback to the standard compute distance
else if (<number>resultExplicitComputeDistance === 2) {
// Conntinue
}
// x < 0 || x > 2 just fail
else{
isNotNearEnough = false;
}
}
but with the Hooks.call
i retireve only a boolean did you know if there is a way to return a number like in this case ?
from foundryvtt-arms-reach.
Add some hook for try to solve this issue
from foundryvtt-arms-reach.
This issue is solved with version 2.0.0 . Now you can customize the module drag-ruler , here the details on the api and the calculation distance is the same i used for door and stairways.
P.S. you can finally add the range arm based on the value on the single actor/token
from foundryvtt-arms-reach.
Related Issues (20)
- German translation (de.json attached) HOT 2
- German translation extended for 2.2.5
- [BUG] Another V10 data-model-issue HOT 2
- Fixed some typos in my de-translation.
- [BUG] PF2e LootSheet Characters still able to be interacted with from distance HOT 1
- Extended German translation. HOT 1
- Manifest link for FVTT v.9 compatible version? HOT 3
- Disable all sounds HOT 1
- [BUG] Arms Reach disappears on latest version HOT 4
- [BUG] Foundry V11 getLocalPosition Exception HOT 1
- [BUG] "Double Tap to Open Door" and "Press E to Open Door" not working./
- [BUG] Headache conflict (module compatibility with MATT) HOT 5
- v11 compatibility HOT 6
- Additional compatible modules HOT 1
- change max reach to open a door based on the size of a token
- Feature request : Set the reach per type of interactible things HOT 1
- [BUG] Foundry v10 Door Sounds play simultaneously with v11 configured door sounds. HOT 7
- [BUG]No sounds at all when opening/closing doors HOT 5
- Localization missing for Reset menu HOT 1
- [BUG] Stairways don't adhere to arms reach global distance HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foundryvtt-arms-reach.