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

Macro Debug - attributes for a second target selection supersede first target selection

Background: Game: Savage Worlds Sheet: Tabbed Savage Worlds I've tested this using the default template as well and get the same results So I'm trying to select two target tokens and have the output as follows: Token 1 Name | Damage roll | Evasion Roll Token 1 | Wounds at | n, n+4, n+8, n+12 Token 2 Name | Damage Roll | Evasion Roll Token 2 | Wounds at | n, n+4, n+8, n+12 n = A character attribute specific to the token (in this case, it's the character's toughness) Instead, the output is: Token 1 Name | Damage roll | Evasion Roll Token 2 | Wounds at | n, n+4, n+8, n+12 Token 2 Name | Damage Roll | Evasion Roll I can't figure out why this occurs. Here's the macro I'm testing with: ?{Number of dice|2|3|4} ?{Dice size|4|6|8|10|12} &{template:info} {{name=Area Damage}} {{Note=Each target rolls **?{Number of dice}d?{Dice size}** damage and Agility -2 to avoid. If prone, damage is -4.}}{{``@{target|Token 1|token_name}`` =[[?{Number of dice}d?{Dice size}!]] **Damage**; *Evade* [[@{target|Token 1|agility_rank}-2]]; **Wounds at** [[(@{target|Token 1|toughnesscur}-?{AP|0})]], [[(@{target|Token 1|toughnesscur}-?{AP|0})+4]], [[(@{target|Token 1|toughnesscur}-?{AP|0})+8]], [[(@{target|Token 1|toughnesscur}-?{AP|0})+12]] }}{{``@{target|Token 2|token_name}`` =[[?{Number of dice}d?{Dice size}!]] Damage; Evade [[@{target|Token 2|agility_rank}-2]] }}{{Wounds at=[[(@{target|Token 2|toughnesscur}-?{AP|0})]], [[(@{target|Token 2|toughnesscur}-?{AP|0})+4]], [[(@{target|Token 2|toughnesscur}-?{AP|0})+8]], [[(@{target|Token 2|toughnesscur}-?{AP|0})+12]] }} Chat output: In the above picture, the wounds listed are actually calculated using Token 2's attribute (Token 2 in this case is GM Sheet). I would hope to see two entries or rows for the "Wounds at" output, one for Token 1 (Beldak), and one for Token 2 (GM Sheet). However, the second Wounds At output is not written in sequence and it supersedes the output for Token 1 instead.
1590503854
The Aaron
Roll20 Production Team
API Scripter
Only one template parameter can exist at a time. You can get unique ones by appending spaces, so: {{Wounds At=first}}{{Wounds At =second}}{{Wounds At =third}} etc.
Thanks, Aaron! Your solution worked (I simply added a couple of trailing spaces to the parameter). I found that I was able to utilize this knowledge to omit duplicate token targets because the macro expects 4 selections. Here's the final product: ?{Number of dice|2|3|4} ?{Dice size|4|6|8|10|12} &{template:info} {{name=Area Damage}} {{Note=Each target rolls **?{Number of dice}d?{Dice size}** damage and Agility -2 to avoid. If prone, damage is -4.}} {{``@{target|Token 1|token_name}`` =[[?{Number of dice}d?{Dice size}!]] Damage; Evade [[@{target|Token 1|agility_rank}-2]] }}{{@{target|Token 1|token_name} gets wounds at=[[(@{target|Token 1|toughnesscur}-?{AP|0})]], [[(@{target|Token 1|toughnesscur}-?{AP|0})+4]], [[(@{target|Token 1|toughnesscur}-?{AP|0})+8]], [[(@{target|Token 1|toughnesscur}-?{AP|0})+12]] }} {{``@{target|Token 2|token_name}`` =[[?{Number of dice}d?{Dice size}!]] Damage; Evade [[@{target|Token 2|agility_rank}-2]] }}{{@{target|Token 2|token_name} gets wounds at=[[(@{target|Token 2|toughnesscur}-?{AP|0})]], [[(@{target|Token 2|toughnesscur}-?{AP|0})+4]], [[(@{target|Token 2|toughnesscur}-?{AP|0})+8]], [[(@{target|Token 2|toughnesscur}-?{AP|0})+12]] }} {{``@{target|Token 3|token_name}`` =[[?{Number of dice}d?{Dice size}!]] Damage; Evade [[@{target|Token 3|agility_rank}-2]] }}{{@{target|Token 3|token_name} gets wounds at=[[(@{target|Token 3|toughnesscur}-?{AP|0})]], [[(@{target|Token 3|toughnesscur}-?{AP|0})+4]], [[(@{target|Token 3|toughnesscur}-?{AP|0})+8]], [[(@{target|Token 3|toughnesscur}-?{AP|0})+12]] }} {{``@{target|Token 4|token_name}`` =[[?{Number of dice}d?{Dice size}!]] Damage; Evade [[@{target|Token 4|agility_rank}-2]] }}{{@{target|Token 4|token_name} gets wounds at=[[(@{target|Token 4|toughnesscur}-?{AP|0})]], [[(@{target|Token 4|toughnesscur}-?{AP|0})+4]], [[(@{target|Token 4|toughnesscur}-?{AP|0})+8]], [[(@{target|Token 4|toughnesscur}-?{AP|0})+12]] }} {{*More*=[Roll Again](~player-macros|area-damage)}}