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 to heal / damage, bar1

So I made a macro for Deathwatch, the apothecary to heal people. Seeing how with nassasarium and skills she basically cant fail I dont need to test a stat.  However while I can display my results: @{selected|token_name} uses Medicinae to Heal [[{1d10}+@{selected|itb} add to@{selected|bar1}]] Wounds from @{target|character_name} it displays correctly, but Id like to use the output value to accually appear on the damn target token .- and for the matter have same issue with my boltgun macro.... Any tips on this?
Macros are read-only  by default. In order to get a macro to write  a value, it will need to call the API, which requires the creator of the game (most likely the GM) to have a PRO subscription.
I see, well I had that, in 2014, but couldent make API work so was a bit of a waste
You could use either TokenMod or ChatSetAttr to handle both of your use cases.
1519764021
Gen Kitty
Forum Champion
(Moving this to API since it is an API thing :)  )
Right, looking at tokenmod, but its a bit... apprihensive, tbh I have no script experience at all.. which is easier to work with, TokenMod or ChatsetAttr*?
Well both are useful. I don't use TokenMod, but I know ChatSetAttr has examples on its usage in its details (on the API scripts page). However if you think that there may come a time when you want to heal a mook (a token that represents a character, but does not have a linked health bar to the character sheet), you will need to use TokenMod. I mention this primarily because your first use case is to update a bar value for a token (assuming that bar is the health bar of course).
1519830121

Edited 1519830148
Kirsty
Pro
Sheet Author
I haven't used ChatSetAttr, but I do use TokenMod a lot. It's easy to install as it's in the dropdown API list. The syntax took me a little bit to figure out, though there is a really great explanation given with the script. Regardless of which script you choose, there are people here on the forums who will be happy to share macros or help you create your own to make the script work the way you want. :)
well, wild idea, Id like to be able to fire a weapon, play a sound, calculate hit and dammage and apply it to a enemy token.  The heal seems relatively strait forward comparted to that, but the idea would be to increase game flow (a lot)  I realise thats a huge leap up xD but we are allowed to dream right ;P 
1519830782
Kirsty
Pro
Sheet Author
You can actually do a lot of that! I don't automate my stuff quite so much, but I'm sure someone will be by shortly to help out. There is actually a recent thread about playing a sound when an attack is made. You'll want Scott's amazing Roll20AM script.   Here's a link to how to set up the macro.
aww, thanks a lot Kirsty, I´ll try to read up on it. Well Tbf, Im siting in Iraq on a 6mdr tour, my satcom is limmitet and time as well, so I want as much of the slow stuff removed, that means automatic rolls and applying the results. :)  Then I only have to tell the story and move the enemies ex ex 
1519972565

Edited 1519987076
Soo, heres what I got ---- Attack Macro !roll20AM --play|Bolter| !roll20AM --stop,delay:3|bolter| ! /me attacks with his Bolter and shoots at @{target|foe|character_name}! **To Hit**:[[-1*1d100-((@{Selected|BallisticSkill}+?{Modifier|0})*-1)]] /me shot hits the: [[ 1t[Hitzone] ]] Dealing [[{2d10+5}-@{target|foe|TB}]] X damage pen 4 Now, this macro displays what I want it to, but obviously dont acccually modefy the target tokens bar1. Nor do I have proper incorperation of armor (hitzone table displays right locations, but I cant figure how the hell I get the pen/armor worked out. When I fiddled with it, if pen was bigger then armor it added to damage -.- maybe I should go with smth simpe lige a combined damage reducktion and just adding pen to damage ;/ ---- Healing @{selected|token_name} uses Medicinae to Heal [[{1d10}+@{selected|itb}]] Wounds from @{target|character_name} !token-mod {{ --set bar1_value|[[{@{target|Target|bar1}+1d10+@{selected|itb}, @{target|Target|bar1|Max}d1}kl1]] --ids @{target|Target|token_id} }} So this do heal a token, though its pure luck if the number displayed match the acual healing done, also I have to click target token twise  (a minor bother to be sure, but a bother non the less. In any case, if someone know how to incorperate the features into my macro Id be much happier ... I cant make this crap work for me 
1520420844

Edited 1520421075
Silvyre
Forum Champion
Hey, Rune S. Apologies in advance for adding more scripts to your pile, but I think you'll like the PowerCards API Script, once you get the hang of it. PowerCards supports a script similar to TokenMod to alter the bars on Tokens, called AlterBars . Once you've installed both the PowerCards script and the AlterBars script , you can use macros like these to have damage/healing be automatically applied to a Token: !power {{ --Damage|[[ [$Dmg] (2d10 + 5) - @{target|foe|TB} ]] --alterbar1| _target|@{target|foe|token_id} _bar|1 _amount|-[^Dmg] }} !power {{ --name|Medicinae --Healed|[[ [$Heal] 1d10 + @{selected|itb} ]] Wounds from @{target|character_name} --alterbar1| _target|@{target|token_id} _bar|1 _amount|[^Heal] }} (PowerCards also has support for the Roll20AM script, so you could optionally integrate your Roll20AM macro commands into your PowerCards macros.)
umm that sounds very usefull indeed, totally going to fool around with that, thanks a lot mate :)