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

[Script] RPGMaster APIs for AD&D 2E

1646327482

Edited 1646750535
Richard @ Damery
Pro
API Scripter
Note Update:  Due to discovered issues in Game Play testing (see next post), the Class Database release has been delayed by 1 week. The next release for the RPGMaster series of APIs will be a major upgrade, in two instalments.  The release is intended to continue the push to externalise every possible rule-set in the RPGMaster API suite, so it is easy to change the behaviour to work with other versions of D&D, or even totally different RPGs.  To this end, the Character Class properties, Attack & Damage Calculations, and Races & their properties will all be provided with databases allowing simple addition or overwriting of the default characteristics and rules applied by the APIs during game-play. 1. Character Class Database - 16th March release (updated date) As mentioned in my post of February 25 , I have been working on defining Character Class rules in a database, with: Allowed weapons, armour & shields Non-proficient weapon penalties Attacks per round progression Wizard specialist & banned schools Priest Major & Minor spell spheres Non-standard spells per level progressions Non-Wizard / Non-Priest spellcaster definitions Class power specifications As you might come to expect now, these aren't just lists but can actively restrict or allow Players / Characters to use or be prevented from using the relevant items/spells/powers and only at the experience levels defined.  This behaviour can be configured in a menu available to the DM.  The DM / Game Creator can add their own classes or overwrite the supplied classes in their own version of the Class-DB using the information in the Class Database Help Handout created when the APIs (specifically the AttackMaster or MagicMaster APIs) are loaded. Final test campaign games are being held this coming Friday and Monday (UK afternoon), and (assuming all goes well, and previous test games have all been fine) the APIs will be merged Monday (US time) for release on Wednesday. 2. Attack Calculations Database - anticipated 23rd March release To date, the APIs have only supported standard AD&D2e weapons attack/damage calculations, and then only as I have interpreted them (which I believe to be a strictly correct interpretation, but who knows if I'm right!).  The up-coming Attacks Database allows DMs / Game Creators to amend the way attacks are calculated. As with all other databases, the APIs use standard Roll20 functionality to support creation and editing of the specification.  The system supplies many derived and calculated fields taken from data on the Character Sheet combined with that provided in the supplied databases (such as the Weapons Database), which are referenced in the Attack Calculation using the ^^field-name^^ syntax (common with the existing Effects Database).  A full list of the provided derived/calculated fields is provided in the Help Handout that comes with the APIs & Attacks Database.  DMs / Game Creators can also read any available Character Sheet data using the @{^^cname^^|data-field-name} (^^cname^^ will be replaced by the APIs with the name of the Character/NPC/Monster doing the attack) .  Even the attack dice to roll in the calculation can be specified as different from 1d20 - if your RPG calls for it. Attack definitions can be specified to be generic for all attacks, and can also be specific to a Race, Class, or even an individual Weapon!  for example: MW-ToHit-Elf  would be a specific "ToHit" attack calculation for Melee Weapons only used by any character of the race "Elf" RW-ToHit-Bard  would be a specific Ranged Weapon "ToHit" attack calculation for the character class "Bard" RW-Targeted-Attk-Longbow-of-Valour  would be a Targeted attack calculation (which gives full details of the target AC & HP as well as the attack rolls) only for the Weapon "Longbow-of-Valour" and no other weapon. Weapon takes priority over Class, which takes priority over Race, and if none of them exist the default is used. Monster/Creature attack calculations, using innate attack definitions on the Character Sheet, are also catered for and can be altered. Weapon vs. Armour modifiers are displayed to the Attacking Player/Character for Targeted Attacks, and are available for the attacked Player/Character/NPC to view (the Slash/Pierce/Bludgeon modifiers are specified for each Armour entry in the Armour Database).  The Armour calculations are also exposed in a similar manor to Attacks in the Attacks Database.
1646751878

