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

Walls script - Lines supported?

1619387953
Nick S.
Pro
Marketplace Creator
Translator
The walls script groups the entire path, which can be problematic if you need to make changes afterwards. I've been trying to separate each individual line by adding a !walls moveto before each curve, and realized it wouldn't be that easy (the final path on Roll20 ends up with some uncovered spots). So quickly checking the script's code I saw (I may be mistaken, js isn't my strong suit. It's not even my weak suit) that !walls lineto should also be supported, so I converted all curves into lines and got an error on the API: TypeError: p.slice(...)[0].slice is not a function TypeError: p.slice(...)[0].slice is not a function     at apiscript.js:118:36     at Array.forEach (<anonymous>)     at buildPath (apiscript.js:115:18)     at Array.forEach (<anonymous>)     at buildWalls (apiscript.js:169:49)     at handleInput (apiscript.js:212:21)     at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:154:1), <anonymous>:65:16)     at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:154:1), <anonymous>:70:8)     at /home/node/d20-api-server/api.js:1663:12     at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 I thought maybe I was doing something wrong, so I tried to convert the svg using roll20api.net, but saw that there "L" was unsupported, and now I'm just not sure. I wanted to know if lines were supported, and if so, what the proper syntax would be to use them. Thanks!
1619389446
The Aaron
Roll20 Production Team
API Scripter
When I wrote it, I only added support for whatever GIMP uses in it's exported SVGs. Probably I didn't add the L type. I've been meaning to redo walls for a while, guess I should prioritize it. 
1619393737

Edited 1619393752
Nick S.
Pro
Marketplace Creator
Translator
That makes sense, I think GIMP only exports as curves; it'd be amazing if it could be updated! If you need any example files to test it out, please let me know and I'll send them your way. Cheers!
There's a script in the API library called PathSplitter that you can use to divide those paths after Walls builds them.
1619471142
Nick S.
Pro
Marketplace Creator
Translator
Thank you for the suggestion, Persephone! I had already tried PathSplitter and it's fine if you need to modify a line or two, but any more than that and it can get frustrating to use as you need to cut across the path several times. It's usable, but I'd rather avoid it.