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

Attack template and roll query?

So I am trying to make a macro that will let you choose which repeating_weapon to use when you roll it with a roll query. Have tried a few variants but keep having issues. The closest I have gotten to working is below(query removed, but I replaced every 0 with ?{WeaponID}. Have tried using it with inline brackets and other things but each time it get's to the instance of ?{WeaponID} it ask for the variable again. Also show up like this in the query box(Example: WeaponID [blankbox]_crit-target} So it keeps registering the line after the query as part of the query. Any advice? &{template:pf_attack} {{character_name=@{selected|character_name}}} {{character_id=@{selected|character_id}}} {{name=@{selected|repeating_weapon_0_name}}} {{attack=[[ 1d20cs>@{selected|repeating_weapon_0_crit-target} + [[ (@{selected|repeating_weapon_0_proficiency} + (((@{selected|repeating_weapon_0_enhance} + @{selected|repeating_weapon_0_masterwork}) + abs(@{selected|repeating_weapon_0_enhance} - @{selected|repeating_weapon_0_masterwork})) / 2) + @{selected|repeating_weapon_0_attack} + @{selected|repeating_weapon_0_attack-type} + @{selected|armor-proficiency}) ]] ]]}} {{damage=[[ @{selected|repeating_weapon_0_damage-dice-num}d@{selected|repeating_weapon_0_damage-die} + [[ (@{selected|repeating_weapon_0_enhance} + @{selected|repeating_weapon_0_damage} + @{selected|repeating_weapon_0_damage-ability}) ]] ]]}} {{crit_confirm=[[ 1d20 + [[ (@{selected|repeating_weapon_0_proficiency} + (((@{selected|repeating_weapon_0_enhance} + @{selected|repeating_weapon_0_masterwork}) + abs(@{selected|repeating_weapon_0_enhance} - @{selected|repeating_weapon_0_masterwork})) / 2) + @{selected|repeating_weapon_0_attack} + @{selected|repeating_weapon_0_attack-type} + @{selected|armor-proficiency}) ]] ]]}} {{type=@{selected|repeating_weapon_0_type}}} {{description=@{selected|repeating_weapon_0_notes}}} @{selected|macro_options}
Short example. [[?{Weapon ID|0}]] &{template:pf_attack} {{character_name=@{selected|character_name}}} {{character_id=@{selected|character_id}}} {{name=@{selected|repeating_weapon_?{Weapon ID}_name}}}
1434939829
The Aaron
Roll20 Production Team
API Scripter
That won't work. Attributes are expanded before Roll Queries are applied: <a href="https://wiki.roll20.net/Dice_Reference#Order_of_Op" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Order_of_Op</a>...
Gotca, never noticed the order there. I'm stumped then. Guess I'll have to make a button for each weapon at full, single, rapidshot, etc. At 9 weapons, that's going to be a lot of token actions :/ Is there a preexisting API script to handle this for the Pathfinder FR sheet? Or could the sheet itself be modified to handle this? I.e. Make more preset attack buttons, each one to account for single attack, full attack, rapid shot, two weapon fighting, and so on?
1434940673
The Aaron
Roll20 Production Team
API Scripter
I'm sure it could be modded. I'm not aware of any API scripts for PF support currently.
Awesome, I will tinker around with it when I get home. Thanks for the assist. And if anyone knows of an API or anything, shoot me a message.