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] Trying to create a dynamic sheet connected macro

So using a custom made sheet. On this sheet I have repeating fields on skills and weapons. The skills are called repeating_skill and they have two values that holds the total skill value: a select box holding a reference to the attribute the skill is using (e.g. @{strength} ) called attr_skillattribute and then the skill value called attr_skillvalue . I have two skills that are interesting which is skill number 6 and 7 (if you count the first one as 0). As I understand it to access the value of skill 6 and 7 I can use the following: @{selected|repeating_skill_6_attr_skillattribute}+@{selected|repeating_skill_6_attr_skillvalue} to get the total skill value. I have place this in the repeating_weapon list as another select called: attr_weaponskill all so I can easily as I add a weapon to the sheet just pick what skill this weapon is using and then automatically set the correct skill value to the weapon. In addition to this the weapon then as a bonus value which I call attr_weaponbonus . Ok now to my real question. When I make the macro, from as I understand all of this (which since I get an error I must miss something) I should use the following if I want to use the first weapon in the repeating weapon list: /roll @{selected|repeating_weapon_0_attr_weaponskill} + @{selected|repeating_weapon_0_attr_weaponbonus}d6>6 The macro is to add the two values and then roll that total number of d6, if you roll a 6 that is a success. When I use this macro now I get the error message: No attribute was found for @{selected|repeating_weapon_0_attr_weaponskill} No attribute was found for @{selected|repeating_weapon_0_attr_weaponbonus} There was an error with your formula. Please try again. I have made sure that all fields called for has values at least 0. Please help.
Have gotten progress on the whole thing and now I "only" get error as I use my macro. What I had done wrong was really that I had 'attr' in the variable refences. SyntaxError: Expected "]" or [^\]] but end of input found. This is the macro: /em @{selected|name} attacks with @{selected|repeating_weapon_0_weaponname}. /roll ([[@{selected|repeating_weapon_0_weaponskill} + @{selected|repeating_weapon_0_weaponbonus} + ?{Modifikation?|0}]])d6>6 What am I doing wrong?
1416345254
Finderski
Plus
Sheet Author
Compendium Curator
Two questions (sorry if they seem obvious, but Tech Support has trained me to ask the obvious first): Do you have a token selected when you try to use the macro? Is the token linked to the Character sheet via the "Represents Character" drop down in the Edit Token window? If not, you'd need to do both of those things. Now, if those are on the Character Sheet itself, you can probably dispense with the "selected|" portion of the macro and just have @{repeating_weapon_0_weaponskill}, etc. I rarely use "selected|" myself.
Both questions yes. And yes always start with the easy things that can be wrong. So by default it automatically choose the chosen token if no character is pointed out?
No that makes it worse, if you don't have selected then it complains over that "no character with that attribute" well it mean that anyway.
1416346218
Finderski
Plus
Sheet Author
Compendium Curator
Not sure I understand your last question. But if the macro is on the character sheet (rather than a global macro), it will do everything based on that character sheet. You could then check to make the macro a Token Action, and/or place it on the Macro Bar. If you put it on the Macro Bar, then the character name will appear next to it as well. The other option, if the character sheet already has a roll button on it, you can also drag that roll button to the Macro Bar (bottom of the screen), so it's always available.
1416346383
Finderski
Plus
Sheet Author
Compendium Curator
Can you send me an invite to your campaign? I'm struggling to envision the set up, I think. In my own campaign I copied your formulas and created the same fields and had no problems when I removed the "selected|". It might help if I can see what you're working with.
1416346791
Finderski
Plus
Sheet Author
Compendium Curator
One last thing I just thought of...since this is a repeating section, if you are using just the default values those attributes don't get "written." So, you should enter a value in each of the fields and hit enter. To be safe, I generally give it the wrong value and then set it back to the correct value.
Ok I don't think I need to add you to the campaign as I don't think it is something wrong with the sheet (no offense) but a bug in roll20. check this: my macro that doesn't work but get "[ error", untranslated from Swedish now but well you get the meaning without understanding the words. /roll ([[@{selected|repeating_vapen_0_vapenfardighet} + @{selected|repeating_vapen_0_vapenbonus} + ?{Modifikation|0}]])d6>6 now a simple change that suddenly work: /em first roll /roll @{selected|repeating_vapen_0_vapenfardighet}d6>6 /em second roll /roll @{selected|repeating_vapen_0_vapenbonus}d6>6
1416349985
Finderski
Plus
Sheet Author
Compendium Curator
It could also be that you were mixing inline rolls and /r. Try this: /r (@{selected|repeating_vapen_0_vapenfardighet} + @{selected|repeating_vapen_0_vapenbonus} + ?{Modifikation?|0})d6>6 That worked for me.
Hot damn it worked without [[ ]]. Ok thanks :)
1416351537
Finderski
Plus
Sheet Author
Compendium Curator
:)