Advertisement Create a free account

[Script] ScaleOnAdd -- Auto dimension setting script for tiles based dungeon

1447602579
Phoxounet
Pro
Sheet Author
Translator
Hi there ! I recently bought a tile set for dungeon mapping. Unfortunaltely, tiles, when dragged and dropped on the map, are 140x140 sized, even if they originally are 420x420 px. (I dled the set to check it). You can view my problem in this  thread . My request is a scripted button that would ask me which default dimensions I want (like 420x420 instead of 140x140) that would apply these new dimensions automatically to all tiles I would drag and drop from my library to the map, instead of the default 140x140 for my set. Many thanks. :)
1447803614

Edited 1447847890
The Aaron
Forum Champion
API Scripter
ScaleOnAdd v0.1.0 Commands: !scale-on-add --help : shows the help screen --toggle : switches the scaling on/off --on : switches scaling explicitly on --off : switches scaling explicitly off --set &lt;number|width&gt; [height] : sets the scale to number X number or width X height (If you specify 2 numbers) Example Commands: Turns on Scaling when adding: !scale-on-add --on Sets the scaling to 140 x 280: !scale-on-add --set 140 280 Sets the scaling to 420 x 420: !scale-on-add --set 420 Toggle Scaling on and off: !scale-on-add --toggle Check current settings or read the help: !scale-on-add Git:&nbsp; <a href="https://github.com/shdwjk/Roll20API/blob/master/Sc" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/Sc</a>... Enjoy! &nbsp;=D
1447803780
Silvyre
Forum Champion
The Scriptomancer strikes again!
1447804649
The Aaron
Forum Champion
API Scripter
Yup! &nbsp;Sorry, would have hit it earlier but I was out deer hunting. =D &nbsp;
1447831218
Phoxounet
Pro
Sheet Author
Translator
Hi ! Thank you soooooo much ! This is exactly what I wanted. :D Anyway, I have a little noob problem now : i can't find your script in the github api depository and there is no script in your message. So, where is it ? :p Again, you have my deepest gratitude, Scriptomancer ! ;)
1447832347
Silvyre
Forum Champion
<a href="https://github.com/shdwjk/Roll20API/tree/master/Sc" rel="nofollow">https://github.com/shdwjk/Roll20API/tree/master/Sc</a>...
1447847947
The Aaron
Forum Champion
API Scripter
Oh SNAP! &nbsp; Thanks Silvyre! &nbsp; Sorry about that, in my zeal I forgot to add it. =D
1447964571
Phoxounet
Pro
Sheet Author
Translator
Ok, it is absoletuly amazing : exactly what I was looking for. Thank you so much, Aaron ! :D
1447964780
The Aaron
Forum Champion
API Scripter
No worries, happy to help! &nbsp;=D
1448033639
The Aaron
Forum Champion
API Scripter
You may have figured this out already, but if you see: "unexpected token var" That usually means one of the scripts doesn't have a trailing ; Two scripts: var foo = 12 var bar = bar || (function(){ return {do: function(){log('test');}};}()); when concatenated by the API server will end up with: var foo = 12 var bar = bar || (function(){ return {do: function(){log('test');}};}()); which causes the error on the second (bolded above) var . Many scripts will begin with a ; just to prevent that issue: ; var bar = bar || (function(){ return {do: function(){log('test');}};}()); I should probably get in that habit. &nbsp;=D