Some clarification on when attributes do not show up on the Attributes tab: Repeating section attributes never show up there. Attributes from character sheets that only have their default value do not show up there. Probably what is happening is the attribute you're using has a default value. In that case, you'll have to grab it with getAttrByName() (Which should really be called "GetAttrVALUEbyNameOrDefaultValueOrZero()" =D). You could do that as part of the create: let attr = (findObjs({
type: 'attribute',
characterid: c.id,
name: 'someattr'
})[0] || createObj('attribute', {
characterid: c.id,
name: 'someattr',
current: getAttrByName(c.id, 'someattr'),
max: getAttrByName(c.id, 'someattr', 'max')
}));
log(`Attr ${attr.get('name')} fetched with value ${attr.get('current')}/${attr.get('max')}`);
attr.set({
current: 5,
max: 23
});