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

How to use Token-Mod to reduce maximum but not current hit points - REQUEST

February 17 (1 month ago)

I use the below to increase the current and max hit points for an effect such as AID. How can this be modified to reduce ONLY the max but leave the current alone?


!token-mod {{ 

  --set bar1|[[{ (0@{selected|bar1} + 0d0+?{How many hit points do you increase?|0} ),  (0@{selected|bar1|max}d1 + (999)) }kl1 ]] 

 --report

    all|"{name} gained or lost  {bar1_value:abschange} hit points"

    gm|"{name} has {bar1_value}/{bar1_max} hp"

  --ids @{selected|token_id} 

}}

February 17 (1 month ago)
timmaugh
Pro
API Scripter

I'm not at my PC at the moment, but you can explicitly refer to the max value without referring to the current. I think it's using bar1_max instead of bar1. It's in the TokenMod help, if you get a chance to look it up before I can.

February 18 (1 month ago)

 !token-mod --help  I looked at the chat prompts but am still missing something. If someone wouldn't mind updating my script to subtract from Max Hit Points only, I would greatly appreciate the help :) Below was used to increase both current and max (except for the prompt change):


!token-mod {{ 

  --set bar1|[[{ (0@{selected|bar1} + 0d0+?{How many hit points do you decrease from Max Hit Points?|0} ),  (0@{selected|bar1|max}d1 + (999)) }kl1 ]] 

 --report

    all|"{name} lost  {bar1_value:abschange} hit points"

    gm|"{name} has {bar1_value}/{bar1_max} hp"

  --ids @{selected|token_id} 

}}

February 18 (1 month ago)

Edited February 18 (1 month ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Hi Barry!

Try this:

!token-mod {{ 
  --set bar1_max|[[{ (0@{selected|bar1_max} + 0d0+?{How many hit points do you decrease from Max Hit Points?|0} ),  (0@{selected|bar1|max}d1 + (999)) }kl1 ]] 
 --report
    all|"{name} lost  {bar1_max:abschange} hit points"
    gm|"{name} has {bar1_value}/{bar1_max} hp"
  --ids @{selected|token_id} 
}}