I've come up with a solution for the following issue: Effects are now ONLY assigned to TOKENS! This means that if you change pages, or copy and paste tokens, you will have to then assign the status effects to the new token. I've added the following bits of code to allow the effects from one token to be moved to another. So when changing maps, I can select the token and use the command !StatusCopy. I can then move to another map, select the target i want to move the effects to, and use the command !StatusPaste. It also moves any status icons and tint, even if not associated with this script. I had to add an additional field in the declarations. StatusTracker.CopyFrom = ""; //source CharID Here are the additional commands for !StatusCopy and !StatusPaste. on("chat:message", function(msg){
var cmd = "!StatusCopy"
if (msg.type == "api" && msg.content.indexOf(cmd) !== -1 && msg.who.indexOf("(GM)" !== -1)) {
try {if (msg.selected.length !== 1 && msg.selected._type != "graphic") {
sendChat("","/desc Copy Err: multiple targets");
} else {
StatusTracker.CopyFrom = msg.selected[0]._id;
sendChat("","/desc Copy from " + StatusTracker.getTokenName(StatusTracker.CopyFrom));
}
} catch(err) { sendChat("","/desc Copy Err: no target"); }
}
});
on("chat:message", function(msg){
var cmd = "!StatusPaste"
if (msg.type == "api" && msg.content.indexOf(cmd) !== -1 && msg.who.indexOf("(GM)" !== -1)) {
if (StatusTracker.CopyFrom == "") {
sendChat("","/desc Paste Err: missing source");
return;
}
try {if (msg.selected.length !== 1 && msg.selected._type != "graphic") {
sendChat("","/desc Paste Err: multiple targets");
} else {
if (StatusTracker.CopyFrom == msg.selected[0]._id) {
sendChat("","/desc Paste Err: target is source");
return;
}
_.each(state.activeStatus, function(obj){
if(obj.CharID == StatusTracker.CopyFrom) obj.CharID = msg.selected[0]._id;
});
//move the status icons as well
var moveFrom = getObj("graphic", StatusTracker.CopyFrom);
var moveTo = getObj("graphic", msg.selected[0]._id);
moveTo.set("statusmarkers", moveFrom.get("statusmarkers"));
moveTo.set("tint_color", moveFrom.get("tint_color"));
moveFrom.set("statusmarkers","");
moveFrom.set("tint_color","");
StatusTracker.CopyFrom = "";
sendChat("","/desc Applied to " + StatusTracker.getTokenName(msg.selected[0]._id));
}
} catch(err) { sendChat("","/desc Paste Err: no target"); }
}
}); Hope this helps. Thanks again Josh for a great tool!