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 Help-Drop down menu selector

HI Please forgive me as I'm Brand new here, but i was wondering if i could get some help with a macro please. I'm trying to create a easy to use Macro for our group, playing Mouse Guard 2E. -Bit of info- Sometimes we have to make checks (only ever using d6's) and we get to use that skills number as the number of dice rolled then we get to add extra dice for modifiers and help. So for example:- my fight skill is 2 and i have a long tall i can sometimes use to help me out, so for a fight: I would get 2D6 (from my skill) + Modifiers 1D6 (for using my long tail as an example) + Help provided 2D6 (2 of my party members help out so i get an extra dice each) Then the GM would say how hard it is (obstacles) So i would get to roll, in this example, 5D6 and if any are greater than a 4 they are a success............ and if the success is less or higher than the Obstacles number, it is a Pass or a Fail (sometimes its also important to know by how many, so if this can be added to the macro as well, even better). So this is the Macro i have so far (which i have already improved a bit):- &{template:default} {{name=Skill Used: ?{Which skill is used?|None Specific|Fighter|Nature|Will|Health|Scout}}} {{Successes:=[[(?{What is the skill number?|0}+?{Are there any modifiers?|0}+?{How Many Help Dice?|0})d6>4]]}} {{obstacle:= ?{DM Given Obstacle|0}}}{{Success:= {Successes>Obstacles}}}}} This works but it is a bit slow and still leaves us things to work out, this is what it looks like:- Question 1 Can I make it so ALL the questions are on 1 Page, so instead of this:- Can you make it like this:- Question 2 How can i make that drop down menu pull stats from the Character sheet? So my Fight skill is 2 so when i select fight in the drop down menu it will Automatically pick the "2 info" from my Fight stat on my character sheet and add 2d6 to the result of the dice once i enter the next numbers. If it is a scout test and my skill is 5, it would pick the 5d6 from the character sheet, if its cooking and i have 0 skill then it will give me 0d6 and so on.. Question 3 Is there a way to make the " Successes>Obstacles" result show as either Pass or Fail and show the number by how many. So if i roll 4 successful rolls and there are 2 Obstructions it would say "Success: Pass 2" Question 4 To save my OCD, is there anyway to make that form look "nice", as in make all of the questions line up? instead of making some boxs be at the end of the question and some underneath the question (like making the pop up a default size?)
1570611201

Edited 1570611331
GiGs
Pro
Sheet Author
API Scripter
The unfortunate answer is no, you cannot make them on one page. It's a big limitation of roll20 that we all sadly have to deal with. Script writers would love the ability to do that, to create better interfaces for their scripts. The thing you can do is reduce the number of queries. You dont have to get people to input each bit of information. People are capable of adding small numbers together, and will probably be having to train themselves not to do it to use separate queries like this. This is much quicker and better: "What am I rolling?" "I'm using Fight 2 and I have +1 for a long tail." "Okay, you have 2 helping dice." *Player enters 5 in the single query box* If the GM gives an obstacle, they enter that in a second box, but I stress: if you are playing for speed, that is completely unnecessary. The GM will say, "It's Obstacle 2," and you can look at the roll in chat, see that it says 3 or whatever, and just say, "so I succeed." Someone will be saying this anyway, so entering the input gives no extra information than just saying it out loud.
Thank you Very much for your time i really appreciate it. I must say that I'm surprised that those things cant be done, as it seemed so power full (from some of the videos i have seen). Anyway i would still like questions 2 and 3 done if possible? So:- Question2: Can the Drop down menu pull the Stat from the Character sheet? Question 3: Can I get the last bit to compare the other 2 results so "Successes>Obstacles" will say Pass or Fail and by how many? Again thanks for your time.
1570631532
GiGs
Pro
Sheet Author
API Scripter
Were those questions there when i originally replied? i dont remember them and feel silly for missing them. Getting Attributes From a Character Sheet: If your macro is a universal macro, and can be used by everyone, you need to supply two bits of information: which character, and which attribute. You can do that in three ways: @{charactername|attributename} @{selected|attributename} @{target|attributename} The first requires you to specify the character whose attribute you are calling. The other two are more generally useful. If you have a token selected, and a character linked to that token, selected &nbsp;will use that token's character. If you use target, you'll be prompted to select a token, and then it'll use that character's attribute. See here for more:&nbsp; <a href="https://wiki.roll20.net/Macros#Attribute_Macros" rel="nofollow">https://wiki.roll20.net/Macros#Attribute_Macros</a> Comparing Success You can compare successes vs obstacle, but you can only get one result. It will tell you how many net successes you got, or display a 1 or 0 for success of fail. You cant do both. Which would look something like {{Successes=[[(?{How Many Dice?|0}d6&gt;4) - ?{DM Given Obstacle|0} ]]}} You could show the various bits like this &amp;{template:default} {{Number of Dice:= ?{How Many Dice?|0} }} {{obstacle:= ?{DM Given Obstacle|0}}} {{Successes=[[(?{How Many Dice?}d6&gt;4)-?{DM Given Obstacle} ]]}} An Anticipated Question You cannot query for an attribute name and both display its name and value off that one call. If you want to show the name and use its value later in the same macro, you must query twice. The only way to avoid that is to build a complex nested macro, which will require you to master html entities . A simpler approach is to build a chat menu and print out a button for each attribute.
Hello and again thanks for your time.... Yes the Questions have been there from the start, but dont worry, things are missed sometimes... easily done :). To be honest Im struggling to keep up with all this, but im trying lol. ok so i have a few followup questions:- 1) I know about " @{charactername|attributename}" but can i use that with a Drop down menu? so how do i turn this " &amp;{template:default} {{name=Skill Used: ?{Which skill is used?|None Specific|Fighter|Nature|Will|Health|Scout}}} &nbsp;" into a Auto fetch data. im guessing (which will be wrong):- " &amp;{template:default} {{name=Skill Used: ?{Which skill is used?|None Specific|Fighter| @{charactername|Fighter} Nature| @{charactername|Nature} Will| @{charactername|Will} Health| @{charactername|Health} Scout @{charactername|Scout} }}} &nbsp;" 2) This code is ALMOST what I'm looking for&nbsp; &amp;{template:default} {{Number of Dice:= ?{How Many Dice?|0} }} {{obstacle:= ?{DM Given Obstacle|0}}} {{Successes=[[(?{How Many Dice?}d6&gt;4)-?{DM Given Obstacle} ]]}} The last Row is exactly what im loking for but the 1st part isnt. So i kind of want:- 3 input boxs saying how many dice in each then displaying "Success #&gt;4" 1 input box saying&nbsp; Obstacles and then Displaying "that number" Success - the Obstacles "display that number" In code it would look something like this &amp;{template:default} {{name=Skill Used: ?{Which skill is used?|None Specific|Fighter|Nature|Will|Health|Scout}}} {{Successes=[[(?{What is the skill number?|0}+?{Are there any modifiers?|0}+?{How Many Help Dice?|0})d6&gt;4]]}} {{obstacle = ?{DM Given Obstacle|0}}} {{Successes=[[(d6&gt;4) - ?{DM Given Obstacle|0} ]]}} Is that Possible? ( i tried the above and it doesnt work... but thats cause i have no idea what im doing lol,
1570715269

