Beginners help with doors
Hi foks. Apologies if i've posted this in the wrong place. I am totally new to working with Foundry, although not new to working with Javascript. I want to write a macro that will allow me to open an adjacent door with a key press instead of the mouse. Does anyone know if this is possible?... and a few pointers into which object I need to interact with would be so helpful. Im guessing " canvas.walls.doors[0]" or something? I suppose I just need to change the door "state" from closed to open? Can anyone give me a few pointers on how to change the state of canvas objects please?
2 Replies
I suspect that changing the door state would actually be performed by changing the relevant object on the scene, rather than directly changing the canvas object.
You would need to use a proximity test to find a door that is adjacent to a token controlled the the player (or the currently selected token, depending how you want to identify the token).
Run a filter on the scene doors, looking for the closest?
arms reach do that, on v10 for sure