Setting an attribute to 0 should be like this (didn't test it though, but should be right...): on('ready',function(){
on('change:campaign:turnorder',function(c,oc){
var to = c.get('turnorder'),
cTo = JSON.parse( to ? to : '[]' ),
pTo = JSON.parse( oc.turnorder ? oc.turnorder : '[]'),
barNum = '1', // Change this to whatever bar number you want to zero.
attrName = 'SomeAttribute', // Change to whatever attribute you want to set
t, a ;
if( (cTo.length && !pTo)
|| (cTo.length && pTo.length && cTo[0].id !== pTo[0].id) ) {
t = getObj('graphic',cTo[0].id);
if(t) {
t.set('bar'+barNum+'_value', 0);
a=findObjs({type: 'attribute', characterid: t.get('represents'), name: attrName})[0];
if(a) {
a.set({current: 0});
}
}
}
});
}); Without your Mentor subscription, the API sand box never starts up for you games. As far as I understand it, you could go out of mentorship and your API stops doing anything (like it never existed). You can then subscribe at Mentor level again and everything is back the way it was.