Edited 1646751938
Richard @ Damery
Pro
API Scripter
Found Bug:  The MagicMaster API will not load properly into very large & complex (i.e. with lots of maps, character sheets, handouts etc already loaded) Roll20 campaigns.  The API sandbox aborts with an  Infinite Loop  error.  In fact, there is no infinite loop, just the databases taking a long time to load in a campaign with a large number of character sheets, attributes & abilities already loaded.  The API is fine when loaded into simple campaigns that have limited complexity already defined.  The problem arises (I believe) because the more data is already loaded in the campaign - such as character sheets, maps, handouts, images etc - the slower adding additional data becomes.  Once the API data is loaded, the database indexing used by the APIs makes them reasonably fast, it is just the initial creation of the databases in the campaign that causes the issue. Workaround:  Load the APIs into an empty (or not yet complex) campaign before adding the complexities of the campaign.  However, this is not always possible, especially with campaigns purchased off the marketplace.  For instance, I'm currently setting up the 'Ghosts of Saltmarsh' and just the first module ('The Sinister Secret of Saltmarsh')  cased the issue. Anticipated fix ETA: A potential fix is already coded: however, it uses some fancy asynchronous javascript programming with things like 'promises'   and 'awaits',  and a new handshake between the various database-handling APIs, so I want to thoroughly test the solution first.
1647786596

Edited 1647788753
Richard @ Damery
Pro
API Scripter
Major Release: Class & Attacks Databases & lots of fixes! The promised release including the Class Database and the Attacks Database (see 3rd March post) have been uploaded to the repository for release this week, and should be available for 1-Click install and automatic updates from 23-03-22.  As well as everything promised in the previous post, there are a number of other goodies in this mega-release.  I'll start with a list of bug fixes, and then show what's new. Bug Fixes InitMaster v2.044: Fixed support for very slow and very fast weapons, that have fractional "attacks per round" such as 1/3 (one attack per 3 rounds) , 2/5 (two attacks per 5 rounds), 7/3 (7 attacks per 3 rounds) etc.  Mainly this is to support siege weapons, or magically boosted speeds. As a result of the above attack rates such as 3/2, which used to always do 2 attacks on even round numbers and 1 attack on odd, now keep a running record of attacks done so that if the last attack (whenever done) was 1 attack in a round, the next will be 2, and visa-versa.  However, if the character changes weapon, this is reset to the lower number for when it is next taken in hand. CommandMaster v2.027 The "Specials" action button which displays the text in the Advanced 2e sheet monsterspecattacks  and monsterspecdefenses  fields (mainly so DMs don't forget a monster's characteristics in battle) was not working and is now fixed.  All Character Sheets to which this action button has already been added will be (should be?) automatically updated so that they work. MagicMaster v3.051 Using the API with Character Sheets where the Spells, Powers, Weapon or Potions tables had been manually added to or updated by hand (rather than using the API functions) could result in API errors.  E.g. using the Memorise Spells menu would display, but would not actually memorise the spells chosen.  This has been fixed - at least to the extent it has been discovered to date: please let me know if you find further issues. Installing the MagicMaster API could cause "Infinite Loop" errors in the sandbox.  This was no an infinite loop, but just the API taking a long time to update or create all the databases it comes with.  This has been fixed by making the database load/update asynchronous and giving the processor & browser some space & time for housekeeping and other things! Spell storing magic items and multi-spell scrolls worked first time, but they did not work after subsequent adding of them to other characters from the databases (e.g. using the --gm-edit-mi menu).  The code was trying to tidy up after itself too much: recoded it not to delete the key custom attributes from the database Character Sheets, so can now be added to multiple characters as required. Some disabled buttons were showing white text on a light grey background, and virtually unreadable.  This has been changed to black text on a light grey background. AttackMaster v2.046 Multiple updates to the Weapon and Armour Databases to bring them into line with current RPGMaster API standards - some differences were causing errors. Using the API with Character Sheets where the Melee & Ranged Attack tables had been manually added to or updated by hand (rather than using the API functions) could result in API errors. This has been fixed - at least to the extent it has been discovered to date: please let me know if you find further issues. Adding weapons manually that had parentheses '(' & ')' would cause API buttons to function incorrectly (as part of the syntax of an API button includes the use of '(' and ')' ).  The APIs now strip the parentheses from the weapon name before including it in any button commands meaning that they work. Fixed handling of weapons with any fractional weapon attacks per round value - 7/3 or 2/5 will now work properly. Proficiencies were incorrectly set when taking weapons with multiple types in-hand (such as Bastardsword|Shortsword for a Sun-blade), sometimes ignoring a proficiency or specialisation in one of the types if not finding the other type in the proficiency table.  This has been fixed, with any one type being matched if possible. Innate weapons (ones that do not require a proficiency to be used without penalty) were not being handled properly.  All aspects fixed that I have found issues with - let me know if you find any others.
1647789189

