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

Powercard for Second Wind

I am a new pro user and learning to use PowerCards - which are fantastic. &nbsp;I am Dm'ing a 5EOGL game and I have been trying to set up a Second Wind power card but have had many problems with preventing the result from exceeding the HP maximum of the character. I have TokenMod, Chatsetattr and PowerCards installed and tried a variety of methods. &nbsp; !power {{ &nbsp; --charid|@{selected|token_id} &nbsp; --format|recharge &nbsp; --border|5px solid #000 &nbsp; --erowtx|#000000 &nbsp; --erowbg|#00ffff &nbsp; --orowtx|#ffff00 &nbsp; --orowbg|#006400 &nbsp; &nbsp; --name|@{selected|character_name} Gets a Second Wind! &nbsp; --!desc|[Wind](<a href="https://media.giphy.com/media/CiTLZWskt7Fu/giphy.gif" rel="nofollow">https://media.giphy.com/media/CiTLZWskt7Fu/giphy.gif</a>) &nbsp; --name|Recovery &nbsp; --hroll|@{selected|character_name} heals [[ [$min] d10 + round(@{selected|base_level}/2) ]] points &nbsp; -- ?? $min + @{selected|hp} &gt;= @{selected|hp_max} ?? !token-mod —ids —set bar2_value|@{selected|hp_max} &nbsp; — ?? $min + @{selected|hp} &lt; @{selected|hp_max} ?? !token-mod —ids —set bar2_value|+[$min] I eventually kluged something in so that it would work - which is quite inelegant and doesn't use PowerCards well:&nbsp; !power {{ &nbsp; --border|5px solid #000 &nbsp; --erowtx|#000000 &nbsp; --erowbg|#00ffff &nbsp; --orowtx|#ffff00 &nbsp; --orowbg|#006400 &nbsp; &nbsp; --name|@{selected|character_name} Gets a Second Wind! &nbsp; --!desc|[Wind](<a href="https://media.giphy.com/media/CiTLZWskt7Fu/giphy.gif" rel="nofollow">https://media.giphy.com/media/CiTLZWskt7Fu/giphy.gif</a>) }} &amp;{template:simple} {{rname=Hit Dice}}&nbsp; {{mod=D@{Heilig Ridder|hitdieroll}+[[round(@{Heilig Ridder|level}/2-1)]]}} !modbattr --silent --name Heilig Ridder --HP|{{r1=[[1d@{Heilig Ridder|hitdieroll}+[[round(@{Heilig Ridder|base_level}/2-1)]]]]}}!!! {{normal=1}} @{Heilig Ridder|charname_output} &nbsp; Pretty much I am just showing my ignorance but would love some help.
1600644567
David M.
Pro
API Scripter
With token-mod, you could use the kl1 syntax to do something like this: !token-mod --set bar2_value|+[[{[[1d10+@{Heilig Ridder|level}]], [[@{Heilig Ridder|bar2|max} - @{Heilig Ridder|bar2}]]}kl1]] Hopefully no typos in there, but the basic idea is to set the bar 2 value equal to current value + the lowest amount between a) the healing roll or b) the difference between the max and current value of bar2. Adjust for Powercard syntax as required, with hrolls and such.
Wow. &nbsp;I can't thank you enough. &nbsp;I did try it - though I must admit it's a bit over my head. &nbsp;I did not see a reference to k|1 in Help: token mod - is there another place I can read further? Let's see. &nbsp;I checked the brackets, they're ok - no typos - I don't see any reason it shouldn't work but I got a:&nbsp; No attribute was found for @{Heilig Ridder|bar2} error. &nbsp;Tried @{Heilig Ridder|bar2_value} but that didn't work...?
1600687343
David M.
Pro
API Scripter
Oops, looks like it doesn't like grabbing bar2 based on the token name. If you don't mind selecting the token prior to calling the macro, this should work: !token-mod --set bar2_value|+[[{[[1d10+@{selected|level}]], [[@{selected|bar2|max} - @{selected|bar2}]]}kl1]] Note, it is kl1 (as in K eep L owest 1 ), not k|1. It's a die rolling syntax, not related to token-mod. The above uses Grouped Rolls and Keep/Drop Dice as explained in the dice rolling reference here .
Ack! &nbsp;::slapping forehead::&nbsp;Of course. I use that in standard-advantage-disadvantage choices. &nbsp;Hmmm...no error this time but doesn't seem to do anything either even with token preselected (no chat output)... I cut and paste so it should work - I don't see anything wrong with the syntax or command structure...I am doing something wrong but I don't know what.
1600693449
David M.
Pro
API Scripter
You will have to add everything into your powercards macro/ability to provide chat output. I would put the entire die roll as an hroll and reference it later (see powercards help for this) so you can output whatever text you want in the chat. I'm at work so can't really delve too far into this right now. This is the roll to reference [[{[[1d10+@{selected|level}]], [[@{selected|bar2|max} - @{selected|bar2}]]}kl1]] Just checking: from your OP it seemed that you had bar2 linked to hp for that token, rather than bar1 which is the typical standard. Can you verify that is correct? And there is actually a max value for bar2? If no max value, then the token-mod call won't do anything. Just using the token-mod call by itself worked for me when the token was set up correctly. It modified the bar2 and did not output anything to the chat. Note if bar2 is already at max value, nothing will happen.
Good heavens. &nbsp;If I keep slapping my forehead it's going to get good and flat. &nbsp;I get confused because the bar (circle) sits between Bar2 and Bar3 on the map token. &nbsp;That was the problem and the command works fine once changed to Bar1. &nbsp;That was giving me hours of headaches and frustration. &nbsp;(Sorry to bother you while you are working. ) &nbsp;Thank you again. &nbsp;