The Aaron said: I'm thinking: Use the same detection as GroupInitiative for if someone is a PC and don't remove them. Label dead monsters with (dead) or similar in the turn order. Remove dead monsters on their turn, but whisper a restore button to the GM. And some configuration around all of that. Looking back through some old campaigns, I found a snippet for auto-removal of tokens from the turn order that someone (probably you) wrote for me along the way. It just removes all tokens from the turn order - no restore or labeling functions. Would it be easier to modify this, rather than add it to the TurnMarker script? on('ready',function() {
'use strict';
// Threshold to be equal to or less than to get removed
var threshold = 0;
// Activate on a change to the value of bar1
on('change:graphic:bar1_value',function(obj){
var turnorder;
// if the value is below or equal
if( obj.get('bar1_value') <= threshold ){
// grab the current turnorder
turnorder = Campaign().get('turnorder');
// if it's the empty string, then just treat it as an array,
// otherwise decode it as a JSON string into the array of turns
turnorder = ('' === turnorder) ? [] : JSON.parse(turnorder);
// Get a version of it without the token we were activated for
turnorder = _.reject(turnorder, function(i){
return obj.id === i.id;
});
// encode the array as a JSON string and
// stuff it back in the turnorder property of the Campaign
Campaign().set('turnorder',JSON.stringify(turnorder));
}
});
});