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 .
×

Viewing and editing pre-existing API Scripts?

1768979056

Edited 1768979429
So this is pretty straight-forward honestly. I'm wanting to make some slight changes to some of the APIs/Mods I'm using from the Mod Library in one of my games as a GM. Nothing big, just changing a name and editing a value here and there. But I have no idea how to access the scripts . The official help forum says that I just click on the API name to open it's appropriate tab and that it should automatically show the full code in the Mod Output Console to edit freely, but it doesn't show anything there whatsoever since I didn't write the script myself. So how do I, or for that matter can I , access then edit the code for existing scripts within my game if the scripts were originally part of the Mod Library and were written by someone else? Thanks in advance everyone!
If a script was added through the Script Library by using the 'Add Script' button, then what you need to do is delete the script, then reopen the Script Library dropdown and select the script, but instead of using the 'Add Script' button, you click on the 'Import' button just to the right.  That will import the script as it is currently written, just like adding any other script that isn't in the Script Library. The downside to this approach is that the script will no longer automatically update if the script creator creates any updates and you'll have to manually merge any updates you've made after re-adding the script.
1769007725
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Jarren is pretty much describing how I got started with Roll20 mods. It was a great way to get me feet wet.
1769016403
Gold
Forum Champion
Cool info Jarren. I thought we had to go into the GitHub to copy-paste the original code to do this. I don't think I have ever tried the Import button.
1769016795
vÍnce
Pro
Sheet Author
Gold said: Cool info Jarren. I thought we had to go into the GitHub to copy-paste the original code to do this. I don't think I have ever tried the Import button. Same here.  Always learning. ;-)
Jarren said: If a script was added through the Script Library by using the 'Add Script' button, then what you need to do is delete the script, then reopen the Script Library dropdown and select the script, but instead of using the 'Add Script' button, you click on the 'Import' button just to the right.  That will import the script as it is currently written, just like adding any other script that isn't in the Script Library. The downside to this approach is that the script will no longer automatically update if the script creator creates any updates and you'll have to manually merge any updates you've made after re-adding the script. Thanks a ton! That was exactly what I was looking for!
1769115181
timmaugh
Forum Champion
API Scripter
*Especially* in a new game, but generally for any script that you want to edit, I would suggest a full process of: Add Script Delete Script Import Script Edit Script ...This way, you'll be sure to get the potential dependencies that are defined as being required for the script to function. Dependencies do NOT get installed if you just "Import" the script. They are only added by "Adding" the script... and are NOT automatically removed by deleting the main script. If you already have a script that was added from the repo in your game (and it's functioning), then you can be sure you've gotten the dependencies. But the above order of operations is a good plan for those cases where you know you need script-X, but with Y-changes (for instance, in a new game).