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

[5e SRD sheet] Does a current, operational example of a "repeating attack" macro exist?

Greetings! I hope this is the correct board for this question. New to roll20, not new to software engineering. What I'm trying to do is set up a macro that rolls me an attack using one of the "repeatable attack" things from the character sheet (and which asks me for input and prints an emote based on that, but that should be trivial to do). What's the issue? Examples are few and apparently outdated, because I managed to find zero working ones. Documentation of the properties I'm looking for? Zero. I know how forum knowledge for DSLs is, so I figure there's a some chance someone around here will know how to do this. if anyone can give me an example of a macro that rolls the ranged spell attack I've got in at the top of my sheet's "attacks", I'd be very grateful. An operational example, that is. One that works right now. Cheers!
1521224084
GiGs
Pro
Sheet Author
API Scripter
If you click the button for that attack on your character sheet so it prints the result into chat. Then put you mouse in the chat box, and click the up arrow - it will show you the text used to perform that attack. You can copy that and put it in a macro and edit it, if you like. Though the result will be pretty clunky. You can usually launch a repeating section with simpler code. You know you can access the value of stats by @{statname} ? repeating section attribute names are made up of the repeating section name (e.g."repeating_something"), an ID code, and an attribute name ("weapon name") Assuming the section name is "repeating_weapons" and the attribute name is "weapon_value", you can access the first item in a repeating section like this: @{repeating_weapons_$0_weapon_value} replace the $0 with $1 if you want the second, and $2 if you want the third, etc.
1521230044

Edited 1521230086
Results in the log appears to neither use the selected token (something I can live with), nor actually contain pointers to the repeating sections – instead, they appear to be parsed, which serves me no purpose. I knew of the "at-notation", yes. Attempting to run "@{selected|repeating_weapons_$0_weapon_value}" with a token selected, passing the aforementioned query(?) as the result of a "label" in a dummy attack roll template, produces nothing. What I'd like to know is what the attribute names are and what the section names are , since I wouldn't know where to start making assumptions... I'm sure I could figure it out if someone points me towards a documentation of those repeating sections, or shows me a working example.
1521231023

Edited 1521231220
%{selected|repeating_attack_$0_attack} You can find it using the HTML code from the github repository for the character sheet. Repeating sections ALWAYS start with repeating_  and then you can find the specific attributes by looking at the input sections in that fieldset that start with attr_ .
Many thanks, this is spectacular! I wasn't aware that the sheets are available on github. I'll investigate them. This is going off-topic now, but I'd appreciate an answer to one last question: It would appear that, at present, the only way to get a random selection of text is to use rolling tables. Is there any way to get a "bounded random" effect similar to that, but without using rolling tables? Is something like "calling a random macro based on the result of a d4 roll" or "picking a random selection from the options of a roll query" possible?
1521267846
GiGs
Pro
Sheet Author
API Scripter
No, I believe the only way to do that is through API scripting, and you need a Pro subscription for that. Lumos said: Attempting to run "@{selected|repeating_weapons_$0_weapon_value}" with a token selected, passing the aforementioned query(?) as the result of a "label" in a dummy attack roll template, produces nothing. What I'd like to know is what the attribute names are and what the section names are , since I wouldn't know where to start making assumptions... I'm sure I could figure it out if someone points me towards a documentation of those repeating sections, or shows me a working example. My example was meant to be using made-up names, as i don't use the sheet you do. Sorry for not making that clear. I didnt use selected because I assumed you'd be creating an Ability on the character sheet, where selected isn't needed. If you're using chrome or firefox, you can find out the attribute names directly, by clicking F12 to bring up the browsers inspection mode, then right-clicking on an attribute and selecting inspect. You'll find the html is displayed. Look for name = "attr_something" - the bit after the attr is the attribute name. Here's an example from one of my sheets For a standard attribute, you can just look at the highlighted area. Here we have Passion_Value. For repeating sections, you need to find the name for the "fieldset", so scroll up to that, which here is repeating_Passion. So you'd call this stat with @{selected|repeating_Passion_$0_PassionValue}, or just @{repeating_Passion_$0_PassionValue} if it's an Ability on the character sheet.