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

API Spellbook Utilizing PC2

Basically I'm looking to create a library of spells that can just be called. With something simple like; !spell Fireball or !spell Black Tentacles Then, the !spell API looks up the values of the spell fireball and spits it into the PC2 script. The only thing I can think of is the function built into the PC2 script, but the rolls have to be resolved before that point if I remember right. Anyone know a good way to handle this, or if it's already been handled by a better spell library? And example entry in the library would more or less go like this; if (spellName == "Fireball") { if (CL &gt; 10) CL = 10; var spellText = "--name|~C @@ <a href="http://www.dandwiki.com/wiki/SRD:Fireball||" rel="nofollow">http://www.dandwiki.com/wiki/SRD:Fireball||</a> Fireball@@ ~C --School|Evocation [Fire] --Level|Sor/Wiz 3 --Components|V, S, M --Casting Time|1 Standard Action --Range|Long [[400 + (40 * "+CL+")]]ft. --Area|20 ft. Radius Spread --Duration|Instantaneous --Saving Throw|Reflex DC[[10+3+@{CasterAttr}]] Half --Spell Resistance|Yes --Damage|[["+CL+"d6]]"; }; I figure this may be the best way to cut down on the 800 macros clutter for some offensive spellcasters. Because the entire spell list macro jumble can get summed down into; !spell ?{Spell Name?} Then in the !spell API you just make some "if" checkers to make sure the token/character has all the right attributes or if the spell name is listed. And voilla, easy spells.
I don't think I've ever made a topic with no responses a day later. I'm not sure wheither to think this is just a dumb, overcomplicated idea or whatever.
1429622139
The Aaron
Pro
API Scripter
I didn't respond to it because it I wasn't certain quite what the question was and figured I'd let the author of the spells script respond. =D It's certainly possible to do what you're suggesting. But I can't speak to how complicated it would be to adjust the existing script.
A script exists?!!!! I must find such a fantastic creation.
Not to my knowledge... as for creating something, you'd just need to create the library of spells, pick the right spell based off of name, and send it to PowerCard.Process(msg, player_obj), replacing msg with the spell in powercard format.
1429624625
Ziechael
Forum Champion
Sheet Author
API Scripter
It is worth bearing in mind that the compendium (work in progress) will have access to the Pathfinder and 3.5 spell information which can be pasted into character sheets (which gives me hope that the compendium might be accessible by the API too which would allow a script such as you are proposing to get the information needed and apply it to a predetermined output).
1429625891
The Aaron
Pro
API Scripter
Kerberos said: A script exists?!!!! I must find such a fantastic creation. Oh... Thought that was what you were talking about... <a href="https://app.roll20.net/forum/post/1187040/script-s" rel="nofollow">https://app.roll20.net/forum/post/1187040/script-s</a>...
1429657078
Kryx
Pro
Sheet Author
API Scripter
The Aaron said: Kerberos said: A script exists?!!!! I must find such a fantastic creation. Oh... Thought that was what you were talking about... <a href="https://app.roll20.net/forum/post/1187040/script-s" rel="nofollow">https://app.roll20.net/forum/post/1187040/script-s</a>... Has that been updated recently?
Unfortunately I'm not using any built-in character sheets. And after a quick browse it looks like that API might require them. So I think I'll build my own and use HoneyBadger's (thanks as always) suggestion. That will also give me the added bonus of trying to tie buff spells into a buff system but still be visually PC2. Thanks for all the help guys. I hope I can get this, at least mostly, up and running before my game on Saturday. Challanges and deadlines WOOT!
Mark said: The Aaron said: Kerberos said: A script exists?!!!! I must find such a fantastic creation. Oh... Thought that was what you were talking about... <a href="https://app.roll20.net/forum/post/1187040/script-s" rel="nofollow">https://app.roll20.net/forum/post/1187040/script-s</a>... Has that been updated recently? I wish, I have all the spells from the PH in an excel file but haven't taken the grueling time of updating the spell array with the details. I think Stephen even put together a spreadsheet that does most of the work for you, but I digress. Probably needs a big overhaul too, lots of changes since then.. Maybe something you should take on Mark... :) Would work great with your Shaped Character sheet.
1429691019
Kryx
Pro
Sheet Author
API Scripter
Greg B. said: Would work great with your Shaped Character sheet. Agreed. I'd love a spell importer. There are some JSON files floating around that have all 5e spells. I have no idea how to import into repeating areas, but maybe the script I mentioned has some code in it that I can check out. Future project maybe.
I know a site with has all the spells in excel format separated by comma dileminators
1429704849

Edited 1429711702
Kryx
Pro
Sheet Author
API Scripter
JSON is much better for web based apps, which any import would be. None of this does us any good without an importer script.
1429710861
The Aaron
Roll20 Production Team
API Scripter
Saevar L. said: I know a site with has all the spells in excel format separated by comma dileminators Just a friendly Reminder : When you signed up for Roll20 you agreed to abide by a Code of Conduct and this post violates the No Piracy Allowed section of the code. If you don’t own the rights, don't share it! This topic is edging up toward a line, I just want to make sure everyone is aware of what it is and doesn't cross it. =D
1429711788
Kryx
Pro
Sheet Author
API Scripter
There are publicly available spells that can be used and would hopefully not be a problem, but I don't have time to do it right now.
The Aaron said: Saevar L. said: I know a site with has all the spells in excel format separated by comma dileminators Just a friendly Reminder : When you signed up for Roll20 you agreed to abide by a Code of Conduct and this post violates the No Piracy Allowed section of the code. If you don’t own the rights, don't share it! This topic is edging up toward a line, I just want to make sure everyone is aware of what it is and doesn't cross it. =D Very close, we were of course talking about the free spells from the starter set.
1429712307
The Aaron
Pro
API Scripter
Yup! Just a friendly reminder so no one falls in any traps! =D
The Aaron said: Saevar L. said: I know a site with has all the spells in excel format separated by comma dileminators Just a friendly Reminder : When you signed up for Roll20 you agreed to abide by a Code of Conduct and this post violates the No Piracy Allowed section of the code. If you don’t own the rights, don't share it! This topic is edging up toward a line, I just want to make sure everyone is aware of what it is and doesn't cross it. =D SRD is still good though, right? Open source public resource and all.
1429815247
The Aaron
Roll20 Production Team
API Scripter
yup, totally.