Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Can TokenMod do this or something else?

Was wondering how I can make toggling "Is Drawing" off easier.  Every time I drag a card onto the field, I hafta take off "Is Drawing" to make it snap to the grid.  Is there maybe a macro that can accomplish this?
I believe so, the attribute is called isdrawing. So unless TokenMod has a stipulation on the subtype 'token' it should work the same for a graphic
1504809447
The Aaron
Pro
API Scripter
It can.  You can use this command: !token-mod --off isdrawing If this is behavior you want for all cards, you could also use this little API script: on('ready',()=>{ on('create:graphic',(o)=>{ if(o.get('subtype')==='card'){ _.defer(()=>o.set('isdrawing',false)); } }); });
Thanks Aaron - I installed that script, but I see no behavior change with my cars. Is Drawing is still checked. I have like 10 decks if that makes a difference.
1504893397
The Aaron
Pro
API Scripter
Shouldn't  I'll give it a quick test.  I might need to make it: on('ready',()=>{ on('create:graphic',(o)=>{ if(o.get('subtype')==='card'){ _.delay(()=>o.set('isdrawing',false),100); } }); });
1504894046
The Aaron
Pro
API Scripter
ah.. Add, not Create.. Here: on('ready',()=>{     on('add:card',(o)=>{         _.defer(()=>{             o.set({                 isdrawing:false             });         });     }); }); This will cause it to snap on subsequent moves.  If you want it to get snapped on the initial drop, I can add that in, just a bit of math...
Thanks!
It looks like this is doing great for us, but snap on drop would be even better if you get some time, Aaron. TIA
1505070708

Edited 1505070717
The Aaron
Pro
API Scripter
Can do!  Back in a bit...
1505078751
The Aaron
Pro
API Scripter
Here ya go! on('ready',()=>{     on('add:card',(o)=>{         _.defer(()=>{             const gridSize=(getObj('page',o.get('pageid'))||{get:()=>1}).get('snapping_increment')*70;             let w=o.get('width'),                 h=o.get('height'),                 x=(Math.floor((o.get('left')-(w/2))/gridSize)*gridSize)+(w/2),                 y=(Math.floor((o.get('top')-(h/2))/gridSize)*gridSize)+(h/2);             o.set({                 isdrawing:false,                 top: y,                 left: x             });         });     }); }); This even respects if you change the size of the grid. =D
You're amazing
1505231432
The Aaron
Pro
API Scripter
Hahahahaha!  Happy Rolling!