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

Attributes referencing other attributes

Hello, not sure this is the correct forum, but could use some help. I am designing my own character sheet (for my own personal RPG), and trying to get a macro working in the character sheet itself.  The standard way to roll works, but in an effort to speed up the game, I want to add a 'common' roll button. So instead of the standard roll macro asking you which attribute and what skill is being used, it skips those and references what stat/skill you have written in that section. This isn't the entire macro, but it is the problem area and I'm just curious if its even possible in roll20. @{(@{attack1stat})}+@{(@{attack1skill})} In essence, 'attack1stat' should be referenced, (where you would right the correct attribute used), and then that attribute is called to reference the actual stat's value to be used in the rest of the macro. As of right now, it sees the first '@' and tries to reference everything past that as the attribute and ignores the '()' Thanks for any help you guys can provide!
1592068558

Edited 1592068569
GiGs
Pro
Sheet Author
API Scripter
It's not possible to build attributes that way in roll20. But since youre building a character sheet you dont need to. There are ways to reference other attributes.  You can simply have an attribute called attack1stat, which itself is a complete attribute reference like "@{strength}". The @{attack1stat} will then give the strength value. Selects are often used for this, where you have something like <select name="attack1stat">     <option value="0" selected>None</option>     <option value="@{strength}">Strength</option>     <option value="@{dexterity}">Dexterity</option> </select> There's a dropdown where the player can select strength or dexterity. And a roll button that uses @{attack1stat} will use whichever option the player has selected. The none line is handy to make sure that roll macros dont break if the players havent selected anything yet.
Thanks! I had figured out just before this naming the attribute itself @{statofchoice} would work, but your way looks cleaner for sure!