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

@{Weapons|@{selected|equippedweapon}Damage}

@{Weapons|@{selected|equippedweapon}Damage} Which becomes: @{Weapons|RapierDamage} This has to be possible, surely? Not as written, I know. That breaks syntax. But there has to be some kind of workaround to achieve the same effect? This functionality is critical to my game, and in terms of macros it's the only hurdle I have left to overcome, but it has absolutely stumped me for years. All I need to do is tell the game which weapon it needs to pull multiple attributes from. I can't use a simple query, because there are four relevant attributes associated with each weapon, and since a query can only store one value for each response without being re-prompted, I'd have to include four dropdown choices every single time someone presses 'Attack.' I would love to buy a Pro subscription and put this behind me, but I can't afford it. And I've come too far to accept that something this minor is impossible. Does anyone have any ideas?
1501756819
Ziechael
Forum Champion
Sheet Author
API Scripter
You can  fake it a bit with the following setup: Each sheet needs the following attributes 'prefix' (value = @{selected|), suffix (value = Damage}), equippedweapon (value = whatever you want the equipped weapon to be and have attributes for such as RapierDamage etc). Then you can do things like [[ @{selected|prefix}@{selected|equippedweapon}@{selected|suffix} ]] to get a variable output by only having to change the value of 'equippedweapon'. Hope that helps?
Ziechael, you won't believe this, but I was trawling through the archives and found an earlier instance of you describing this exact trick JUST before you posted. I tried it out, and it works. I cackled like a mad scientist. YES. YESSS. AAAAAAAAAARGH!
1501757854
Ziechael
Forum Champion
Sheet Author
API Scripter
IT'S ALIIIIIIVE! Enjoy ;)
1501760780

Edited 1501766332
One extra tiny issue. It's possible I'll figure this out myself given time, since I'm getting a nagging feeling of deja vu, but just in case: [[@{Actions|prefix}@{selected|WEP}|WGT}]] ( Effectively: @{ + Iron Sword + |WGT} ) This works perfectly. However: [[@{Actions|prefix}@{target|WEP}|WGT}]] This returns a 'No character was found for '@{target'' error. Any ideas what's causing this? I feel like I've had trouble with @target before, but I can't remember how I fixed it... EDIT: I've come up with a solution. In the character's 'HIT' attribute, I simply have [[@{Actions|prefix}@{selected|WEP}|HIT}]]. This way, I'm still using the original code I started with and the @target error is bypassed, but the values still automatically adjust to the weapon name.