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

5e Macro Question (Channel Divinity: Preserve Life)

Hi, I made a macro for our Cleric in order to find out how many hitpoints he can spent to each member of the party, it works, but unfortunately only if a character uses the average hitpoint system during level up. Also the macro seems kind of clunky and I'd like to know if there is a more subtle way to work the macro. Here is the macro so far (I cut after one character, but in the final version all characters from the party are included): /w GM &{template:npcaction}{{rname=Channel Divinity}}{{name=Preserve Life}}{{description=You present your holy symbol and evoke healing energy that can restore [[@{Hannach Khâz|caster_level}*5]] hitpoints. Choose any creatures within 30 feet of you, and divide those hit points among them. This feature can restore a creature to **no more than half of its hit point maximum**. You can't use this feature on an undead or a construct. *You can heal:* _______________________ Khan = [[[[{{{@{Khan|hp},@{Khan|hp}}>[[((@{Khan|hitdie_final}+((@{Khan|hitdie_final}/2)+1)*(@{Khan|level}-1))+(@{Khan|constitution_mod}*@{Khan|level})/2)]]}-2}*-1}}]]*[[[[[[ceil(((@{Khan|hitdie_final}+((@{Khan|hitdie_final}/2)+1)*(@{Khan|level}-1))+(@{Khan|constitution_mod}*@{Khan|level}))/2)]]-[[@{Khan|hp}}]]]]/2]]]] hitpoints. }} If you need further explanation I'm happy to fill you all in with the details. Thanks in advance for your help, Robert 
If you are trying to find how much you can  heal per party member, wouldn't it just be: (max hp / 2) - current hp ? Someone smarter than me will probably come in and explain how to do it better.
1558106574

Edited 1558106875
Evan said: If you are trying to find how much you can  heal per party member, wouldn't it just be: (max hp / 2) - current hp ? Someone smarter than me will probably come in and explain how to do it better. ...which would give you a negative number in case your current hp are higher than half your max hp value. Lets assume your characters max hp are 40 and the character has lost 10 hp. The character would've have 30 hp left. So (40 / 2) - 30 = -10. I wanted to first find out if the character is below half-max-hp-threshold and than go on and figure out what amount would be needed to bring the character back to max hp / 2. In the macro I'm figuring out if your character is below half hit point level and and only than post the number needed to go up to max hp/2; in every other case it just say's 0. I'm just wondering if there is a way to do it in a cleaner way and without to calculate max hp... Robert
I wanted to first find out if the character is below half-max-hp-threshold and than go on and figure out what amount would be needed to bring the character back to max hp / 2. What is this all about?
1558109986

Edited 1558110195
I'm very novice with macro scripting but, assuming you're using OGL sheet, you could do something like this - I think this works. EDIT: You probably also want to hard code character name instead of selected in your case.   [[{0,[[@{selected|hp|max}/2 - @{selected|hp}]]}kh1]]
aisforanagrams said: I'm very novice with macro scripting but, assuming you're using OGL sheet, you could do something like this - I think this works. EDIT: You probably also want to hard code character name instead of selected in your case.   [[{0,[[@{selected|hp|max}/2 - @{selected|hp}]]}kh1]] Yes, that's exactly what I was looking for. Thanks a thousand times. I couldn't get @{selected|hp|max} get to work, as I was thinking @{selected|hp_max} all the time; kh1 is better than my clumsy way around ;) Robert 
1558115161

Edited 1558115185
No problem!  The main roadblock that prevents me from fiddling around with macros more is the total lack of proper documentation on character sheets.  (Maybe there is one somewhere if someone can point me to it).  And my time is better spent prepping for a session than experimenting for hours to find the right attribute name or syntax for macros. Oh well.