Difference between revisions of "Mod:Development"
From Roll20 Wiki
Andreas J. (Talk | contribs) m |
Andreas J. (Talk | contribs) m (script.json info) |
||
Line 27: | Line 27: | ||
* '''The {{repo|Roll20/roll20-api-scripts Official Roll20 API Script Repo}} on Github.''' This is where you'll find the current version of scripts that authors have submitted for inclusion in the repo. | * '''The {{repo|Roll20/roll20-api-scripts Official Roll20 API Script Repo}} on Github.''' This is where you'll find the current version of scripts that authors have submitted for inclusion in the repo. | ||
* '''The {{forum|category/46806 Roll20 API Scripts}}''' This subforum is where scripts tend to show up first and where discussion happens about scripts that are being written or need changes. This is also where you can post and ask for help from the community in creating a script you've thought of, or finding a script to fill a need. | * '''The {{forum|category/46806 Roll20 API Scripts}}''' This subforum is where scripts tend to show up first and where discussion happens about scripts that are being written or need changes. This is also where you can post and ask for help from the community in creating a script you've thought of, or finding a script to fill a need. | ||
− | * '''The [[API:Script_Index|Wiki's API Script Index]].''' This is a good source of information about popular scripts, but it's not too well maintained nor does it describe all APIs that currently are | + | * '''The [[API:Script_Index|Wiki's API Script Index]].''' This is a good source of information about popular scripts, but it's not too well maintained nor does it describe all APIs that currently are available in the one-click menu.. However, if you'd like to document some scripts you find useful, their authors would certainly appreciate it! |
+ | ** [[API:Short Community Scripts]] contains some APIs that aren't in the install menu | ||
==Contributing API Scripts to the Community== | ==Contributing API Scripts to the Community== | ||
− | If you create a script that you'd like to offer to the rest of the Roll20 community, you can submit it to be included in the Roll20 API Script | + | If you create a script that you'd like to offer to the rest of the Roll20 community, you can submit it to be included in the [https://github.com/Roll20/roll20-api-scripts Official Roll20 API Script Repo]. Having your script approved by the Roll20 staff and included in the repository will unlock the <div style="width: auto; display: inline-block; margin-left: 5px; position: relative; top: -2px; background-color: #21c0d0; padding: .2em .5em .2em; font-size: 14px; min-width: 10px; font-weight: bold; line-height: 1; color: #fff; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: 10px; box-sizing: border-box; font-family: Helvetica,Arial,sans-serif;">API Scripter</div> forum tag for your account as will allow you to advertise via Patreon or Patreon-like sites (see below for more info). |
− | + | To find out what you need to do to correctly submit your script to the repository, check: | |
+ | * [https://github.com/Roll20/roll20-api-scripts#contributing Roll20 API Scripts README#contributing] | ||
+ | * [https://github.com/Roll20/roll20-api-scripts/tree/master/_Example%20Script%20-%20Check%20for%20formatting%20details Example API Script] | ||
+ | |||
+ | Guides for how to submit content to Github: | ||
* [[Github|Beginners guide to GitHub]] | * [[Github|Beginners guide to GitHub]] | ||
* [[Short Git Guide]] - how to do most things on the Git command line | * [[Short Git Guide]] - how to do most things on the Git command line | ||
− | ===Patreon and Tipeee | + | ===script.json=== |
+ | Details: '''[https://github.com/Roll20/roll20-api-scripts#creating-a-scriptjson-file Creating a script.json File]''' | ||
+ | |||
+ | Some extra details: | ||
+ | |||
+ | * '''"roll20userid"''' - how to find your [[roll20userid]] | ||
+ | * '''"description"''' - text is displayed as [[markdown]], with a few quirks. | ||
+ | ** See [[sheet.json#Instructions]] for formatting tips | ||
+ | ** With some changes, you can use [[Sheet Sandbox]] to test how the "description" will look like once the API is in the One-click menu | ||
+ | |||
+ | |||
+ | ====Patreon and Tipeee Link==== | ||
For [[API Author|API script authors]] that are contributing to the Roll20 {{repo API}}, they are approved to advertise via subscription/donation service sites: Patreon and Tippee. Roll20 is not responsible for any payment transactions and cannot enforce any private arrangements.<br /> | For [[API Author|API script authors]] that are contributing to the Roll20 {{repo API}}, they are approved to advertise via subscription/donation service sites: Patreon and Tippee. Roll20 is not responsible for any payment transactions and cannot enforce any private arrangements.<br /> | ||
Line 52: | Line 68: | ||
===Linking to Patreon/Tipeee on the Roll20 Forums=== | ===Linking to Patreon/Tipeee on the Roll20 Forums=== | ||
Linking to Patreon or Tipeee on the Roll20 Forums are only permitted for pre-approved community members who have contributing either Character Sheets or API Scripts. If you wish to solicit users directly for funding you may do so privately, but no such links are permitted in a public forum without any contributed material.<br /> | Linking to Patreon or Tipeee on the Roll20 Forums are only permitted for pre-approved community members who have contributing either Character Sheets or API Scripts. If you wish to solicit users directly for funding you may do so privately, but no such links are permitted in a public forum without any contributed material.<br /> | ||
− | + | ||
==API Meta Libraries== | ==API Meta Libraries== | ||
Line 68: | Line 84: | ||
<br> | <br> | ||
<br> | <br> | ||
+ | [[Category:API|Introduction]] [[Category:Docs]] |
Revision as of 14:12, 24 November 2021
Attention: This page is community-maintained. For the official Roll20 version of this article, see the Help Center for assistance: Here .
This is about a Roll20 feature exclusive to Pro-subscribers (and often to players in a Game created by a Pro-subscriber). If you'd like to use this feature, consider upgrading your account. |
Roll20 Mod
Use Mods
- Use & Install
- Mod:Script Index & Suggestions
- Short Community Scripts
- Meta Scripts
- User Documentation
- Mod Scripts(Forum)
- Mod Update 2024🆕
- Macro Guide
Mod Development
- Mod:Development
- Guide to Mod framework
- Contributing
- Guide to GitHub
- Category:API
Reference
- Objects
- Events
- Chat Events & Functions
- Utility Functions
- Function
- Roll20 object
- Token Markers
- Sandbox Model
- Debugging
Cookbook
Go to the API:Use Guide-page for how to use/install existing APIs. This is an introduction to creating & modifying API Scripts.
Contents |
API Script Creation - Introduction
The Roll20 API provides a powerful way to customize and enhance your game. You write scripts (little pieces of code) that tell Roll20 what to do during gameplay (for instance, move a piece, add a status marker to a token, or even roll dice). It's simple and straightforward to get started, but the possibilities are endless.
What do I need to get started?
Scripts for the Roll20 API are written in JavaScript. You only need a basic understanding of the language to get started, but if you want to learn more about JavaScript, this Codecademy course can help teach you.
- Aaron's tips on getting started(Forum) - (Sept. 2021)
How does it work?
You write scripts that listen to events that happen during the game. Scripts can check to make sure that rules are followed, change properties on objects and tokens, and even provide custom chat commands. The scripts you write run across the entire game, and affect things the GM does as well as all the players. Advanced scripts can also run independently, performing automatic actions such as moving a token on a patrol route or nudging players when their turn is taking too long.
To get started, your first stop should be the Use Guide.
Where can I find pre-made scripts?
The API Script community is fairly active with members creating and discussing scripts all the time. There are 3 basic places to look for new scripts:
- The Official Roll20 API Script Repo on Github. This is where you'll find the current version of scripts that authors have submitted for inclusion in the repo.
- The Roll20 API Scripts(Forum) This subforum is where scripts tend to show up first and where discussion happens about scripts that are being written or need changes. This is also where you can post and ask for help from the community in creating a script you've thought of, or finding a script to fill a need.
- The Wiki's API Script Index. This is a good source of information about popular scripts, but it's not too well maintained nor does it describe all APIs that currently are available in the one-click menu.. However, if you'd like to document some scripts you find useful, their authors would certainly appreciate it!
- API:Short Community Scripts contains some APIs that aren't in the install menu
Contributing API Scripts to the Community
If you create a script that you'd like to offer to the rest of the Roll20 community, you can submit it to be included in the Official Roll20 API Script Repo. Having your script approved by the Roll20 staff and included in the repository will unlock theTo find out what you need to do to correctly submit your script to the repository, check:
Guides for how to submit content to Github:
- Beginners guide to GitHub
- Short Git Guide - how to do most things on the Git command line
script.json
Details: Creating a script.json File
Some extra details:
- "roll20userid" - how to find your roll20userid
- "description" - text is displayed as markdown, with a few quirks.
- See sheet.json#Instructions for formatting tips
- With some changes, you can use Sheet Sandbox to test how the "description" will look like once the API is in the One-click menu
Patreon and Tipeee Link
For API script authors that are contributing to the Roll20 Roll20 API repo, they are approved to advertise via subscription/donation service sites: Patreon and Tippee. Roll20 is not responsible for any payment transactions and cannot enforce any private arrangements.
In order to qualify, an API script author must first have their script contribution approved by the Roll20 staff and included into the Roll20 API Script Repo.
You will want to include your Patreon or Tipeee account information in the script.json
file that should be included with your script submission on GitHub.
The json file should have one of these fields added to it if you wish to advertise with Patreon or Tipeee:
patreon:
Place the URL for a Patreon campaign here, and it will appear under your script's description when selected. (e.g."https://www.patreon.com/<name>"
)
tipeee:
Place the URL for a Tipeee here, and it will appear under your script's description when selected. (e.g."https://www.tipeee.com/<name>"
)
For more information, see github.com/Roll20/roll20-api-scripts#contributing
Linking to Patreon/Tipeee on the Roll20 Forums
Linking to Patreon or Tipeee on the Roll20 Forums are only permitted for pre-approved community members who have contributing either Character Sheets or API Scripts. If you wish to solicit users directly for funding you may do so privately, but no such links are permitted in a public forum without any contributed material.
API Meta Libraries
- Check the Library & Meta Scripts section of the API Index, there exists several APIs that can are made to be used by other APIs
- Roll20 Oral Orcs framework to simplify API writing for Roll20
Related Pages
- Complete Guide to Macros & Rolls
- q Text Chat - where the roll results appear, & info on the common chat commands
- Dice Reference - Comprehensive list of how the Roll20 dice-rolling syntax works, and list the features available
- Macros - How to create macros, and other info on how the Roll20 qText Chat works, like referencing stats on character sheets, roll queries, nesting macros & initiative
- Roll Templates - a method of formatting roll results in the chat, with some extra functions
- API(Pro Only) - API commands can be used in the qText Chat