Unfortunately, this is still an outstanding bug with custom roll parsing. There is a workaround though. The workaround requires the following: action buttons as hidden elements with a name different from the roll button they are replacing (maybe something like the original button's name + "action", e.g. athletics-action ) A hidden attribute for each button, for simplicity sake name this the same as your action button, but replacing the dash with an underscore (e.g. athletics_action ) Roll buttons remain the visible button on the sheet, but change their value property to be an attribute reference to the hidden attribute (e.g. @{athletics_action} ) So, your action buttons refer to what is currently an empty attribute. We're going to fix that with sheetworkers which will populate these attributes with an ability call to the action button. The reason we need to do it this way is that the call has to have the character's name in it (e.g. %{John Smith|athletics_action}), and there's no way to do that directly in the html. So, we'll make a sheetworker that triggers when the sheet is opened and when the character's name is changed. This is going to look rather large because it requires iterating through repeating sections and over a ton of attributes. I've included some infrastructure to do that. //A function to combine getting repeating and non repeating attributes.
const getAllAttrs = function(props,sectionDetails,callback){
getSections(sectionDetails,(repeats,sections)=>{
getAttrs([...props,...repeats],(attributes)=>{
callback(attributes,sections);
})
});
};
//Iterates over the provided repeating sections and assembles an array of attributes to get from those sections for each row.
const getSections = function(section_details,callback){
let queueClone = _.clone(section_details);
const worker = (queue,repeatAttrs=[],sections={})=>{
let detail = queue.shift();
getSectionIDs(detail.section,(IDs)=>{
sections[detail.section] = IDs;
IDs.forEach((id)=>{
detail.fields.forEach((f)=>{
repeatAttrs.push(`${detail.section}_${id}_${f}`);
});
});
repeatAttrs.push(`_reporder_${detail.section}`);
if(queue.length){
worker(queue,repeatAttrs,sections);
}else{
callback(repeatAttrs,sections);
}
});
};
if(!queueClone[0]){
callback([],{});
}
worker(queueClone);
};
const repeatingSections = [{section:'repeating_attack',fields:['attack_1_action','attack_2_action']},{section:'repeating_ability',fields:['action']}];//Replace these with your sheet's repeating sections
const actionRefs = ['athletics_action','strength_action','charisma_action'];//Replace these with the non repeating attributes for your sheet.
const actionCallUpdate = function(){
getAllAttrs(['character_name',actionRefs],repeatingSections,(attributes,sections)=>{
let actions = Object.keys(attributes).filter((key)=>key!=='character_name');
const setObj = actions.reduce((accumulator,actionName)=>{
accumulator[actionName] = `%{${attributes.character_name}|${actionName.replace(/_/g,'-')}}`;//Update the action call
return accumulator;//The memo (accumulator in this case) must always be returned when using a reduce function
},{});
setAttrs(setObj,{silent:true});//Apply the changes
});
};
on('sheet:opened change:character_name',actionCallUpdate); Hope that helps!