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

Publishing a module : api scripts allowed ?

1507035990
tontione
Pro
Sheet Author
Is it possible to include custom api scripts in a published module ? And will these scripts be playable by anybody who purchased the module, even with only a basic free account ?
1507039225
The Aaron
Pro
API Scripter
You can certainly include a handout with links to API scripts, but only Pro Subscribers will be able to make any use of them.  The API's state object won't be part of the game either, so you'll need to store any configuration data via another means.  I suggest Base64 encoding it and putting it in a handout of a known name.  You shouldn't rely on the Token IDs or Character IDs staying the same either.
1507217021
tontione
Pro
Sheet Author
Thanks for your quick answer !  Is it something common for still published modules, or would it be better to avoid using API because it restricts these features to pro subscribers ?
1507222651
The Aaron
Pro
API Scripter
If I were doing a module, I would provide 100% of the functionality without the API, then look at ways to enhance things with the API.  For example, I might have a pit trap in a room.  I might have the room look normal, but have an image on the GM layer that represents the open pit.  When players move onto the space, you can move to the GM layer and then push it down to the Maps layer.  Then I might provide an API script that detects when a player moves into that area (or through it) and prompts the GM to "Open pit?" with a whispered API command button which would then move the player token back to the spot where it entered (or maybe the center of the pit) and move the graphic from the GM layer to the Map layer. So the non-pro users isn't missing out on any content, but the Pro subscriber has some quality of life improovements. 
1507283582
tontione
Pro
Sheet Author
Great exemple, good advice, i will try to follow it ! :)