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

Call a macro from Feature description

HI,


I have searched and searched and can't find anything to answer this.


I want a way to decrease a resource when a feature is clicked. I have been able to do this by including the chatsetattr text inside the description for the feature, but it displays the chatsetattr when it outputs the description of the feature.

I've also tried putting the chatsetattr inside a macro, but I can't find a way to call it from the description text of the feature.

1. Is there any way to deplete resources when a feature is clicked (e.g. Favored By The Gods has only one use) without the text of the chatsetattr appearing in the description?

2. If not the above (and this is probably an easy question to answer), then how can I call a macro from the description of the feature?


Thanks

April 04 (5 years ago)
GiGs
Pro
Sheet Author
API Scripter

Ammo is a script designed specifically for this purpose. It doesnt have to be used for ammo. It's in the one-click installer.

Thanks GiGs, but the way I understand it, doesn't ammo require the ammo to be set up in the Attacks & Spellcasting section of the sheet? Also, if I call the !ammo blah-blah-blah, wouldn't that still show that in the description of the Feature being clicked. I'm maybe completely wrong, or I'm not describing what I want to do properly. Maybe an example would help:


My player's sorceress has a feature called Favored By The Gods. She can use it twice per short rest. I set a resource called "Favored By The Gods" and I want that to decrease each time the player clicks the Feature in the Features and Traits list.


I can do it by including " !setattr --name Dhelfeen --modb --class_resource|[[-1]] " in the description, but " !setattr --name Dhelfeen --modb --class_resource|[[-1]] " then also appears written in the description, which is ugly.


Thanks. I appreciate your super quick help, and if I'm just being dumb, please excuse me.

April 04 (5 years ago)
GiGs
Pro
Sheet Author
API Scripter

You can call ammo from a macro, and it can alter any attribute on the character sheet as long as it is numerical. 

Since you're trying to set it up as a feature on your character sheet, I can't help much there, because I don't use that character sheet. It's very likely the description set up doesnt cope well with script commands.

You can get around this by creating a separate macro or ability for the character, maybe make it a token action, and have that macro be two lines: the first to launch ammo or setAttrs, the second to launch the Feature.

You can set this up by finding out what the chat command is to launch the Feature. Follow this steps:

  1. Click the Feature button so that it prints something in chat.
  2. Put your mouse cursor in the chat area and press the UP arrow on your keyboard. This will show you the last command - the one that happened when you clicked the Feature button.
  3. Copy that text into a macro. Put the ammo  or setAttrs command into the same macro, but on a different line

Now you have a macro that your player can use.


Thank you. I'll probably go with the token macro option as that's how my players like to generally do things, rather than clicking the sheet (which I'd prefer they do, but I'm only the GM and the guy that shelled out the subcription, so what do I know!?)


Anyway. Thanks again. Appreciated.

April 04 (5 years ago)

Edited April 04 (5 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

To mute the response, use the keyword --mute or --silent in the ChatSetAttr macro.

You can also put an API command button into the feature description. For instance, I have just done this using your code above plus "--silent" with a character with the Lucky feat:


The player can send the feature to chat, and decide whether to use it and decrement the point afterward.

keithcurtis,

You have, almost literally, saved my marriage!!

Thank you in copious quantities!!