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

Sexond Wind macro & API

Does anyone have a macro that is effective on Second Wind? I create this.... but it has various problems /em @{selected|token_name} saca fuerza de su interior restableciendo algunas de sus heridas! &{template:simple} {{rname=Second Wind}} {{r1=[[1d10 + @{base_level}]]}} {{normal=1}} {{charname=@{selected|character_name}}} !token-mod --charid @{selected|token_id} --set bar3_value|+[[1d10 + @{base_level}]]}} {{normal=1}} !ammo @{selected|character_id} other_resource -1 Second Wind 1. problem (It doesn't heal what comes out in the chat, but seems to make another roll and it is the one that heal) 2. the heal can exceed the maximum hp, therefore it is a failure 3. I use the API aura/tint, and the effect of green sparks is not seen when healing
Any ideas? how do you handle Second Wind? guys
1. It's not healing because you don't have a name/id reference for the 'base_level' attribute.  It needs to be @{selected|base_level} or @{NAME|base_level}. 2. You should be able to use a variation of the  same inline roll as the other macro  a few days ago:  {{r1=[[{[[1d10 + @{selected|base_level}]],[[@{selected|hp|max}-@{selected|hp}]]}kl1]]}} 3. Your TokenMod API call is not properly formed. You are missing the name/id reference for the 'base_level' attribute, and you have extra characters at the end of the line. !token-mod --charid @{selected|token_id} --set bar3_value|+[[1d10 + @{selected|base_level}]] I haven't tested this, but this should be the whole macro: /em @{selected|token_name} saca fuerza de su interior restableciendo algunas de sus heridas! &{template:simple} {{rname=Second Wind}} {{r1=[[{[[1d10 + @{selected|base_level}]],[[@{selected|hp|max}-@{selected|hp}]]}kl1]]}} {{normal=1}} {{charname=@{selected|character_name}}} !token-mod --charid @{selected|token_id} --set bar3_value|+[[1d10 + @{selected|base_level}]] !ammo @{selected|character_id} other_resource -1 Second Wind
Jarren K. said: 1. It's not healing because you don't have a name/id reference for the 'base_level' attribute.  It needs to be @{selected|base_level} or @{NAME|base_level}. 2. You should be able to use a variation of the  same inline roll as the other macro  a few days ago:  {{r1=[[{[[1d10 + @{selected|base_level}]],[[@{selected|hp|max}-@{selected|hp}]]}kl1]]}} 3. Your TokenMod API call is not properly formed. You are missing the name/id reference for the 'base_level' attribute, and you have extra characters at the end of the line. !token-mod --charid @{selected|token_id} --set bar3_value|+[[1d10 + @{selected|base_level}]] I haven't tested this, but this should be the whole macro: /em @{selected|token_name} saca fuerza de su interior restableciendo algunas de sus heridas! &{template:simple} {{rname=Second Wind}} {{r1=[[{[[1d10 + @{selected|base_level}]],[[@{selected|hp|max}-@{selected|hp}]]}kl1]]}} {{normal=1}} {{charname=@{selected|character_name}}} !token-mod --charid @{selected|token_id} --set bar3_value|+[[1d10 + @{selected|base_level}]] !ammo @{selected|character_id} other_resource -1 Second Wind It doesn't seem to work at all well.... It doesn't heal the hp shown in the chat window, it heals another amount (it seems like a different roll) And it can be healed above the maximum hp With this roll, the token does not heal 11, instead 11 another quantity was cured The same in this image Proof. Token max hp= 31. I set the token to 30 hp, then i roll the Second Wind macro, and in the chat shows 1 hp, but the token finally restores an amount of 6. (5 above the max.)
1610026024

Edited 1610026062
David M.
Pro
API Scripter
I see two problems The first is that you have separate d10 die rolls for the template output and the token-mod "healing". The second is that you'll need to have a kl1 inline roll for the bar3 adjustment to limit the actual healing to the max value.  Due to the limitation of re-used die rolls (can't re-use the roll from the 5e template for the token-mod call), one solution is to use the --report command from token-mod. See the token-mod documentation for the --report command, and  this post for usage reference.  So your macro could be something like /em @{selected|token_name} saca fuerza de su interior restableciendo algunas de sus heridas! !token-mod {{ --charid @{selected|token_id} --set bar1_value|+[[{[[1d10 + @{selected|base_level}]],[[@{selected|hp|max}-@{selected|hp}]]}kl1]] --report all|"Amount healed by Second Wind = {bar1_value:abschange}hp." }} !ammo @{selected|character_id} other_resource -1 Second Wind It's not as pretty as the 5e template, but aside from incorporating token-mod into a powercard macro (definitely possible, but not my forte), I'm not sure there is a way to have the same value both displayed in a template and used by token-mod. 
David M. said: I see two problems The first is that you have separate d10 die rolls for the template output and the token-mod "healing". The second is that you'll need to have a kl1 inline roll for the bar3 adjustment to limit the actual healing to the max value.  Due to the limitation of re-used die rolls (can't re-use the roll from the 5e template for the token-mod call), one solution is to use the --report command from token-mod. See the token-mod documentation for the --report command, and  this post for usage reference.  So your macro could be something like /em @{selected|token_name} saca fuerza de su interior restableciendo algunas de sus heridas! !token-mod {{ --charid @{selected|token_id} --set bar1_value|+[[{[[1d10 + @{selected|base_level}]],[[@{selected|hp|max}-@{selected|hp}]]}kl1]] --report all|"Amount healed by Second Wind = {bar1_value:abschange}hp." }} !ammo @{selected|character_id} other_resource -1 Second Wind It's not as pretty as the 5e template, but aside from incorporating token-mod into a powercard macro (definitely possible, but not my forte), I'm not sure there is a way to have the same value both displayed in a template and used by token-mod.  Ah, good catches there, David. This might be able to done in a hacky way, by using ChatSetAttr to create/update a custom field for healing each time this gets rolled: !setattr --silent --name @{selected|token_name} --healedhp|[[{[[1d10 + @{selected|base_level}]],[[@{selected|hp|max}-@{selected|hp}]]}kl1]] /em @{selected|token_name} saca fuerza de su interior restableciendo algunas de sus heridas! &{template:simple} {{rname=Second Wind}} {{r1=@{selected|healedhp}}} {{normal=1}} {{charname=@{selected|character_name}}} !token-mod --charid @{selected|token_id} --set bar3_value|+@{selected|healedhp} !ammo @{selected|character_id} other_resource -1 Second Wind Again, I haven't tested this, but the basic idea should work, unless there's something funky that happens with the order of operations (if the healedhp attribute gets filled into the template and token-mod calls before it gets updated by ChatSetAttr for example).
1610034139
David M.
Pro
API Scripter
Clever, but I'm pretty sure your fears are justified. There will likely be an order of operations problem with that approach, since the attribute calls would all be resolved before the roll queries are executed.
1610058439