Edited 1648053807
Richard @ Damery
Pro
API Scripter
New Functionality In addition to the new functions shown in my post of 3rd March , I have created some additional goodies for the mega-merge this week: RoundMaster v4.031 Added the ability to use  any  token marker set that you have loaded to the campaign with the --addstatus, --target, or other status and marker management commands.  I've added the --listmarkers command to display all the ones you have loaded, and hovering over any marker in this display will display a tooltip of the marker name to use with the commands. However:  note that the RPGMaster API libraries that define spells & powers that target tokens with statuses continue to use the default marker set - I cannot assume that a GM / game creator has any specific marker set loaded.   But  you can have the joy of copying the spells and powers you want to update to your own databases and changing the markers used!  Follow the instructions in the relevant Help Handouts to do this, or watch my videos from the RPGMaster Wiki . InitMaster v2.044 Made initiative actions such as "Move", "Change Weapon", "Do Nothing" and "Other" (which allows text entry for the action and a number for the speed) appear on the top Initiative Menu, rather than having to click through to another menu. CommandMaster v2.027 Added buttons to the "Token Setup" menu to check and specify who controls which Character Sheets, and allow changing of control between the DM and specified Players.  This highlights Character Sheets that have inconsistent settings between the token and the Character Sheet which might reveal DM's creatures or NPCs to Players in the Turn Order, for instance. Added buttons to the "Token Setup" / "Add to Spellbok" menu for Priests to "Add all valid Priest spells" specified for the Priest class in the Class-DB, and for Powers "Add all Class powers" as in the Class-DB.  See the Class-DB Help Handout for details of how spells and powers are specified for classes. MagicMaster v3.051 Added all the Class Powers needed for the Classes in the initial Class-DB to the distributed Powers-DB Depending on the --config menu settings, Spell casters are restricted to memorising only spells their class and/or specialisation allows then to know, even if they have it in their spell book.  They may copy that spell from a scroll into their spell book, forgetting they can't know it! AttackMaster v2.046 Added the Class Database as promised in earlier post (sorry it's a week late: found - and fixed - some bugs!), with initially the standard Classes from the Player's Handbook, plus some Priest classes from The Complete Priest's Handbook.  Later Releases will add more, but you can add your own to your own databases by following the instructions in the new Class Database Help Handout created when loading the API. Class definitions in the new Class Database now include the possibility to add custom Saving Throw tables for the Character Class.  The syntax used also allows Saving Throw modifiers to be added to Magic Item definitions in the Magic Item Databases, such as to "Rings of Protection", for automatic inclusion in saves when in a character's possession. Added the Attacks Database also as promised.  This has the standard attack calculations for AD&D 2e as I understand them and as my group are currently using them.  They are there to be added to and changed, but very important to read the Attack Database Help handout before attempting this!  As a little easter egg (as its getting close to that time) I've added a custom attack template set for a prepared Oil Flask as a thrown weapon. Characters can now "Lend a Hand" to another character via the "Change Weapon" menu, so that the number of hands are added together to use weapons such as Ballista siege weapons, ship's rigging, etc.  The character lending the hands just clicks the button on the menu, targets the receiving character, and that's it - the receiving character now has that many additional hands.  Multiple characters can all lend their hands to a single receiving character so that large items such as Battering Rams can be used.  If the donating character uses the "Change Weapon" menu again to select a new weapon to have in hand, the hands are removed from the receiving character, and any item held that needs more hands than are left is dropped.
1648550288

Edited 1648550315
Richard @ Damery
Pro
API Scripter
The latest release of the RPGMaster APIs is now available via One-Click install and automatic update.  Sorry for the slight delay. Important Note for existing users of RPGMaster APIs, especially RoundMaster:  In order for RoundMaster API to work, you will need to install libTokenMarkers API  from the One-Click install - this is required even if you are only using the default token marker set.  Unfortunately, the Roll20 automatic update will not do this for you.
1648568338

