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

Question about importing a large list of abilities into a character via API?

Hello all, been a mentor for a while and now starting to delve into programming a bit. I have an excel file I created that takes every spell from d20pfsrd and turns it into a an ability/macro. This is great, and I can easily copy paste specific spells into a "spellbook" character which everyone can access and run the macros from. The problem is.... that is a lot of grunt work... and it seems like something API related could likely make it a simpler method. The number of macros I have right now is around 1700 spells. I used excel to pull values from each cell and combine them into a custom spell macro. I am more than willing to turn all of that stuff over to everyone for the greater good if someone could help me find a way to import such information easier than copy paste? Especially if I decide to later go back and edit the format of the macro template I use... Any help or nudge in the direction of a script that already basically does something similar would help. I look at the API scripts and I am still just... not there yet.
Could I alternately use a custom character sheet, creating a single character with it, then delete that custom sheet and go back to the pathfinder custom sheet I use ? Would that maybe be a way to do this via simple HTML scripting?
1427435027
The Aaron
Pro
API Scripter
With that many entries, I'd suggest putting them in an object natively in the Javascript. Then write yourself a series of menus with API Buttons to select spells to add to a character. There was a script a year or so ago that stuffed all thst data in the state object, which was a horrible mistake. I believe Stephen S. wrote a DnD5e spells script that you might like to look at. Writing a character sheet would only let you setup attributes, not abilities.
Thanks Aaron. Yeah, but in essence i could make them work as attributes as well. I will look into your suggestion and start learning more on that. I tested my CS idea lastnight and it does work, just isn't as elegant as I would like. But since this is more a reference character at this point and the idea is to keep players from having to have any of this info in their own character files it works for now. Thanks again for the heads up, will dig deeper into the 5e version:)
1427469190
The Aaron
Pro
API Scripter
No worries. There's just a lot of overhead to having abilities like that, which are harder to access in the API anyway than having an object. In my mind it's "all downside and no upside". I'd be happy to help you on the basic structure of the program to house those spells, if you want. You can also look at much of Stephen's work to see using Javascript objects as a sort of database. Many of his dungeon creation scripts have a section containing loads of data about the different tiles and such. Conceptually very similar to how you might do spells.