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 Shaped ChatSetAttr] Trying to use the result of a query to modify an attribute

1555782054

Edited 1555783835
Hey guys, I've been working on creating a macro for a staff of healing for a few days now, I've almost succeeded , I could make the abilities work and track the ressources for Mass Cure Wounds and Lesser Restoration that have static uses values from the same staff, but now, I'm trying to do the same for Cure Wounds that can use from 1 to 4 charges. The ability I created so far is as below: @{Archibald Colombus Everleigh|output_option} &{template:5e-shaped} {{character_name=@{Archibald Colombus Everleigh|character_name}}} @{Archibald Colombus Everleigh|show_character_name} {{title=Cure Wounds}} {{spell=1}} {{spell_first_line=1}} @{Archibald Colombus Everleigh|attacher_spell} @{Archibald Colombus Everleigh|attacher_spell_level_1} {{spell_level=^{1ST_LEVEL}}} {{school=^{EVOCATION}}}  {{casting_time=^{1_ACTION}}} {{range=Touch}} {{components=^{COMPONENTS_V_S}}} {{materials=}} {{duration=^{INSTANTANEOUS}}} @{Archibald Colombus Everleigh|hide_gm_info} {{@{Archibald Colombus Everleigh|shaped_d20}=1}} {{content=A creature you touch regains a number of hit points equal to 1d8 + your spellcasting ability modifier. This spell has no effect on undead or constructs.}} {{heal=[[4[int] + ?{How many charges?|1|2|3|4}d8[heal]]]}} {{higher_level=At Higher Levels: When you cast this spell using up to four charges, the healing increases by 1d8 for each charge.}} But I'm struggling with the ChatSetAttr part, I want to use the result of the query for charges . {{heal=[[4[int] + ?{How many charges?|1|2|3|4}d8[heal]]]}} Tried this but it doesn't work: !modbattr --charid @{character_id} --repeating_utility_-LcYhvZp6dIysD46x0FD_uses|?{How many charges?}? For comparison, this the ability I created for mass cure wounds that works perfectly: &{template:5e-shaped} {{character_name=@{Archibald Colombus Everleigh|character_name}}} @{Archibald Colombus Everleigh|show_character_name} {{title=Mass Cure Wounds}} {{spell=1}} {{spell_first_line=1}} @{Archibald Colombus Everleigh|attacher_spell} @{Archibald Colombus Everleigh|attacher_spell_level_5} {{spell_level=^{5TH_LEVEL}}} {{school=^{EVOCATION}}}  {{casting_time=^{1_ACTION}}} {{range=60 feet}} {{components=^{COMPONENTS_V_S}}} {{materials=}} {{duration=^{INSTANTANEOUS}}} @{Archibald Colombus Everleigh|hide_gm_info} {{@{Archibald Colombus Everleigh|shaped_d20}=1}} {{content=A wave of healing energy washes out from a point of your choice within range. Choose up to six creatures in a 30-foot-radius sphere centered on that point. Each target regains hit points equal to 3d8 + your spellcasting ability modifier. This spell has no effect on undead or constructs.}} {{heal=[[3d8[heal] + 4[int]]]}} !modbattr --charid @{character_id} --repeating_utility_-LcYhvZp6dIysD46x0FD_uses#-5 --silent As a bonus, it would be awesome if it could change the usual automatic chat message with one saying : X charges remaining on the staff of healing. Tried using --fb-content and _TCUR J _: but I failed.
1555998013
Jakob
Sheet Author
API Scripter
Have you tried this: !modbattr --charid @{character_id} --repeating_utility_-LcYhvZp6dIysD46x0FD_uses|-?{How many charges?} (make sure you get the ID right). In your attempt, you didn't have a minus (I assume you want to decrease  the number of charges), and you had an extra "?" at the end (which might mess up parsing it as a number). I don't have time right now to look into the feedback. You can also disable the feedback message completely with --silent.
Thank you Jakob for taking the time to help me, I'm so new to all this it took me days to do all this and I made many mistakes along the way. The changes you made work perfectly and it tracks the charges just fine. For the feedback, it was more of a luxury, so I understand if it's asking for too much. Thanks again for the help!