Edited 1648568386
Richard @ Damery
Pro
API Scripter
I have added two new Wiki pages for the RPGMaster  databases: Class-DB and Attacks-DB  to provide (hopefully) clear help on how to add your own classes and attack calculations (to replace the current ones or add specialist classes and attacks): Class Database Wiki page Attacks Database Wiki page I'll add separate wiki pages for the other databases in the next few days.  My intension is to eventually have all the rulesets exposed in the databases so that I (or others) can easily convert the RPGMaster series APIs to completely different game systems just by providing a different set of databases, each of which will be held in separate library APIs, so Game Creators can load the RPGMaster APIs and any one of the game-system-specific library APIs and, hey-presto, they work for that game system! In order to achieve this, my next task is to separate the APIs from using the Roll Templates specific to Peter B.'s excellent Advanced 2nd Edition  character sheet, and for the APIs to use their own Roll Template interpreter - I still like the short-hand notation of the roll template as an easy way of defining output, and I'll hide the interpretation in the APIs.  I know ScriptCards  and PowerCards  exist (and if you like them, you can use them in the database macros already!) but I want an easy and simple alternative that can support what I've already programmed.
Keeping this thread alive, ready for RPGMaster v2.0, which will be structured in such a way as to make it easier for the APIs to be adapted for game systems other than AD&D2e.  The suite will include the standard 5 APIs - RoundMaster, InitiativeMaster, AttackMaster, MagicMaster, and CommandMaster, but they will be accompanied by a new API library called RPGM2e, which holds all the game-specific data and processing for AD&D2e extracted from the other APIs, including its own Roll Template processing system so as not to be reliant on any particular character sheet.  Future releases of the RPGM library will be of other game-specific API libraries to support other game systems and their character sheets. I'm an AD&D2e player almost exclusively, but my daughter plays 5e, and have those in my group familiar with Pathfinder.  I'm open to suggestions of other game systems to work towards, especially those with similar rule structures to D&D and especially AD&D2e - it would be nice to start with a closely aligned one to try things out.  Any suggestions? I might start a Patreon subscription page to fund such work, if anyone is interested in funding it?
This is absolutely amazing! Watching the videos now and can't wait to play.
snuh said: This is absolutely amazing! Watching the videos now and can't wait to play. I hope you and your players enjoy them as much as our group do.  Let me know if you have any suggestions or comments, and especially if you come across any bugs! (Hopefully not... been stable for us for a while now)
1653319964

Edited 1653320078
Richard @ Damery
Pro
API Scripter
New Bug in InitMaster v2.046:  Apologies but the latest release that has just gone live for InitMaster (v2.046) has a bug that stops Characters, NPCs and Monsters from selecting "Move", "Change Weapon", "Do Nothing" or "Other" as Initiative actions.  All other initiative actions are working.  The updates in v2.046 are not critical unless your characters are using dancing weapons (such as the Quarterstaff-of-Dancing, or Dancing-Longbow magical weapons in the databases), or using the "Group" initiative rule variant. Workaround:  just revert back to the previously released version (v2.045) by going to the API Script page for your campaign, selecting the InitMaster tab, and selecting 2.045 from the Version Selection Dropdown  at the top left of the page, and then selecting [Save Script]. Fix ETA: the fix is highly likely to be investigated, fixed, tested and released in the next week, for release by 1 June.
The bug in InitMaster v2.046 has been fixed and released, and those who have it loaded from the One Click should have been updated a couple of weeks ago.  Sorry for the late notice on this - been a bit busy (playing face-to-face D&D as it happens - a house full of 6 fiends!).
News Update on RPG Master v2 I am currently working hard on RPG Master v2.  This will be a complete new release of all the APIs in the RPG Master series, and includes the previously heralded RPG Game Library which will be interchangable for different game systems, starting with AD&D2e, followed hopefully reasonably swiftly by a version for Pathfinder. Even the version for AD&D2e (currently supported by the RPG Master v1 APIs) will have some new goodies added, such as a Roll Template parser totally separate from Character Sheets (so I can support multiple game systems) and with user configurable image graphics, per-player selectable Dark Mode, GM-definable field comparison messages (i.e. Success/Failure messages extended to cover comparison of any two named Roll Template fields), improved Targeted & non-Targeted attack result graphics, as well as other features such as support for Punching & Wrestling non-leathal attacks and many, many more features. RPG Master AD&D2e is currently in final Play Testing with my D&D group - still finding some bugs, so perhaps a few weeks yet.