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 .
×
May your rolls be merry + bright! 🎄
Create a free account

Can Macros / Buttons be put into Chat?

Howdy again! Here's what I want to do. I want a player to be able to roll their attack, and the chat to say: Sir Bearington rolled a 17 Attack, On the GM screen only, this would have two buttons after it: Hit and Miss. If the GM presses the Hit button, it would roll damage and say something like: hitting Lady Pussycat for 6 Damage! while the Miss button usually be: missing Lady Pussycat. Q1: Can we make part of a chat display to the GM only? Or does the whole chat line need to be GM only? Q2: Can we insert macro buttons into the chat? If so, then the macro could also contain API hooks for hit and miss (for example, for half-damage on miss effects, etc.) Anyhoo, if we could do this, then I can write some seriously slick modules. It seems like everything gets funneled through the chat, and the chat gets logged, so making it so that the chat is a control as well as view would rock.
1401777623
Nibrodooh
Pro
Sheet Author
I am not super familiar with the api(as i do not currently have mentor), but i do not believe that it allows chat messages to include the required html tags for buttons so this would not work. however it would be theoretically possible for it to post the message and wait for a gm whisper of something like !hit or !miss to respond with the appropriate message. so the buttons wouldn't be inline but instead part of the GM's macro bar, but provides similar functionality.
You're probably better suited if you were to post this in the API forums. The only chance of this being doable is via the API.
1401810276

Edited 1401810728
I have already made a combat resolution script for the API for Pathfinder RPG. It can be adapted for any system though. If you would like to take a look here I have a short 94 second video showing it in action. If you would like to see the code, send me a PM, and I will send you the gist. As for macros, they are already chat functions. Anything with /gm or /gmroll will go to the GM(s) and on be visible to you and the GM(s). The way macros work, is they have visibility tags. In the tag area on the macro, you can specify who can see the macro. No tag info defaults to GM only. So any macro with the tag "All Players" will have see the macro in their macro page. What you are wanting to do is already possible to you, just not as buttons in the chat.
1401819928
Lithl
Pro
Sheet Author
API Scripter
This would have to be achieved with the API. That being said... You could have an API command spit out two sendChat messages, one visible to everyone, and one as a whisper to the GM. Or, rather than an API command, you could trigger off of a certain format regular chat message, and simply used sendChat to whisper to the GM. sendChat allows you to use the /direct slash command (which is not available to users through the UI; only sendChat can use /direct). /direct lets you post HTML code to the chat. You can only use a subset of HTML elements, but <a> is among them, which you could style as a button (you can put arbitrary CSS inline with the elements). I don't know if the /direct HTML can include things like onClick events, but it's worth a try if that's the interface you want. Of course, if you're responding to an API command or parsing a regular chat message anyway, you probably don't need to create a button for the GM to click. You could simply make the hit/miss decision from within the API.
Brian said: Of course, if you're responding to an API command or parsing a regular chat message anyway, you probably don't need to create a button for the GM to click. You could simply make the hit/miss decision from within the API. That is exactly how my combat script works.
Howdy all! Thanks for the replies! I'll try to implement my vision using using the API, then. Btw, the reason why I don't automatically calculate the Hit or Miss at Attack time is that my homebrewed system Kim's RPG uses an Action Point buy system: <a href="http://www.ugcs.caltech.edu/~kel/KimsRPG/PH/" rel="nofollow">http://www.ugcs.caltech.edu/~kel/KimsRPG/PH/</a> So, for example, the defender might spend an Action Point to raise his defense, the attacker could activate an ability that modifies things, etc. In fact, I'm hoping to encourage "back-and-forth" point spending. Until I can actually code the complete decision tree properly, it's easier to get up and running just verbally calculating and manually making the Hit/Miss decision.
You could easily still automate it, when you call the script, ask the player if they would like to reserve x amount of action points, store that as a variable. After the roll happens, you can do a y/n prompt saying something like "attack roll was x, do you want to add your action points?" Then just it either auto completes with the action points, or doesn't.