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

Show handouts to "current party only".

I run games for organised play, meaning I run the same game many times for different groups. When I have shared handouts like maps, info and rewards, I need to remember to take away the access for everyone to see it again, before the next group comes in.  I posted a suggestion to have an option to "Show to currently defined party". This way the current players will have access, but a player in the next group will not see the handout if the join the game before I have tidied. This may also be relevant for long term campaigns with a rotation of players, where only players that were present in certain sessions will get access to the information gathered there. It is of course possible to give only the current players access to the handout one by one, but that takes a lot more work than clicking the "Show to players"-button. Can this be scripted? I have recently been lured out on the API path and still very basic. 
1778163749

Edited 1778164110
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Simira! Yes, this can be scripted. This script should do most of what you are asking for. Copy the code from this link , and install it using the new script button on your mods page. Once installed, in your game type: !sharehandout into chat. The script will whisper a menu to you, showing all characters in the currently defined party. There is then a block of buttons that allows you to share the handout with any individual party member, or a button for the whole party at once. Click your choice. The script will then ask you for a handout name. This is presented as a dropdown list of all handouts in the game. You can scroll through this list or just start typing the name of the handout. The script will assign permissions accordingly. There is one drawback. The API system cannot auto open the handout for the players, the way the Roll20 engine can. So instead, it whispers a link to each affected player. They can click the button in the message to open the handout. Here is a screenshot of what you will see:
1778164218
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Party and players are listed separately. A defined party might include NPCs, pets, steeds, familiars, etc.
Thank you! Need some players in my API room, will test over the weekend!
1778168343
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Actually, the script will work regardless of whether players are logged in or not. But a player in the room would ensure that the script works properly from beginning to the end.