Ok. Here's a script that will fix this, with a few caveats: It assumes you are using the 5e OGL sheet. If that's not the case, don't run it, let me know. It swaps bar2 and bar3 on all tokens that represent an NPC. • If you're already started swapping them, or you don't want a swap, let me know, I can change it. I sets the default token based on the first token found for a given character It will not affect any NPCs that don't have tokens on the map yet. If any of that doesn't sound right, let me know. I highly recommend copying your game and running this on the copy first. on('ready',()=>{
const fixChar = (npc) => findObjs({type:'graphic',represents:npc.id})
.forEach( (t,i)=>{
t.set({
bar3_link: t.get('bar2_link'),
bar3_value: t.get('bar2_value'),
bar3_max: t.get('bar2_max'),
bar2_link: t.get('bar3_link'),
bar2_value: t.get('bar3_value'),
bar2_max: t.get('bar3_max')
});
if(0===i){
setDefaultTokenForCharacter(npc,t);
}
});
on('chat:message', (msg) => {
if('api' === msg.type && playerIsGM(msg.playerid) && /^!fix-npcs(\b\s|$)/i.test(msg.content)){
let who = (getObj('player',msg.playerid)||{get:()=>'API'}).get('_displayname');
let npcs = (findObjs({
type: "attribute",
name: "npc",
current: "1"
})||[]);
sendChat('',`/w "${who}" Fixing ${npcs.length} NPCs.`);
const burndown = ()=>{
if(npcs.length){
let npc = npcs.shift();
fixChar(npc);
setTimeout(burndown,0);
} else {
sendChat('',`/w "${who}" Finished updating NPCs.`);
}
};
burndown();
}
});
});
The command is: !fix-npcs