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

TokenMod and Lay on Hands 5e OGL

I have scoured the forum looking for Lay on Hands macros and found two I liked (Nick O. & Ed S.), but neither actually applied healing to the receiving character.  I tried using TokenMod for this, but it doesn't seem to work.  I have gotten the query and the other_resource management to work, but it doesn't increase the HP of the target, or any token for that matter.  I'm sure being a novice, I have overlooked something trivial.  Any help is appreciated.  Here is the macro I have cobbled together. @{Alister|wtype}&{template:atkdmg} {{mod=-}} {{rname=Lay On Hands}} {{r1=[[0d20cs>20]]}} {{r2=[[0d20cs>20]]}} 0 {{range=}} 0 {{dmg1=[[0]]}} {{dmg1type=}} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[0[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=Alister used Lay on Hands to heal @{target|character_name}. You can spend 5 HP's to Cure one Disease, or Neutralize one Poison, each round.}}   {{spelllevel=}} {{innate=}} {{globalattack=@{Alister|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Alister|global_damage_mod_type}}} ammo=Lay on Hands, ?{Lay on Hands @{selected|other_resource} points available|0}|-M2nJBJir1BNQYJ1fYTk @{Alister|charname_output} !token-mod --ids @{target|token_id} --set bar1_value|+?{Lay on Hands @{selected|other_resource}
Nick O had a video on applying damage and saves to multiple mobs, perhaps that system could be used for this as well?  I'd offer more but don't use that yet myself.
1586879386
The Aaron
Roll20 Production Team
API Scripter
When debugging calling API commands it's often helpful to leave the ! off the front and just see what the line expands to.  The issue is almost certainly with the roll query. Try: !token-mod --ids @{target|token_id} --set bar1_value|+ ?{Lay on Hands @{selected|other_resource} points available|0}
1586879629
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I'm  not sure you can do this in one macro. You would need to use tokenmod to increment the bar, and chatsetattr to decrement the resource. For tokens that are fully linked (most PCs) you might be able to do it all with ChatSetAttr, since the bar value just reads from the character sheet.
I was wondering myself if I would have to use ChatSetAttr, but The Aaron is correct.  Fixed the query and it applies the heal! Insert "We're not worthy" Wayne's World gif.  Thank you so much, my player will be grateful.
1586907834
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Ah, I thought you were trying to decrement the resource in the same step. My misunderstanding.
1586915338
Dumbhuman
Pro
Marketplace Creator
keithcurtis said: Ah, I thought you were trying to decrement the resource in the same step. My misunderstanding. It looks like the 5th Edition OGL by Roll20 Companion Script might be taking care of that via the ammo command.
keithcurtis said: Ah, I thought you were trying to decrement the resource in the same step. My misunderstanding I was doing both, and the Ammo was working with that.  Thanks.
The Aaron said: When debugging calling API commands it's often helpful to leave the ! off the front and just see what the line expands to.  The issue is almost certainly with the roll query. Try: !token-mod --ids @{target|token_id} --set bar1_value|+ ?{Lay on Hands @{selected|other_resource} points available|0} It worked when I tested it and then it wouldn't work during my game yesterday.  I tired using ChatSetAttr.  It worked once then wouldn't work on subsequent tries.  I then switching it back to being targeted with no luck.  Thoughts? !setattr --name ?{Whom to touch|Alister|Kari Bryde|Pliny the Leech} --modb --HP|?{Lay on Hands @{selected|other_resource} points available|0} or  !setattr --name @{target|character_name} --modb --HP|?{Lay on Hands @{selected|other_resource} points available|0}
1587133131

Edited 1587133187
The Aaron
Roll20 Production Team
API Scripter
OOOH!  I know the problem. Try this: !token-mod --ids @{target|token_id} --set bar1_value|+?{Lay on Hands @{selected|other_resource} points available|0} --ids @{selected|token_id} Nope, that's not it...  hmmm