I'm going to guess it has to do with charting the location of a token on a star map or something. on('ready', function(){
"use strict";
on('change:graphic',function(obj,prev){
if( ( _.contains(['gmlayer','objects'],obj.get('layer')) ) &&
( obj.get('left') !== prev.left || obj.get('top') !== prev.top) &&
obj.get('represents') ) {
let a=_.chain(findObjs({type: 'attribute',characterid: obj.get('represents')}))
.filter(a=>a.get('name').match(/^position-[xy]$/))
.each(a=>{
switch(a.get('name')){
case 'position-x':
a.set({current: obj.get('left')});
break;
case 'position-y':
a.set({current: obj.get('top')});
break;
}
});
}
});
});
If the token represents a character, then it's attributes named 'position-x' and 'position-y' will be updated when it gets moved, if they exist. Case sensitive. Happy Rolling!