Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Targeted attack macro

1480222088

Edited 1480222761
I have this macro for attacks in a pathfinder module that was pregenerated and purchased in the marketplace.  It uses the pathfinder sheet but does not check the targets AC for success. The Goblin attacks with his @{name}! Attack Result: [[1d20 + @{total-attack}]] (Needs at least [[(@{crit-target}) + @{total-attack}]] to crit.) Damage Result: [[@{damage-dice-num}d@{damage-die} + @{total-damage}]] Crit: @{crit-target}/x@{crit-multiplier} Crit Confirm: [[1d20 + @{total-attack}]] Crit Damage: +[[(@{damage-dice-num} * (@{crit-multiplier} - 1))d@{damage-die} + (@{total-damage} * (@{crit-multiplier} - 1))]] Type: @{type} Notes: @{notes} @{attack-notes} What can I add and where would I put it to have it so that when I hit the attack button it asks me to click on a target to attack and then checks the attack roll against the AC of that creature to determine success?  Something like @{targeted_token|@AC} or somesuch I guess???  But what would it look like and where in the macro would I add that? It would be awesome if someone super smart could distill this down to babytalk for me. Edit-  Something like this I think. (I got this from other pregen characters, these ones only use the ability section of the sheet and all things are listed as token actions.  But they don't use the actual sheet entries from the charactersheet so the macros are different.) @{selected|token_name} makes a @{nm1} attack against @{target|token_name}! [[1d20+7]] vs. [[@{target|AC}]] A.C. DMG:[[@{dmg1}]] 2nd Edit-- Is it better to use the Attributes and Abilities section or to use the actual Sheet itself for the long term?  Talking about my NPCs, Monsters, or Characters.  I have very little experience with this so don't really know the pros and cons to these two different ways of doing things.  Attributes and Abilities seems quicker and simpler, maybe for monsters and NPCs and then all PCs with the actual Sheet portion?  You thoughts would be good on that.
1480238054
Ziechael
Forum Champion
Sheet Author
API Scripter
You are correct with your assumption that the solution to your woes is the use of the @{target... syntax. As for the sheets over attributes and abilities question: A character sheet is essentially a 'front' for the attributes and abilities section. Attributes that exist on sheets are added to the A+A section automatically and can then be called using macros in the usual way. Sheets also have the added ability to create automatically calculated fields (usually things like armour class, attribute bonuses and other things that are made up of set mathematical formulae or totals of other attributes), these 'autocalc' fields don't show up in the A+A section but can still be called by macros :) Sheets can also do magical things with sheet workers but that's a discussion for another day... I'd highly encourage you to peruse the  wiki at length, it contains a wealth of information for the aspiring  macro creator, DM or player!
1480265356

Edited 1480265386
vÍnce
Pro
Sheet Author
I can't say for sure, but I believe these PF modules were done before MAJOR changes to the PF sheet.  Although these macro's appear to work with the included pre-gen characters/NPC's which is a good thing, some of  the attributes have changed.  It may not be an issue for this packaged module, but macros you might make based of the newer sheets will be different.  Just something to keep in mind as you move forward.  With the advent of drag/drop buttons from the sheet to the quickbar menu, sheet-generated command buttons that allow rolls from the chat window, as well as nearly sheet-wide access to the on-sheet macro-text(which can be customized), the need for creating custom macros has greatly been reduced.
Hi!, I use the following one on Ad&d 2ed which has a different attack calculation but it may serve u as an idea: &{template:default} {{name=@{Selected|token_name} attacks to @{Target|token_name}!}} {{Attack roll:=[[d20 + ?{Mod.Attack|0}]] vs [[@{Selected|Bar3}-(@{Target|Bar1})]]}} {{Damage:=[[ ?{Quantity|1}d?{Dice|20} + ?{Mod.Damage|0}]]}} We use just Bar1 = AC, Bar2 = HP, Bar3 = Thaco. Adding Modifiers for special combats situations and any weapon. That works very easy and the master just need to fulfill the 3 Tokenbars to use it. You can add any other information on the table for advanced attack rolls or special abilities.
I appreciate all the great information!  Fantastic input.  
1481133980
vÍnce
Pro
Sheet Author
Tarik Rocadura said: We use just Bar1 = AC, Bar2 = HP, Bar3 = Thaco. " THAC0 "  Tarik must be an old-timer.  ;-P