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

Chatsetattr Issue

1653128664

Edited 1653131190
Denis  said: I actually corrected it a little bit so it checks the box instead of making the global attack boxes appear or disappear. So it looks like this. !token-mod --set statusmarkers|!blue !setattr --sel --silent --repeating_savemod_$0_global_save_active_flag|[[1-@{selected|repeating_savemod_$0_global_save_active_flag}]] --repeating_tohitmod_$0_global_attack_active_flag|[[1-@{selected|repeating_tohitmod_$0_global_attack_active_flag}]] I'm looking for something similar but for the global damage modifiers, but it doesn't seem to work... what am i doing wrong ? I checked on the reference described below on the Wiki Global modifiers globalmagicmod Global Save Modifier:  globalsavemod repeating_savemod_$0_global_save_roll repeating_skillmod_$0_global_skill_roll repeating_tohitmod_$0_global_attack_roll repeating_damagemod_$0_global_damage_damage repeating_acmod_$0_global_ac_val But it doesn't do anything on the selected's character sheet.  Here's my macro : !setattr --sel --silent --repeating_damagemod_$0_global_damage_damage_active_flag|[[1-@{selected|repeating_damagemod_$0_global_damage_damage_active_flag}]] Can someone pinpoint my mistake ? Thx for your help EDIT: Using 5e OGL sheet
Nobody ?
1653213104

Edited 1653213759
Oosh
Sheet Author
API Scripter
You have an extra 'damage' in there. Try: repeating_damagemod_$0_global_damage_active_flag It always pays to check long attribute names before plugging them into an API script. If you just do a quick @{selected|repeating_damagemod_$0_global_damage_ damage_ active_flag} in chat, you'll see straight away the attribute doesn't exist. Using the HTML inspector in the browser is the fastest way to find an attribute name: right click the element and click 'Inspect'. Repeating sections are a bit tricky, but somewhere above the element you inspect will be another element with class="repcontainer". This one contains the repeating section name under a 'data-groupname' property. The element you inspect will have the attribute under a 'name' property prefixed with "attr_": Put them together with a row index in the middle, and you get your full attribute name: repeating_damagemod_$X_global_damage_active_flag
Ok, thanks i'll try that. guess the wiki for chatsetattr needs a little update then... ;) thanks
1653213699
Oosh
Sheet Author
API Scripter
Quite possibly, though the part you posted contains: repeating_damagemod_$0_global_damage_damage That's a legitimate attribute, using the "global_damage" tag common to that section, and it's the damage expression for that mod. Granted, they could have chosen a much better name that didn't have consecutive "damage" words, but in the grand scheme of the 5e sheet's choice of attribute names, it's on the acceptable side :) At least it isn't completely and absolutely the wrong way around, like spell slots.
1653231403
Andreas J.
Forum Champion
Sheet Author
Translator
Anyone can update the wiki, so please update whatever mistake you spotted.
It's probably more my lack of understanding and coding proficiency that misled me in the comprehension of the wiki lines.  It's all right now, with a little help i got it working.  Thanks for your answers and help.