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 .
×

All use attack and damage roll for player character use. (HELP PLEASE)

Hello wonderful forum people, I am currently trying to perfect a macro that will allow me to attack with whatever weapon I choose and if I hit to then roll for damage. In my head I click the "Attack" macro. A dropdown menu asks what weapon, (longbow, shortsword, unarmed); it will then ask if I have advantage or not (Yes or No); After making those two selections I will make the attack roll the goes with what i chose and it should appear in the chat. At this point a menu will be on screen asking if I hit (Yes or No). I (the player) will wait for DM to tell me if I hit or not. If I hit I would then select "Yes" and then finally it will ask if it was a crit or not (YES or No). The appropriate damage roll will then appear in chat.  I currently have working macros for each individual attack and damage roll for each attack. I have also managed to have an "Attack" macro that opens a query where I select the weapon of choice and it will use the appropriate attack roll for the weapon and the roll will appear in chat. I also have a separate "Attack w/ ADV" macro that asks if I have advantage with a yes or no query. the macro will roll appropriate atk rolls based on my answer. Problems I am having: 1. After first query (choosing weapon), i can not properly nest the "Attack w/ ADV" macro for each weapon. It only works if I nest the no advantage atk roll macro. I believe I am running into a problem because the first query leads to a second query and thats a no no for some reason.  2. After the attack roll appears in chat idk how to get the next query to appear and wait for me to answer if I hit or not. After this answer I would then also need another query to come up and ask if it was crit or not. and so on. I understand this is a lot and probly hard to understand. I can provide the code so far for whatever is necessary for anyone to offer assistance. I guess to start off I just wanna ask, Is what I am trying to do possible or am I dreaming? Thank in advance for the assistance!
1586062779
GiGs
Pro
Sheet Author
API Scripter
This part isnt possible: After making those two selections I will make the attack roll the goes with what i chose and it should appear in the chat. At this point a menu will be on screen asking if I hit The macro does all queries before printing to the chat. The only way to simulate this is to split it into two macros, one of the attack, and one for the damage. Then when you make the attack, it prints out the attack roll, and with it, a button to launch the damage macro. That achieves part of what you. You oculd even have it print out two buttons, one for normal hits and one for criticals. Regarding your #1 problem, you are probably correct on the source of the problem. Nesting macros is a pain on roll20, and better avoided generally. This explains why:&nbsp; <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a> An alternative is to use Chat Menus:&nbsp;<a href="https://app.roll20.net/forum/permalink/5927072/" rel="nofollow">https://app.roll20.net/forum/permalink/5927072/</a>
"I currently have working macros for each individual attack and damage roll for each attack. I have also managed to have an "Attack" macro that opens a query where I select the weapon of choice and it will use the appropriate attack roll for the weapon and the roll will appear in chat. I also have a separate "Attack w/ ADV" macro that asks if I have advantage with a yes or no query. the macro will roll appropriate atk rolls based on my answer." So your eventual goal is exactly what I've been working on for the last few hours, but you're just about one step ahead of me. I understand how to set up a query for the attack rolls, but I don't know how to make the results of that query nest my attack macros.&nbsp; For example, my orc barbarian has a greataxe, a spear, or a javelin. I have macros for each of those attacks written out, but if I type in: ?{Weapon?|#Greataxe|#Spear|#Javelin} , it does not seem to nest those macros. instead it just spits out the literal words "#Greataxe", "#spear", or "#javelin" in the chat without running the macro itself. How'd you manage to nest the macros?&nbsp;
1586067966
GiGs
Pro
Sheet Author
API Scripter
If you want to use a nested query, you only have two options: Abandon the individual macros. Make one large query, which contains all the attacks fully typed out within it, and perform the html substitutions required (see the link i posted) Modify ever individual macro, adding the html substitutions needed. Note this will mean they wont work as individual mactos any more, they will only work when called from the master macro. A better alternative, since you have the macros already, is to create a chat menu. You dont have to modify the existing macros, instead you make a master macro that prints buttons to chat, one for each macro, wand you click them as desired. You can whisper the chat menu, so it doesnt clutter up the menu for others. If your attacks are indeed macros, and not character abilities, this is the code [visible label](!&amp;#13;#macro name) You just need a macro to print out that repeated for each of your attacks.
Holy shit. Took some playing with but yeah, Got it working. Thank you so so much for your help. I have no experience in programming so this was pretty amazing. My final code looks like this: &amp;{template:npcaction} {{rname=Attack}} } {{description=Select your weapon:[Greataxe](!&amp;#13;#Greataxe )[Spear](!&amp;#13;#Spear)[Javelin](!&amp;#13;#Javelin)}} And it does EXACTLY what I want it to. Thank you so much for your help again this is the shit.
1586070797
GiGs
Pro
Sheet Author
API Scripter
Excellent! :)
Alex V. said: "I currently have working macros for each individual attack and damage roll for each attack. I have also managed to have an "Attack" macro that opens a query where I select the weapon of choice and it will use the appropriate attack roll for the weapon and the roll will appear in chat. I also have a separate "Attack w/ ADV" macro that asks if I have advantage with a yes or no query. the macro will roll appropriate atk rolls based on my answer." So your eventual goal is exactly what I've been working on for the last few hours, but you're just about one step ahead of me. I understand how to set up a query for the attack rolls, but I don't know how to make the results of that query nest my attack macros.&nbsp; For example, my orc barbarian has a greataxe, a spear, or a javelin. I have macros for each of those attacks written out, but if I type in: ?{Weapon?|#Greataxe|#Spear|#Javelin} , it does not seem to nest those macros. instead it just spits out the literal words "#Greataxe", "#spear", or "#javelin" in the chat without running the macro itself. How'd you manage to nest the macros?&nbsp; Your macro should look like this ?{Weapon?|Greataxe, #Greataxe|Spear, #Spear|Javelin, #Javelin} The first word is the name of the choice in the query and the second is the function that goes with that choice. I think that will fix your issue.