Edited 1570721806
GiGs
Pro
Sheet Author
API Scripter
You're pretty close on the first part. Here's a query you can use to get the skill values : ?{Which skill is used?| None Specific,0| Fighter, @{selected|Fighter}| Nature, @{ selected |Nature}| Will, @{ selected |Will}| Health, @{ selected |Health}| Scout, @{ selected |Scout} } Note the way a comma is used: the bit before the comma is displayed to the player in the dropdown, the bit after the comma is used by the macro. If you want to use a specific character, change selected &nbsp;to whatever the character's name is. If they are called Bilbo , that would be @{Bilbo|Fighter} for example. This will give you the relevant value &nbsp;of the attribute. So you could do &amp;{template:default} {{Number of Dice:= ?{Which skill is used?| None Specific,0| Fighter, @{selected|Fighter}| Nature, @{ selected |Nature}| Will, @{ selected |Will}| Health, @{ selected |Health}| Scout, @{ selected |Scout} }&nbsp; }} {{Modifier=?{Bonus Modifiers?|0} }} {{obstacle:= ?{DM Given Obstacle|0}}} {{Successes=[[ [[?{ Which skill is used?} +?{ Bonus Modifiers?}]]d6&gt;4-?{DM Given Obstacle} ]]}} Edit: was missing a curly bracket in the skill dropdown. The tricky part is this line None Specific,0| The bit after the comma needs to be a number. You probably want to put a query in there, and that runs into the Advanced Roll Query Problem . You are better off using the bonus modifier to enter the total value there, in such cases. If you really must include a query there, replace None Specific,0| with (untested, use at your own peril!): None Specific,?{Enter Skill value&amp;#124;0&amp;#125;| On to the final problem: So i kind of want:- 3 input boxs saying how many dice in each then displaying "Success #&gt;4" 1 input box saying&nbsp;Obstacles and then Displaying "that number" Success - the Obstacles "display that number" This cannot &nbsp;be done. Sorry. You cannot make a roll, then use that roll again later in a macro. So steps 1 and 3 above have to be combined (as I did them).
1570721840
GiGs
Pro
Sheet Author
API Scripter
I had a missing } in one of the queries in my last post. Just fixed it. This syntax is tricky, hehe.
Thank you So much for all your help. This doesnt work for me (it either gives me 2 menu options&nbsp; and/or says " No attribute was found for @{Antex|Fighter}" :- &amp;{template:default} {{name=Skill Used: ?{Which skill is used?|Fighter,@{Antex|Fighter}|Nature,@{Antex|Nature} } }} {{Modifier=?{Bonus Modifiers?|0} }} {{obstacle:= ?{DM Given Obstacle|0}}}{{Successes=[[ [[?{Which skill is used?}+?{Bonus Modifiers?}]]d6&gt;4-?{DM Given Obstacle} ]]}} It seems to be trying to pull the State before i even pick anything....... Also Maybe the character sheet cant be used to pull info?? Anyway dont worry about it any more i think ill settle for:- &amp;{template:default} {{Number of Dice:=?{How Many Dice?|0}}} {{obstacle:= ?{DM Given Obstacle|0}}}{{Beat Obstacle by:=[[(?{How Many Dice?}d6&gt;4)-?{DM Given Obstacle} ]]}} As for "This&nbsp; cannot &nbsp;be done"... Damn I guess you told me that before, but i didnt understand.......&nbsp; Thanks for all your help, honestly You been great help.
1570727618
GiGs
Pro
Sheet Author
API Scripter
WalBanger said: Thank you So much for all your help. This doesnt work for me (it either gives me 2 menu options&nbsp; and/or says " No attribute was found for @{Antex|Fighter}" :- It seems to be trying to pull the State before i even pick anything....... Also Maybe the character sheet cant be used to pull info?? The attributes must exist on the character sheet. make sure all attributes mentioned in the query exist, and that message will go away. It does check the state before you pick anything. Roll20 macros have an Order of Operations. The very first thing roll20 does, is scan through the macro, and retrieve the values of all attributes mentioned. This happens before it displays the dropdown menu to you. So when you pick from the list, those attribute calls have already been turned into numbers. Try it again with those attributes already created, and it'll work.
This is my Sheet, they are all ready filled, so should work?
1570728642

Edited 1570728681
GiGs
Pro
Sheet Author
API Scripter
Are you using some kind of extension? and if so, which one? It looks intriguing. That isnt what the attributes and abilities tab normally looks like. It's possible the extension is messing with the names in some way. I tested the script on my own blank character sheet, manually created the attribute names of Fighter and Nature, and it worked perfectly.
1570730025
Andreas J.
Forum Champion
Sheet Author
Translator
GiGs said: Are you using some kind of extension? and if so, which one? It looks intriguing. I'm pretty sure that's just how the "Mouse Guard" sheet looks like, based on the sheet's preview image.
1570733104

Edited 1570733170
GiGs &nbsp;said: Are you using some kind of extension? and if so, which one? It looks intriguing. That isnt what the attributes and abilities tab normally looks like. It's possible the extension is messing with the names in some way. I tested the script on my own blank character sheet, manually created the attribute names of Fighter and Nature, and it worked perfectly. Im not the GM (this is my 1st ever game and im trying to learn (probably to much lol) but im loving roll20 so far... But as far as i can tell the GM is using the standard Sheet (like Andreas said)
1570734104

Edited 1570734286
Kraynic
Pro
Sheet Author
You might need to look on the attributes and abilities tab to see how those attributes are really labeled.&nbsp; At the very least, they would be lower case.&nbsp; With just a quick look at the code on github, Nature might be stored as nature_rating, and Fighter might be the same way (fighter_rating).&nbsp; If that is what you find on the Attributes &amp; Abilities tab, then you would need to be using something like @{Antex|nature_rating}.&nbsp; Whatever is after the "|" has to be identical to the label of the attribute you are trying to call from that third tab of the sheet. Edit: Missed above where that is possibly what that part of the sheet looks like... I didn't think you could alter what that tab looked like.&nbsp; Anyway, you can look at the html code here and see what the sheet is storing things as.&nbsp; All you need to do is drop the attr_ part of the identifier.&nbsp;&nbsp; <a href="https://github.com/Roll20/roll20-character-sheets/blob/master/MouseGuard/mouseguard.html" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/blob/master/MouseGuard/mouseguard.html</a>
1570734972
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
That is actually the look of the Mouse Guard sheet. It just resembles the Attributes and Abilities tab.
1570735914
GiGs
Pro
Sheet Author
API Scripter
Ah, what a weird sheet! The attribute names are fighter_rating, nature_rating, healer_rating, etc. So you'd use @{Antex|fighter_rating}
1570750473

Edited 1570750956
Ok guys, Thanks for all your help.... I was going to give up but we are almost there :-) So this Works(shows no errors):- /w WalBanger &amp;{template:default} {{name=Skill Test: }} {{Successes=[[(?{What is the skill number?| None Specific,0| Fighter,@{Antex|fighter_rating}| Nature,@{Antex|nature_rating}| Will,@{Antex|will_rating}| Health,@{Antex|health_rating}| Scout,@{Antex|scout_rating}+?{Are there any modifiers?|0}+?{How Many people are helping?|0})d6&gt;4]]}} {{obstacle = ?{DM Given Obstacle|0}}} But for some reason this part doesnt pop up and ask me to file in a box:-&nbsp; {Are there any modifiers?|0} . Do we know why? EDIT Ohhhhhhh I added a skill to the above code that has no value (unlearned skill for me) and it doesnt roll.... but i fixed it like this:- /w WalBanger &amp;{template:default} {{name=Skill Test: }} {{Successes=[[(?{What is the skill number?| None Specific,0| Deceiver,0@{Antex|deceiver_rating}| Fighter,0@{Antex|fighter_rating}| Nature,0@{Antex|nature_rating}| Will,0@{Antex|will_rating}| Health,0@{Antex|health_rating}| Scout,0@{Antex|scout_rating}+?{Are there any modifiers?|0}+?{How Many people are helping?|0})d6&gt;4]]}} {{obstacle = ?{DM Given Obstacle|0}}} Still have the same issue as before though with &nbsp; {Are there any modifiers?|0}&nbsp; not working.
1570755397

Edited 1570755452
Just for info purposes i settled on this:- &amp;{template:default} {{name=Skill Test: }} {{Successes=[[(?{What is the skill number?| Skill Rating 1,01| Skill Rating 2,02| Skill Rating 3,03| Skill Rating 4,04| Nature ❧,0@{Antex|nature_rating}| Will,0@{Antex|will_rating}| Health,0@{Antex|health_rating}| Deceiver,0@{Antex|deceiver_rating}| Fighter ⸸,0@{Antex|fighter_rating}| Healer +,0@{Antex|healer_rating}| Hunter,0@{Antex|hunter_rating}| Instructor,0@{Antex|instructor_rating}| Orator,0@{Antex|orator_rating}| Pathfinder ☞,0@{Antex|pathfinder_rating}| Persuader,0@{Antex|persuader_rating}| Scout,0@{Antex|scout_rating}| Survivalist ※,0@{Antex|survivalist_rating}| Weather Watcher ⁂,0@{Antex|weather_watcher_rating}| Resources,0@{Antex|resources_rating}|}+?{Are there any modifiers?|0}+?{How Many people are helping?|0})d6&gt;4]]}} {{obstacle = ?{Dungeon Master Given Obstacle|0}}}
1570757420
GiGs
Pro
Sheet Author
API Scripter
WalBanger said: Ok guys, Thanks for all your help.... I was going to give up but we are almost there :-) So this Works(shows no errors):- /w WalBanger &amp;{template:default} {{name=Skill Test: }} {{Successes=[[(?{What is the skill number?| None Specific,0| Fighter,@{Antex|fighter_rating}| Nature,@{Antex|nature_rating}| Will,@{Antex|will_rating}| Health,@{Antex|health_rating}| Scout,@{Antex|scout_rating}+?{Are there any modifiers?|0}+?{How Many people are helping?|0})d6&gt;4]]}} {{obstacle = ?{DM Given Obstacle|0}}} But for some reason this part doesnt pop up and ask me to file in a box:-&nbsp; {Are there any modifiers?|0} . Do we know why? It's because there's a missing }. That last line should be Scout,@{Antex|scout_rating} }+?{Are there any modifiers?|0}+?{How Many people are helping?|0})d6&gt;4]]}} {{obstacle = ?{DM Given Obstacle|0}}} Notice the extra } after scout_rating. You need to end the query. I wonder if the reason you needed to add 0 before each of the attribute calls was because some of those attributes were empty? If you make sure they have numbers in them, the 0 trick shouldn't be needed, but that's a clever solution.