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

Any way for multiple scripts to reside in one folder?

1486456422
plexsoup
Marketplace Creator
Sheet Author
API Scripter
I'm building up the psIsometricSuite. So far it consists of: LightCrumb, psTileResizer, psIsoFacing, psIsoMap, psGUI, psUtils. It'd make sense to have them all in one folder, but I see this isn't the done thing. Can one script.json file contain multiple object definitions, describing the various scripts in a single folder?
1486471786
The Aaron
Pro
API Scripter
Definitely.  Simply concatenate the files together and it will behave identically to having them as multiple tabs in the API.  If you're following the API pattern I use, you only need one on('ready',function(){...}) at the bottom that does all the initialization. Cheers!
1486507329

Edited 1486507366
plexsoup
Marketplace Creator
Sheet Author
API Scripter
Thanks! Just to be clear, you're suggesting concatenating the json file, not the .js files, right? I'm hoping to keep the .js files (modules) separate for ease of editing. So this would be ok:&nbsp; <a href="https://github.com/plexsoup/roll20-api-scripts/tre" rel="nofollow">https://github.com/plexsoup/roll20-api-scripts/tre</a>...
1486509839
The Aaron
Pro
API Scripter
Nope. Other way around. Concatenation the JS files. The script.json would just need to reflect the composite of the scripts.&nbsp; My suggestion would be to look into something like gulp to assemble the script from composites. That's what I do for TheAaronSheet's example files. I can help you with that work flow if you're interested.&nbsp;
1486514956
plexsoup
Marketplace Creator
Sheet Author
API Scripter
Thanks for the suggestion. I wish I could make more sense of the gulp docs.
1486519969
The Aaron
Pro
API Scripter
I highly suggest a guide. It took Kryx a month to beat it into my head. :)
1486546848
Ziechael
Forum Champion
Sheet Author
API Scripter
Not 100% if this would work or be allowed but could you write a 'header' script with one-click capabilities that has all of your Iso Suite as dependencies? That would give people the option to use the scripts in isolation or one-click install the 'header' which would automatically install the full suite of scripts (and maintain their automatic update status too)?
1486550791
plexsoup
Marketplace Creator
Sheet Author
API Scripter
Thanks Ziechael. That should work. Now I have to figure out which files naturally go together and which can stand alone. I like the unix ideal of one program for a single purpose, but I've already broken that ethic with psIsoFacing which also provides a flashlight. (Scope Creep! Bloat!) It may be time for a major refactor anyways, so I'll get some value out of trying to merge the scripts with a rudimentary build-process.