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

Adding items from compendium to a player's inventory; specifically 5e OGL sheet

Hey, was wondering if there already existed an API to transfer "bunches" of items from the SRD compendium for 5e to a player's inventory?  If not, could someone point me in the right direction to write my own up? I'm looking to start out with a simple time saver for the different type of packs, ie if you want a burglar's pack it would auto dump all the individual items that a burglar's pack is comprised of into a player's inventory as the interface doesn't already support this sort of thing.  Thanks!
1552015516
The Aaron
Roll20 Production Team
API Scripter
The API does not have access to the Compendium.  You could bring in that information in some structured data format and then use it to make the changes to a character.  Adding items to the character sheet is a difficult matter and depends on the inner workings of the sheet.
You could write some medium complicated code to essentially copy the items from the compendium to your own script's state.  I am not saying this is remotely worth the effort, but you could do it: - record the current state of your character's inventory (all the ids of repeating_inventory attributes) - now drag the items you want to consider a "pack" to your character - call your script to compare the inventory to see what repeating_inventory entries are new  - find associated repeating_attack entries for those new inventory items - record all the attributes for the inventory and attack attributes to your script's state as a "pack" - now you can blast this set of items and their attacks into other characters All the code you need to understand inventory items and their related attacks is in BeyondImporter.  However, it is a mess and again, I think this would not be worth your time unless you find it super fun to build something like that.   Also, it would break if the sheet ever changes its format dramatically.   I don't believe that will happen, since 5e OGL has a strong motivation to stay close to the format that closely matches what they get from the compendium on a drag and drop.  So I doubt they would decide to do something radically different in the future.   But it is a possibility.   It would break the heck out of BeyondImporter :)
that's...disappointing to say the least
1552084417

Edited 1552084437
Ammo
Pro
What is your use case exactly?  Is it just about creating your character or are you trying to equip an army of NPCs?  If you are just making new chars, you could always make them in D&D Beyond and then import them via BeyondImporter.  It's the far superior character builder anyway (at this point.)
haven't honestly checked out beyondimporter yet....guess I'll give it a try