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 .
×
May your rolls be chill this holiday season!
Create a free account

Is API dangerous?

Greetings! We've recently gifted our dm with a pro subscription in hope that we'll get some of the features we wanted customizing our rolls and have some quality of life API. But our DM took a look at what could happen wrong with the API and decided he doesn't want to risk losing his game to 'corruption' of attributes and other stuff that might make him lose or roll back his game. The main reason I wanted a pro account was to be able to finally use color and size my text the way I want in my macros and rolls. Keep track of spellbook and abilities and maybe find more cool things with the API but all of it means nothing now because it was all depending on one person's decision. So I come here to ask you, what can we do now? Is API really that dangerous? What will happen should things go wrong with it and does it really not worth the risk?
1593332628
GiGs
Pro
Sheet Author
API Scripter
The API isnt dangerous. The warning can be safely ignored. The API cant make changes to your campaign, unless you install scripts that make those changes. All the scripts you can access through the one-click install are perfectly safe. It is possible to make damaging changes with some  scripts, but you have to install such a script, and then ignore the documentation on how to use it. The only script I can think of, offhand, that could mess up a campaign if you're not careful is chatSetAttr.  This is a script that lets you change multiple attributes, in multiple characters, with a single click. So if you're not careful, you could accidentally overwrite, say, all the hp values of all the PCs.  But this is pretty easy to avoid doing, and in any case, if the worst happens, Pro GMs have the ability to rollback their campaigns. So even if something does go wrong, you'll lose a day or two of work maybe.
Interesting... chatSetAttr was actually what I was looking for to activate buffs via macros for one. But could it delete assets or break certain things like base things like rolls from functioning, you know, game breaking stuff? Because if it's all about values that get overwritten, to me it seems like it could be overwritten again to the original value.
Ali A. said: But could it delete assets or break certain things like base things like rolls from functioning, you know, game breaking stuff?  The API can't break anything of that sort, it's just a tool and well worth it. :)
Ali A. said: Interesting... chatSetAttr was actually what I was looking for to activate buffs via macros for one. But could it delete assets or break certain things like base things like rolls from functioning, you know, game breaking stuff? Because if it's all about values that get overwritten, to me it seems like it could be overwritten again to the original value. Resetting all HP back to their original values throughout the campaign I'd consider game breaking as a GM. I wouldn't want to have to spend the time to go through and manually enter the HP for each monster again. :-)
Farling said: Ali A. said: Interesting... chatSetAttr was actually what I was looking for to activate buffs via macros for one. But could it delete assets or break certain things like base things like rolls from functioning, you know, game breaking stuff? Because if it's all about values that get overwritten, to me it seems like it could be overwritten again to the original value. Resetting all HP back to their original values throughout the campaign I'd consider game breaking as a GM. I wouldn't want to have to spend the time to go through and manually enter the HP for each monster again. :-) But you can roll back if that happens right?
1593367785
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Farling said: Ali A. said: Interesting... chatSetAttr was actually what I was looking for to activate buffs via macros for one. But could it delete assets or break certain things like base things like rolls from functioning, you know, game breaking stuff? Because if it's all about values that get overwritten, to me it seems like it could be overwritten again to the original value. Resetting all HP back to their original values throughout the campaign I'd consider game breaking as a GM. I wouldn't want to have to spend the time to go through and manually enter the HP for each monster again. :-) Once overwritten, there would be no "original value" to find. The API is safe in and of itself. Anything in the game can be broken by accidental, careless or  uninformed use, despite subscription level. People occasionally delete their game trying to delete the Chat Archive for instance. Back up your game occasionally (costs nothing), and be aware that the Rollback exists (not a sure thing, but does what it's supposed to do most of the time).
1593369816
Kraynic
Pro
Sheet Author
To me, what you should take away from warnings about the use of API scripts is this:  Don't use an active game in place of a test game! Set up a game specifically to test, possibly a straight copy of your main game.  The cost is nothing but time, which is no price at all compared to being sure you won't have to redo an ongoing game.  Set up your scripts there and do all your testing/learning where it isn't going to "break" an ongoing game.  Think of the API like console commands on your computer.  Can you break your system?  Of course you can.  But that isn't the fault of the commands themselves.  They are just doing what they are told.
My answer to the question in the headline: That depends on who is using it. You can use a knife to prepare dinner or to kill somebody. Make sure to read the instructions to the scripts you wanna use and follow them. ChatSetAttr is one of those scripts which enabled my macros to do more math, so the players can do more roleplay. But as said above it can kill all characters if you type in the command for it to do that.
1593378871
GiGs
Pro
Sheet Author
API Scripter
Ali A. said: Interesting... chatSetAttr was actually what I was looking for to activate buffs via macros for one. But could it delete assets or break certain things like base things like rolls from functioning, you know, game breaking stuff? Because if it's all about values that get overwritten, to me it seems like it could be overwritten again to the original value. As people have mentioned, the API cant break your games. It basically allows to do all the things you normally can do, just much more conveniently. Like, you can edit a character sheet, and change an attribute. For example, chatSetAttr lets you edit every single character sheet and in one go. chatSetAttrs is an extremely useful script. If youre careless, it can be damaging, but if it does damage, it's because you made a mistake, not because the API went haywire. There's no inherent danger from the API.