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

Alter Bars + PowerCards for Healing / Resting

1594660177

Edited 1594662488
Hello, and again a noob api question :-) I am using PowerCards API, Alter Bars API, (and TokenMod if that would be any help) and the Pathfinder2 sheet. Hit Points are in Bar 3. I want to make a "Rest" Macro.  The formula for regaining hit points from resting is: you regain Hit Points equal to your Constitution modifier (minimum 1) times your level The relevant Abilities from the sheet are level constitution_modifer Question #1: what would be the formula for Alter Bars? (Or TokenMod if it is easier with that script) Question #2: How do i implement this formula into PowerCards? (with the Amount being shown in PowerCards)? Question #3: How do i get Alter Bars to heal that amount automatically without overhealing? (Or TokenMod if this is used) It should look like this: The regained hit point formula in this example is wrong (it's --Regained Hit Points:|[[ @{selected|level}*(1+@{selected|constitution_modifier}) ]] because i don't know how the implement the "minimum" in the formula). For the healing, i tried to use a variable within PowerCards....but i won't work (i guess because i can't get variables running...dunno why...beside "myself" as a reason....i just don't get it how they work) So.....hopefully someone can help me (after some hours trying this or that and going mad about it) Thank you very much in advance !!!! Steve / H0ND0 EDIT: The complete macro so far (bar 1 is the numbers of rogue poison the character has available) !power {{ --titlebackground|none --titlefontshadow|none --format|recharge --name|Daily Preparations --tokenid|@{selected|token_id} --emote|@{selected|token_name} makes his dailiy preparations... --Poison:| You are preparing your Rogue Poison --Amount:|[[@{selected|level}]] --Regained Hit Points:|[[ @{selected|level}*(1+@{selected|constitution_modifier}) ]] }} !token-mod --set bar1_value|[[ @{selected|level}]] The last "TokenMod" command is for the amount of poison in Bar 1
1594687877

Edited 1594689498
Kurt J.
Pro
API Scripter
H0ND0 said: Hello, and again a noob api question :-) I am using PowerCards API, Alter Bars API, (and TokenMod if that would be any help) and the Pathfinder2 sheet. Hit Points are in Bar 3. I want to make a "Rest" Macro.  The formula for regaining hit points from resting is: you regain Hit Points equal to your Constitution modifier (minimum 1) times your level The relevant Abilities from the sheet are level constitution_modifer Question #1: what would be the formula for Alter Bars? (Or TokenMod if it is easier with that script) Question #2: How do i implement this formula into PowerCards? (with the Amount being shown in PowerCards)? Question #3: How do i get Alter Bars to heal that amount automatically without overhealing? (Or TokenMod if this is used) It should look like this: The regained hit point formula in this example is wrong (it's --Regained Hit Points:|[[ @{selected|level}*(1+@{selected|constitution_modifier}) ]] because i don't know how the implement the "minimum" in the formula). For the healing, i tried to use a variable within PowerCards....but i won't work (i guess because i can't get variables running...dunno why...beside "myself" as a reason....i just don't get it how they work) So.....hopefully someone can help me (after some hours trying this or that and going mad about it) Thank you very much in advance !!!! Steve / H0ND0 EDIT: The complete macro so far (bar 1 is the numbers of rogue poison the character has available) !power {{ --titlebackground|none --titlefontshadow|none --format|recharge --name|Daily Preparations --tokenid|@{selected|token_id} --emote|@{selected|token_name} makes his dailiy preparations... --Poison:| You are preparing your Rogue Poison --Amount:|[[@{selected|level}]] --Regained Hit Points:|[[ @{selected|level}*(1+@{selected|constitution_modifier}) ]] }} !token-mod --set bar1_value|[[ @{selected|level}]] The last "TokenMod" command is for the amount of poison in Bar 1 I do have a solution for you below, but I want to jump in first and clarify that PowerCards doesn't really support variables. You can assign the results of rolls to RollIDs which can be used to display text or make comparisons in conditionals, but they cannot be used in other rolls or other ways you would traditionally use a variable (performing calculations to generate a new value, etc.). All rolls in PowerCards happen at the same time before the card gets processed. What would work for your situation is something like this: !power {{ --name|Recovery --hroll|[[ [$min] @{selected|level}d1 ]] [[ [$max] (@{selected|level}d1) * @{selected|constitution_mod} ]] --?? $min >= $max ?? Recovery *1|@{selected|character_name} recovers [! [^min] !] hit points --?? $min >= $max ?? alterbar1|_target|@{selected|token_id} _bar|3 _amount|[^min] _show|all --?? $min < $max ?? Recovery *2|@{selected|character_name} recovers [! [^max] !] hit points --?? $min < $max ?? alterbar2|_target|@{selected|token_id} _bar|3 _amount|[^max] _show|all }} Both rolls take place in the hroll, one simply rolls a d1 for each character level. The second does the same but also multiplies by the constitution modifier. If the constitution modifier is negative or 0, the resulting number will be lower than the result of rolling (level)d1, so $min will be larger than $max and the two conditional lines for that case (using the minimum of 1 per level) will be used. Otherwise the two lines for min<max will be used. Alterbars contains a PREVENT_OVERMAX variable that defaults to true to prevent bars from going over their defined max. 
1594689547
Kurt J.
Pro
API Scripter
(If you already read the above, I edited the card to correct two instances of Recovery *1 :))
Kurt......thank you very much for your quick help!!!! Thank you for taking so much time....not only giving me the right macro....but to explain a lot what is going on with PowerCards! Awesome !!!!!!