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

Newbie Questions about Macros

So this is my first time creating an RPG on Roll20. I wanted to ask: Is there a macros code that can subtract HP by the means of “self-inflicted damage”? I created an Level 0 Arcane Evocation Spell called “Ram” which is basically the function of a ship ramming into another (Its for a Pirate-themed RPG). This is what I’ve got: 1d5-10 + @{Hit Points}, which I want it to translate to: Roll a dice of 5, subtract value by 10 = negative number Add negative number to your Hit Points, aka Hit Points minus the |negative number| However it does not translate, so I know I’ve done something wrong. Is this function not allowed or is it just a coding error. If it is just an error, please fix it.
1417302499
Falcon
Pro
Sheet Author
Are you trying to change the @{Hit Points} attribute? The system doesn't allow you to change attribute just read the numbers from them. There are several APIs that allow you to do that but that is a different issue. If you are just trying to figure out the number and not trying to change the attribute then the formula should be this: [[@{selected|Hit Points}+(1D5-10)]] The key would be to make sure that you select the ship that will take the damage. This will do the following: Selected objects Hit Points + (Roll a 3 - 10) = Objects hit points -7 Is that what you are trying to do?
The Macro system can't change values, unfortunately, only read-in information and put results in the chat window. You can have it report how many HP would be lost and manually enter it into your sheet or token bar, etc after that though
1417306495

Edited 1417306534
So that means I need to roll for the number and manually change the HP by editing the target? I can manage that. Another question I have is the green bar over the tokens. I presume that is the Health Bar (If it isn’t, correct me), that shows whatever you put into the HP on the character sheet/token bar. Do I have to manually alter that too in order to subtract damage?
1417316495
Falcon
Pro
Sheet Author
You can change the bars colors so I don't know what bar you have as green but they correlate to the 3 circles above a token. The middle circle is usually HP and red. I would note that unless you have an attribute attached to that circle in the token you won't be able to tie the value onto it. My advice is to go through some tutorials as they will explain all of this in great detail.