All I can say is Thank You!! It's been very hard finding macro information at the beginner level, but you've hit the spot. Too many places make assumptions about how much I should already know. Now that I know HOW to access the variables for use in macros, I can start experimenting with simple homemade macros. My own goal is to make a very simple attack macro using selected-token attributes and a target-token AC value. A primer on accessing target token attributes next time would be much appreciated!
Wow, this is by far the most important piece of information I've received about macros in Foundry. I have been an avid user of the "macro polo" community in the Foundry discord because I couldn't find most of the information you shared here. I've tried the Foundryvtt API and I didn't find it that useful or friendly. Using the console as you explained in the video is a much better way to learn and modify macros. Thanks!
Depends on what you're using. If it's Midi-QoL you can use target field and set your range and target type. In range set it to special. It will automatically target all near by. You can also use MidiQOL.findNearby. If you want it in a normal macro. You'll need to filter using canvas.tokens.placeables then filter by Ray distance between the caster and target.
How are you getting the formatting in the marco writing tool. Is there a module you need to activate? At the moment it doesn't add brackets etc. on my computer
All I can say is Thank You!! It's been very hard finding macro information at the beginner level, but you've hit the spot. Too many places make assumptions about how much I should already know. Now that I know HOW to access the variables for use in macros, I can start experimenting with simple homemade macros. My own goal is to make a very simple attack macro using selected-token attributes and a target-token AC value. A primer on accessing target token attributes next time would be much appreciated!
Wow, this is by far the most important piece of information I've received about macros in Foundry. I have been an avid user of the "macro polo" community in the Foundry discord because I couldn't find most of the information you shared here. I've tried the Foundryvtt API and I didn't find it that useful or friendly. Using the console as you explained in the video is a much better way to learn and modify macros. Thanks!
Thanks a lot, very helpful to get started.
Hi - how would I target any tokens that are adjacent to my controlled token in a macro?
Depends on what you're using. If it's Midi-QoL you can use target field and set your range and target type. In range set it to special. It will automatically target all near by. You can also use MidiQOL.findNearby.
If you want it in a normal macro. You'll need to filter using canvas.tokens.placeables then filter by Ray distance between the caster and target.
Someone helped me out and suggested this:
const posToken = canvas.grid.grid.getGridPositionFromPixels(token.x, token.y);
const targetIds = canvas.tokens.placeables.reduce((acc, e)=>{
const posTarget = canvas.grid.grid.getGridPositionFromPixels(e.x, e.y);
const isNeighbor = canvas.grid.isNeighbor(posToken[0], posToken[1], posTarget[0],posTarget[1]);
if(isNeighbor) acc.push(e.id);
return acc;
},[]);
@@Crymic
How are you getting the formatting in the marco writing tool. Is there a module you need to activate? At the moment it doesn't add brackets etc. on my computer
I mentioned in the video description the modules being featured. In this case it's macro editor
@@Crymic sorry. And thank you. I was on my phone and it wasn't showing the description.
Is this tutorial still accurate? When I follow along, what you're seeing in your console is not what I'm seeing in my console.
In v11 they moved into system instead of data. So _token.actor.data.data is now just _token.actor.system. When I made this video v7 - 9 was out.
@Crymic thanks so much. I'll look for that when I dive into it next.
@@Crymic can you remake or recommend another video? It was a great video, the coding is just outdated apparently.
@@lordsofgallipaerogers2959 yeah a remake is in the works. I've been trying to structure out a video series.
@@Crymic excellent. I'll see what i can get to work till then
why does this shit have to be so damn complicated?