Roll20 Mods (API Scripts) are literal game-changers. These powerful tools allow you to enhance your games by tapping directly into Roll20’s code. Imagine instantly rolling initiative for an entire group or automating spell effects to appear on the map with a single command. Roll20 Mods are available exclusively to Pro Subscribers, who can both install community favorites and code their own!

Many Roll20 Mods have been created by and for the community throughout the years to enhance the gameplay experience on Roll20. Our team is thrilled to announce that we have been working to convert the most popular ones for the D&D 2024 Character Sheet so that Pro Subscribers can start the new year with more tools at their disposal. 

 The first three are currently being launched:

  • Group Initiative (Available Now!) – Roll initiative for all selected player/enemy tokens at once and have them appear in the turn tracker. 
  • Group Check (Available Now!) – Roll a group check for all selected player enemy tokens, such a dex save for all creatures affected with the click of one button. 
  • ChatSetAttr (Up next!) – Allows you to create, modify, or delete characters’ attributes via chat commands (or macros containing these commands). 

This is an ongoing project and we plan to update and release some of the most popular scripts along with documentation so that you can also learn to create and port your own scripts for use with the D&D 2024 Character Sheet.

A Note on Script Compatibility for Multi-Sheet Games

The ability to use both the D&D 2014 and 2024 character sheets in the same game has introduced additional complexity in how scripts interact with each sheet. We are exploring opportunities for scripts to work with both sheets in a single game early in the new year. For this initial launch, here’s what you need to be aware of if you’re running multi-sheet games.

  • Single-Sheet Games: The new scripts work seamlessly with either D&D 2014 or 2024 sheets, respectively.
  • Multi-Sheet Games:
    • If D&D 2024 is the primary sheet, the new scripts will only interact with the 2024 sheets.
    • If D&D 2014 is the primary sheet, the new scripts will only work interact with the 2014 sheet

How can I learn more about using Mods in my Roll20 games?

This video provides a showcase of some game-changing Mods for Roll20. Watching it is a great start to opening your mind to the capabilities of this tool. 

How do I start converting/writing my own Mods for use with Roll20’s D&D 2024 Character Sheet?

The functions used to get and set character data on the 2024 sheets have changed from synchronous to asynchronous functions. Anywhere where you would get or set an attribute, by getAttrByName or findObjs or any other similar function on a 2024 sheet, will now have to use the following functions:

async getComputed({ characterId, property })

async setComputed({ characterId, property, args })

Because these functions are asynchronous, if you want to use the result of that function (for example, getting a character’s hp value), you’ll have to use either async/await syntax or promises to ensure you’re waiting for the result to come back.

In addition, these functions only exist on the Experimental API. To use the API with the new sheets like D&D 2024, you’ll have to go into your game’s “Mod (API) Scripts” settings and update the API Sandbox Version to Experimental instead of Default.

This change is only for accessing and changing data on advanced sheets like D&D 2024, not legacy sheets like 2014, which still use the previous functionality like getAttrByName or setAttrs. To make a script compatible with both 2024 and 2014 sheets, you can check the character sheet type of the character the function is being called on using the property charactersheetname, and return the correct value. Keep in mind that this won’t resolve issues with multi-sheet games, but it will allow the script to work in both 2014 and 2024 games. Here’s a helper function that handles this logic:

const getAttribute = async (characterId, property) => {
        const character = getObj(“character”, characterId);
        const sheetShortname = character.get(“charactersheetname”);
        if (sheetShortname === “dnd2024byroll20”) {
            return await getComputed({ characterId, property });
        }
        return getAttrByName(characterId, property);
    };

These updates only apply to places where you’re handling attributes. Every other function should work as it did before, including sending chats, getting characters, and getting or manipulating graphics and tokens.

More detailed documentation will be coming in January, but we wanted to get the basic idea out to you as soon as it became possible to upgrade your scripts, so you can begin to play around with the new functionality and get a head start on conversion.

Anne Richmond Marketing Manager

Anne Richmond is a Marketing Manager at Roll20 with experience in community management and communications for board game distribution, miniatures wargaming, and TTRPG’s. As a passionate storyteller, Anne has been a contributor to Queerfinder on DriveThruRPG and her “actual play” work can be seen on the Glass Cannon Network, Beadle & Grimm, the Professional Casual Network, Hearthsinger Games, and The Lost Mountain Saga (which later became an official module for Vaesen). Anne is a also a musical theater enthusiast, Survivor fan, and Seattle resident alongside her husband, her cat, Tonks, and her dog, Samwise.

Discover more from Roll20 Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading