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

Newbie Learning Path? Handout to Character Sheet?

Hi all. I want to create a way to read data from a json document and inject it into the key-value pairs that store data for a character sheet, so the content can be created outside of Roll20 and imported into it. I think a viable method is to copy-paste the document into a Handout and then execute a macro/API call to read from it and assign values to a specified character sheet, but if there is a better way to do it (even HTTP POSTing the content from my local deskop to the Roll20 character "sheet"), I'm open to all ideas. I looked a bit for pinned forum posts that explain how API development works, but didn't see things specific to what I want to do. Can anyone point me to references and etc? I'm not new to coding or software design or D&D, but I am brand new to the innards of Roll20. Thanks!
1658433892

Edited 1727208364
timmaugh
Forum Champion
API Scripter
Hey, Jackie... welcome to scripting! There are definitely some helpful forum posts around building Mods (formerly API scripts). Here are some I have bookmarked: General Information Script and Metascripts (YouTube Video) - Parts 1 and 2 give an overview of how things work Function Documentation (from Wiki) Function Documentation (Roll20 Documentation) Objects (Wiki) Objects (Roll20 Docs) Script Design Novice Seeks Help With the Revealing Module Pattern General Development Discussion Aaron's Current-ish RMP Template  (might not be the latest) My Current RMP Template (you might have to remove things like the logsig() function) Command Line Examination Script Diagnostic Tools There are a couple of scripts that can make your development life significantly easier. ScriptInfo  is a script that can help you disambiguate the line numbers of errors, letting you more quickly zero in on where the problem might be. The linked post includes instructions for a few lines of code to add to your script to make it report properly. Inspector  is a script that lets you crawl over game objects (including your state) to get a look at what data might be available . You can get from object to object with related IDs , or get lists of related things from a button (like abilities for a character , etc . ) . Other Considerations You may need to work with repeating sections (less straightforward than simple attributes). If so, here are a couple of discussions that might be helpful: Reading Data from Repeating Section Creating RowID for Repeating Section Entry Other Scripts Chances are people have done similar things (if not quite the same things) to what you want to do... so go see how they've done it. For instance, if you want to create an attribute on a character, ChatSetAttr and InsertArg both have examples of that. If you want to get/read/create a handout, several scripts do that (TokenMod, UnSanity, InsertArg)... you can find the scripts at the Roll20 GitHub repo . These suggestions should get you started, and I'm sure you'll receive more! The best thing to do is jump in and post with a specific question. There are lots of people eager to help!
Thanks! Still absorbing things. I appreciate the info.