Edited 1610058470
David M. said: I see two problems The first is that you have separate d10 die rolls for the template output and the token-mod "healing". The second is that you'll need to have a kl1 inline roll for the bar3 adjustment to limit the actual healing to the max value.  Due to the limitation of re-used die rolls (can't re-use the roll from the 5e template for the token-mod call), one solution is to use the --report command from token-mod. See the token-mod documentation for the --report command, and  this post for usage reference.  So your macro could be something like /em @{selected|token_name} saca fuerza de su interior restableciendo algunas de sus heridas! !token-mod {{ --charid @{selected|token_id} --set bar1_value|+[[{[[1d10 + @{selected|base_level}]],[[@{selected|hp|max}-@{selected|hp}]]}kl1]] --report all|"Amount healed by Second Wind = {bar1_value:abschange}hp." }} !ammo @{selected|character_id} other_resource -1 Second Wind It's not as pretty as the 5e template, but aside from incorporating token-mod into a powercard macro (definitely possible, but not my forte), I'm not sure there is a way to have the same value both displayed in a template and used by token-mod.  David M. your macro works and does its job,,,,You are right that it doesn't look so "pretty", as it doesn't have a template, but it is definitely not that important. Thx a lot bro.... 
Jarren K. said: David M. said: I see two problems The first is that you have separate d10 die rolls for the template output and the token-mod "healing". The second is that you'll need to have a kl1 inline roll for the bar3 adjustment to limit the actual healing to the max value.  Due to the limitation of re-used die rolls (can't re-use the roll from the 5e template for the token-mod call), one solution is to use the --report command from token-mod. See the token-mod documentation for the --report command, and  this post for usage reference.  So your macro could be something like /em @{selected|token_name} saca fuerza de su interior restableciendo algunas de sus heridas! !token-mod {{ --charid @{selected|token_id} --set bar1_value|+[[{[[1d10 + @{selected|base_level}]],[[@{selected|hp|max}-@{selected|hp}]]}kl1]] --report all|"Amount healed by Second Wind = {bar1_value:abschange}hp." }} !ammo @{selected|character_id} other_resource -1 Second Wind It's not as pretty as the 5e template, but aside from incorporating token-mod into a powercard macro (definitely possible, but not my forte), I'm not sure there is a way to have the same value both displayed in a template and used by token-mod.  Ah, good catches there, David. This might be able to done in a hacky way, by using ChatSetAttr to create/update a custom field for healing each time this gets rolled: !setattr --silent --name @{selected|token_name} --healedhp|[[{[[1d10 + @{selected|base_level}]],[[@{selected|hp|max}-@{selected|hp}]]}kl1]] /em @{selected|token_name} saca fuerza de su interior restableciendo algunas de sus heridas! &{template:simple} {{rname=Second Wind}} {{r1=@{selected|healedhp}}} {{normal=1}} {{charname=@{selected|character_name}}} !token-mod --charid @{selected|token_id} --set bar3_value|+@{selected|healedhp} !ammo @{selected|character_id} other_resource -1 Second Wind Again, I haven't tested this, but the basic idea should work, unless there's something funky that happens with the order of operations (if the healedhp attribute gets filled into the template and token-mod calls before it gets updated by ChatSetAttr for example). Jarren K. your last macro works very well, but still has the problem that heal above the max hp.  Thx bro... :)