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

New sheet/script author, advice needed

1588446960
Joshua S.
Pro
Sheet Author
API Scripter
Greetings all, Given the COVID situation I have moved all my games to roll20 and I have started developing a character sheet and api scripts for my Fate of the Norns (FotN) campaign. After posting some scripts to the FotN forums, I was contacted by the publisher about developing an official sheet and companion script for the game.  Some things to note: I am at best a coding hobbyist, not a professional developer. I am new to HTML/CSS/Javascript, but have some experience with Python and other random languages. Fate of the Norns uses no dice, but relies heavily on drawing runes from a bag which I have simulated with a deck. Ok, on to some questions:  1) How do I set a graphic as the background of a <div> in the custom character sheet? I assume the image must be hosted on the roll20 server, but I don't know how to reference it 2) How do I become an official Sheet Author/API Script Author?  3) Can sheetworkers access the API for deck and card manipulation? Similarly, can they change the value of a token on the map? (Like a numeric value indicator) 4) Can a sheetworker or API script create a deck object using images on the roll20 server? 5) When I created a deck using jpeg images already in my roll20 library it wouldn't work with the API deck calls, but when I created the deck using .png images that I drag and drop from my computer it works just fine with the api. Does anyone have any insight into this? 6) I have a script that when run looks for cards in a particular part of the table and if any are there it picks them up to the hand and then returns the hand to the deck and shuffles. For some reason, when I run it the first time it gives me a "card was not on table" error. If I run it a second time without changing anything else, it detects and picks up the cards. If I have 2 cards in the area and run the script it will give me "not on table". If I add two more cards (fresh from the deck, not moving them to the area) and run the script it will detect and remove the cards that were there the last time the script was run and throw "not on table" for the two new cards. My solution has been to make a macro that always runs the script twice, but that seems kludgy. Anyone know what's going on here? 7) sometimes the graphics object of a card becomes disconnected from the card object of a card, resulting in an orphaned graphic of the card remaining on the table after the card has been successfully recalled to the deck. How do I prevent this? 8) Is there any way to make an outside call to a CSV, xml, or other similar file? Every character archetype has access to a different set of 48 skills, active abilities, and passive abilities. I would like the character sheet to detect the archetype input and grab the proper values for a dropdown menu from that archetype. Thanks to anyone who can help!
1588450503
GiGs
Pro
Sheet Author
API Scripter
Answering questions in order, quickly because i dont have much time: look up background-image in CSS When you post a sheet or script to roll20's github repository, you set up a JSON file with some basic information, inlucinf your roll20 id. It then automatically adds the tag to your roll20 profile. no - sheet workers can only modify the attributes on a character sheet. They cannot affect anything outside the character sheet, which means no creation or manipulation of the map, tokens, cards, or even other player's characters is possible. no, see #3 The API cant handle images bought from the roll20 marketplace. If you buy a product which lets you download images, you need to download them then reupload them into your library. Then the API can access them. this is a bit more complex for this format. For this question, i suggest you start a new thread specifically about that question, so you'll attract people who know the api and card system to answer. You should also post the code that isnt working properly. I havent seen that, and it may be due to the code your using. When you create a new thread for #6, include this question. There is no way to access external data. You would need to build this data into the sheet, which is definitely possible. Hope this helps.
1588454697
Andreas J.
Forum Champion
Sheet Author
Translator
1. <a href="https://wiki.roll20.net/Building_Character_Sheets#Images" rel="nofollow">https://wiki.roll20.net/Building_Character_Sheets#Images</a> 8. as GiGs, said, you can't access external info, but you could code in that info into the character sheet using sheetworkers: <a href="https://wiki.roll20.net/Sheetworkers" rel="nofollow">https://wiki.roll20.net/Sheetworkers</a> At the bottom of the Sheetworker documenatation there is a link to a previous post by GiGs on how to do this: <a href="https://app.roll20.net/forum/post/6963354/build-lookup-table-into-a-character-sheet/?pageforid=6964447#post-6964447" rel="nofollow">https://app.roll20.net/forum/post/6963354/build-lookup-table-into-a-character-sheet/?pageforid=6964447#post-6964447</a>
1588455067
Joshua S.
Pro
Sheet Author
API Scripter
Thank you, as an addendum: 1) I know how to do background images in CSS. What I don't know is how to reference an image in my roll20 library. Normally I would just put it in an images folder in the same directory as my CSS file, but that doesn't seem to be an option here 5) These aren't images bought from the marketplace. This an image I upload to my library and then drop onto the card front (doesn't work) vs. an image where I drag it from my computer to the card front (works). I'll move that to a specific post with the code.
1588458226
GiGs
Pro
Sheet Author
API Scripter
Joshua S. said: Thank you, as an addendum: 1) I know how to do background images in CSS. What I don't know is how to reference an image in my roll20 library. Normally I would just put it in an images folder in the same directory as my CSS file, but that doesn't seem to be an option here You cant reference an image in your library directly. You have to use its URL, which you can get by dropping the image on the battlemap and pressing Z to magnify it, the rightclicking on the magnified image and copy image address. You can then use that url (delete everything after file extension) as the URL in background-image.
Eventually if the sheet is accepted by Roll20, images can (and should) be included in a more stable repository, like Github. We have had images break in some sheets when their third-party sources go down, block remote calls, or the image is removed.
1588522277
Joshua S.
Pro
Sheet Author
API Scripter
GiGs said: Joshua S. said: Thank you, as an addendum: 1) I know how to do background images in CSS. What I don't know is how to reference an image in my roll20 library. Normally I would just put it in an images folder in the same directory as my CSS file, but that doesn't seem to be an option here You cant reference an image in your library directly. You have to use its URL, which you can get by dropping the image on the battlemap and pressing Z to magnify it, the rightclicking on the magnified image and copy image address. You can then use that url (delete everything after file extension) as the URL in background-image. Gotcha, thanks. I didn't think of using the copy image address Rabulias said: Eventually if the sheet is accepted by Roll20, images can (and should) be included in a more stable repository, like Github. We have had images break in some sheets when their third-party sources go down, block remote calls, or the image is removed. Eventually, yes. Right now I am just looking for a way to test it.