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

Can you use @{repeating_resource_$0_resource_left_name} in macro dropdown?

I have an attack macro for ranged weapons with ammo, and want to allow the characters to use up to 3 weapons. Right now I name them in a dropdown ?{Attack type?|Pistol, !ammo @{selected|character_id} repeating_resource_$0_resource_left -1 ammo|... Can I instead pull the name they were given on a character sheet?  @{repeating_resource_$0_resource_left_name} ?{Attack type?| @{repeating_resource_$0_resource_left_name}, !ammo @{selected|character_id} repeating_resource_$0_resource_left -1 ammo|... If so I clearly don't know how. We don't OFFICIALLY use a sheet, because our game is not compatible, but I have a macro for ranged damage, and the only thing I really need to track now is ammo use.  I'd prefer not to have to update sheets when they get different weapons, or if they list them in different orders.
From the name of the resource it looks as though you're using the 5e OGL sheet.  The companion script makes ammo tracking much simpler.
Mark B. said: From the name of the resource it looks as though you're using the 5e OGL sheet.  The companion script makes ammo tracking much simpler. We are, and were not.  None of our game info works on the 5e OGL sheet (well, very very little). We play Iron Kingdoms but the IK sheet just doesn't do well.  So all we are using the 5e OGL sheet for resources, unattached to weapons.  We list +/- 8 things.  1. Feat Points, 2. Defense, 3 Armor, 4. Fatigue, and 4 Weapon Ammo Slots (pistol, rifle, artillery, misc). The solution ended up being this (both parts are in same macro), and my apologies, I thought I returned to say this was solved. ?{Attack type?| @{selected|repeating_resource_$0_resource_left_name}, !ammo @{selected|character_id} repeating_resource_$0_resource_left -1 ammo| @{selected|repeating_resource_$0_resource_right_name}, !ammo @{selected|character_id} repeating_resource_$0_resource_right -1 ammo| @{selected|repeating_resource_$1_resource_left_name}, !ammo @{selected|character_id} repeating_resource_$1_resource_left -1 ammo| @{selected|repeating_resource_$1_resource_right_name}, !ammo @{selected|character_id} repeating_resource_$1_resource_right -1 ammo } This lets my players pick with of the 4 weapons they want to use (if they use all 4) and it deducts ammo as it fires the weapon. !power {{ --name|@{selected|character_name} shoots @{target|token_name} --leftsub|Ranged Attack --rightsub| --bgcolor|#274E13 --Attack|[[ ?{Boosted Att?|N,2d6|Y,3d6} + ?{RAT|0} ]] vs @{target|bar1} DEF --Damage|[[ ?{Boosted Dmg?|N,2d6|Y,3d6} + ?{POW|0} ]] vs @{target|bar3} ARM --Location|[[ d6 ]] }} The only thing remaining is --rightsub| I'm trying to see if there is a way to capture the value of what my player selected (weapon type) so the card can show: Ranged Attack * Pistol
I would use chatsetattr to deal with those resources, then