Gary W. said: Thank you for all the responses- I think I will give each character a new trait called Bardic Inspiration with a max of 1 usage. Every character will have it in the same spot on the trait/feature list. So long as ChatSetAttr lets me refer to that trait as $1 it should work, right? Kind of . There's 2 problems: 1) But note Edit 2 below for a more elegant solution. ChatSetAttr doesn't know if your traits have been reordered. So it really needs to be the second (- first is $0) trait created on that character, not the second trait in the current list, for it to refer to the correct trait with $1 (sorry, technical limitation, API does not know the row number). You will need to delete all current traits (save 1), add your inspiration trait, then re-add the rest. 2) Currently, ChatSetAttr does not allow your players to modify attributes on characters they do not control. I'll add a setting for this to ChatSetAttr, but for now, you can take the current Github code and just replace the checkPermissions function (lines 420-437) by checkPermissions = function (list, errors, playerid) {
let control, character, remove = [];
_.each(list, function (id, k) {
character = getObj('character', id);
if (!character) {
errors.push(`Invalid character id ${id}.`);
remove.push(k);
}
});
_.each(remove.reverse(), i => list.splice(i,1));
return list;
},
Then something like !setattr --mod --charid @{target|character_id} --repeating_trait_$0_uses|1 should work. EDIT: In fact you better just use !setattr --charid @{target|character_id} --repeating_trait_$0_uses|1 without the --mod, since you just want to set uses to 1. EDIT 2: You don't need to change all the traits to be in spot 1. Indeed, you can also create an extra attribute (say inspiration_id) on every PC that just holds the repeating row id of the bardic inspiration trait, e.g. -KncB78ShdcB6sdGcb2E. Then you could do it with !setattr --charid @{target|character_id} --repeating_trait_@{target|inspiration_id}_uses|1