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

Require() or include functionality for other r20 scripts?

It'd be nice if we could run a require or include other scripts from our campaign. This would allow for easier module sharing and better community development by abstracting out complex tasks. I'm just wondering if this is something you would like to support or if you'd be willing to work with someone like myself to set up some kind of a repository like npm or bower  where you can pull down libraries into your roll20 campaign? Cheers!
1367340907
Alex L.
Pro
Sheet Author
we could use GIST as the repo so to include erics status manager you would have Require(" edalquist/5488958 "); Then if the person doesnt have it roll20 just grabs it off gist.
Any sort of off-site "require" functionality would break the sandbox. You could imagine someone using that functionality to bring in external data or to export data via specially encoded requests. I'd rather have named script objects (that can be managed via script) that can be required in. Perhaps some sort of site-level sharing might be possible, but that would be a fairly large undertaking.
As a work around I think I'll just use a build process in my ide to concat stuff.  I don't see how site level stuff would be too difficult even from the sandbox but it would be a non-trivial task.
1367351984
Alex L.
Pro
Sheet Author
The Require function would be evaluated before the execution of the code and would just load the code into a new script tab, this wouldn’t brake the sandbox at all. Think a Using statement in C# not a require function from php.