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's with formatted output.

I wrote an script that will roll for a random action (from a pre-defined table) to take place when someone critically fails.  In order to format the output nicely I wrote my own Roll Template, of course this means I manually copied in the 5e Character sheets. Now another DM wants to use the script, but doesnt want to have to manually handle his character sheets. So the question is, how can I output a message to chat that has html elements and styling...without using Roll Templates?  Or is there an API for defining a Roll Template from script?
The PowerCards API Script allows for very nicely-stylized outputs (I call it "Roll Templates on steroids); I highly recommend looking into it!
Thanks! I will do that.
1463382186
Lithl
Pro
Sheet Author
API Scripter
Yes, basically sendChat can use /direct and /w to send HTML directly to chat. All of your CSS has to be inline, but other than that you're pretty much free to do whatever.
1463400115

Edited 1463400127
Thanks Brian, After looking at PowerCards, I was wondering how he was doing it, so I went back and re-read the API pages.  I see where I can do that now.  I could have sworn I tried that back when I first started scripting for Roll20 and it wouldn't see any of my styles, but I must have just been screwing it up somehow. I'll just merge my css into my template and move it all into my script.  Easy enough.
Yeah, having access to a css file would be awesome with the API. It would open up quite a bit within the api.
Im thinking it would be nice to be able to define roll templates and css separate from the declared character sheets.   For example: You pick your character sheet as you can currently. Over in the API section, add another interface underneath the scripts section that works and looks just like the current "Custom character sheet" interface.  In there you can CRUD any custom roll templates and css. The next part would be to give the API access to this section with the ability to CRU it so that script writers can manage their pieces.  I fully understand that securing this section against improper/malicious API writers would be very hard, but I wouldn't even try. 90/10...I would think that the vast majority of roll20 api writers dont want to do anything intentionally malicious to other games, and if you stick to some sort of "standard" of namespacing your items, then it should cut down on the "improper" API.  Besides, you have plenty of disclaimers warning to test the APIs on copies of our games before running them in the real game.
1463424877
The Aaron
Pro
API Scripter
I actually brought that up at GenCon last year and Riley was receptive to the idea.  If there isn't a suggestion for it already, we should probably make one and get all the API peeps to bump it. =D
Will do...
Here is the link to the idea I just posted.  I'm wide open to suggestions, but its a start.