{ "name": "English", "_id": "pBOyeBDuTeowuDOE", "pages": [ { "sort": 100000, "name": "Getting Started", "type": "text", "category": "mrZHFR2i0MYp7aaY", "_id": "xcR48pakEm49hbc2", "system": {}, "title": { "show": true, "level": 1 }, "image": {}, "text": { "format": 1, "content": "

Thank you for installing Stat Tracker!

This module aims to provide a clean way of keeping track of any data points you want within Foundry, whether that be dice rolls, or other things like how many natural 1s to natural 20s you get.

I was inspired by the dicestats module, however it only allows tracking dice statistics, which is something I found myself needing to work around, so I decided to make this module to fill that gap.

You've already done the hardest part of set up for this module to work on the basic level, installing it! However if you want a more advanced set up for the module, this Journal is your go-to for information.

This module makes use of multiple key terms which are important for your understanding, the main terms you need to understand are:

You can find information about what each of those terms mean within the \"Key Concepts\" section of the documentation or by clicking the above links.

" }, "video": { "controls": true, "volume": 0.5 }, "src": null, "ownership": { "default": -1, "t2sWGWEYSMFrfBu3": 3 }, "flags": {}, "_stats": { "compendiumSource": null, "duplicateSource": null, "exportSource": null, "coreVersion": "13.344", "systemId": "empty-system", "systemVersion": "0.0.0", "createdTime": 1748328891633, "modifiedTime": 1748406648943, "lastModifiedBy": "t2sWGWEYSMFrfBu3" }, "_key": "!journal.pages!pBOyeBDuTeowuDOE.xcR48pakEm49hbc2" }, { "sort": 300000, "name": "Table", "type": "text", "category": "ZPAbuPbVOLWh75hL", "_id": "ugzCCxQskUSYMZR4", "system": {}, "title": { "show": true, "level": 1 }, "image": {}, "text": { "format": 1, "content": "

Tables are quite close to being a \"container\" for every piece of data within the module, every @UUID[Compendium.stat-tracker.docs.JournalEntry.pBOyeBDuTeowuDOE.JournalEntryPage.S7Z6mZ0JablJVQJu]{row} within the module must be associated with a particular table. The table is responsible for maintaining all of the @UUID[Compendium.stat-tracker.docs.JournalEntry.pBOyeBDuTeowuDOE.JournalEntryPage.e9FYKidbfFnnTspO]{bucket} and @UUID[Compendium.stat-tracker.docs.JournalEntry.pBOyeBDuTeowuDOE.JournalEntryPage.IXZpEBEJsvOpY3OL]{graph} configurations, controlling what data is allowed to be saved and how to represent that data.

You can manage almost all tables within the module by using the @UUID[Compendium.stat-tracker.docs.JournalEntry.pBOyeBDuTeowuDOE.JournalEntryPage.Z31C8BPl4ZXDn3R6]{Table Manager}.

" }, "video": { "controls": true, "volume": 0.5 }, "src": null, "ownership": { "default": -1, "t2sWGWEYSMFrfBu3": 3 }, "flags": {}, "_stats": { "compendiumSource": null, "duplicateSource": null, "exportSource": null, "coreVersion": "13.344", "systemId": "empty-system", "systemVersion": "0.0.0", "createdTime": 1748329356680, "modifiedTime": 1748394635911, "lastModifiedBy": "t2sWGWEYSMFrfBu3" }, "_key": "!journal.pages!pBOyeBDuTeowuDOE.ugzCCxQskUSYMZR4" }, { "sort": 200000, "name": "Row", "type": "text", "category": "ZPAbuPbVOLWh75hL", "_id": "S7Z6mZ0JablJVQJu", "system": {}, "title": { "show": true, "level": 1 }, "image": {}, "text": { "format": 1, "content": "

Rows make up the vast majority of data that the stat tracker stores. Every dice roll, or custom entry, is saved as a single row.

Each row consists of the following data:

This combination of data can end up becoming a lot of data to load when opening Foundry, if you don't think you'll be resetting the data very often, please consider checking out the different @UUID[Compendium.stat-tracker.docs.JournalEntry.pBOyeBDuTeowuDOE.JournalEntryPage.PcdmuLgNM15h0in1]{Database Adapters} and picking one of them that is most suitable for your campaign.

" }, "video": { "controls": true, "volume": 0.5 }, "src": null, "ownership": { "default": -1, "t2sWGWEYSMFrfBu3": 3 }, "flags": {}, "_stats": { "compendiumSource": null, "duplicateSource": null, "exportSource": null, "coreVersion": "13.344", "systemId": "empty-system", "systemVersion": "0.0.0", "createdTime": 1748329454864, "modifiedTime": 1748394635911, "lastModifiedBy": "t2sWGWEYSMFrfBu3" }, "_key": "!journal.pages!pBOyeBDuTeowuDOE.S7Z6mZ0JablJVQJu" }, { "sort": 400000, "name": "Bucket", "type": "text", "category": "ZPAbuPbVOLWh75hL", "_id": "e9FYKidbfFnnTspO", "system": {}, "title": { "show": true, "level": 1 }, "image": {}, "text": { "format": 1, "content": "" }, "video": { "controls": true, "volume": 0.5 }, "src": null, "ownership": { "default": -1, "t2sWGWEYSMFrfBu3": 3 }, "flags": {}, "_stats": { "compendiumSource": null, "duplicateSource": null, "exportSource": null, "coreVersion": "13.344", "systemId": "empty-system", "systemVersion": "0.0.0", "createdTime": 1748329573212, "modifiedTime": 1748394635911, "lastModifiedBy": "t2sWGWEYSMFrfBu3" }, "_key": "!journal.pages!pBOyeBDuTeowuDOE.e9FYKidbfFnnTspO" }, { "sort": 500000, "name": "The Sidebar Tab", "type": "text", "category": "mrZHFR2i0MYp7aaY", "_id": "ZI6rVlgXYnZGZ3MS", "system": {}, "title": { "show": true, "level": 1 }, "image": {}, "text": { "format": 1, "content": "

This stat tracker comes with a custom sidebar tab that provides a general overview of the module's state as well as short-cuts for opening and controlling settings of the module.

The primary actions within the sidebar are:

" }, "video": { "controls": true, "volume": 0.5 }, "src": null, "ownership": { "default": -1, "t2sWGWEYSMFrfBu3": 3 }, "flags": {}, "_stats": { "compendiumSource": null, "duplicateSource": null, "exportSource": null, "coreVersion": "13.344", "systemId": "empty-system", "systemVersion": "0.0.0", "createdTime": 1748329854358, "modifiedTime": 1748394635911, "lastModifiedBy": "t2sWGWEYSMFrfBu3" }, "_key": "!journal.pages!pBOyeBDuTeowuDOE.ZI6rVlgXYnZGZ3MS" }, { "sort": 600000, "name": "Configuration", "type": "text", "category": "mrZHFR2i0MYp7aaY", "_id": "UuAWTQtd3QMKOWvU", "system": {}, "title": { "show": true, "level": 1 }, "image": {}, "text": { "format": 1, "content": "

The module provides a bunch of settings to be able to control how it interacts with Foundry in various ways. Each setting has a description provided in the settings configuration window, but these descriptions will go more in depth than the ones in there.

Roll Auto-Tracking

This tells the module to automatically track rolls that are sent to the chat, this includes systems, modules, and other rolls like RollTables. As long as it gets sent to the chat, this will allow that roll to automatically be tracked.

By default, this only tracks the standard dice sizes (d4, d6, d8, d10, d12, d20, d100), however you can add any dice size you want by creating a new table named Dice/dX where X is the number of sides the dice should have (e.g. for a 3-sided dice you would make the table name be Dice/d3). By adding a table in this way, it's configuration will be locked for editing and the only way to change it will be to delete the table entirely.

For most systems you will want to leave this setting enabled, because otherwise there is a chance that no dice rolls will be tracked at all unless the system has specifically implemented an integration with the module.

Global API

This setting is primarily targeted at users who would like to integrate stats tracking into macros, as it exposes a globally available stats variable with references to all of the exposed methods and utility helpers of the module. This can sometimes cause conflicts with systems or other modules, so make sure that there isn't already another a global variable named stats before enabling this setting.

Below is an example of how to retrieve the module's API both with and without this setting enabled:

// with it enabled:\nconst statViewer = new stats.Apps.StatsViewer;\nstatViewer.render({ force: true });\n\n// with it disabled\nconst api = game.modules.get(`stat-tracker`)?.api;\nconst statViewer = new api.Apps.StatsViewer;\nstatViewer?.render({ force: true });

Stats Sidebar Tab

" }, "video": { "controls": true, "volume": 0.5 }, "src": null, "ownership": { "default": 0, "t2sWGWEYSMFrfBu3": 3 }, "flags": {}, "_stats": { "compendiumSource": null, "duplicateSource": null, "exportSource": null, "coreVersion": "13.344", "systemId": "empty-system", "systemVersion": "0.0.0", "createdTime": 1748330762378, "modifiedTime": 1748408480001, "lastModifiedBy": "t2sWGWEYSMFrfBu3" }, "_key": "!journal.pages!pBOyeBDuTeowuDOE.UuAWTQtd3QMKOWvU" }, { "sort": 900000, "name": "Utilities", "type": "text", "category": "KGdeJUfatQ9v0raI", "_id": "TQzWrVTEz4oQhLPD", "system": {}, "title": { "show": true, "level": 1 }, "image": {}, "text": { "format": 1, "content": "

The module provides a multitude of utility functions through it's API for usage however desired. This will go over them and describe their purpose.

filterPrivateRows

This method is intended to take @UUID[Compendium.stat-tracker.docs.JournalEntry.pBOyeBDuTeowuDOE.JournalEntryPage.S7Z6mZ0JablJVQJu]{rows} provided by the database and filter out any that the user would not be able to see normally. This is usually called by the database adapters so there's unlikely to be any reason to use it externally.

Available under <api>.utils.filterPrivateRows.

validateValue

Available under <api>.utils.validateValue.

validateBucketConfig

Available under <api>.utils.validateBucketConfig.

" }, "video": { "controls": true, "volume": 0.5 }, "src": null, "ownership": { "default": -1, "t2sWGWEYSMFrfBu3": 3 }, "flags": {}, "_stats": { "compendiumSource": null, "duplicateSource": null, "exportSource": null, "coreVersion": "13.344", "systemId": "empty-system", "systemVersion": "0.0.0", "createdTime": 1748330904988, "modifiedTime": 1748394635911, "lastModifiedBy": "t2sWGWEYSMFrfBu3" }, "_key": "!journal.pages!pBOyeBDuTeowuDOE.TQzWrVTEz4oQhLPD" }, { "sort": 800000, "name": "Database Adapters", "type": "text", "category": "KGdeJUfatQ9v0raI", "_id": "PcdmuLgNM15h0in1", "system": {}, "title": { "show": true, "level": 1 }, "image": {}, "text": { "format": 1, "content": "

This is a list of all available database adapters and how they're configured.

Database

This database adapter isn't a full adapter, this is an abstract class that is used by the other database adapters to enforce a consistent method / interface specification. The general interface includes implementation details for storing the table data in a world setting as well as adding/removing any applications that are rendered as part of the module's operations.

Available under <api>.databases.Database.

User Flag Database

This database adapter uses Foundry's flag system in order to store the row data in the User document, leveraging Foundry's automatic database update propagation to other clients. The application handling and table storage utilizes the abstract implementations.

Available under <api>.databases.UserFlagDatabase.

Condensed User Flag Database

This is unimplemented at the moment. But it will be a database that makes long-term campaign storage more viable, at the tradeoff of not being able to filter data as granularly.

Memory Database

This database adapter should not be used in any actual games, it is intended for development only.

Available under <api>.databases.MemoryDatabase.

" }, "video": { "controls": true, "volume": 0.5 }, "src": null, "ownership": { "default": -1, "t2sWGWEYSMFrfBu3": 3 }, "flags": {}, "_stats": { "compendiumSource": null, "duplicateSource": null, "exportSource": null, "coreVersion": "13.344", "systemId": "empty-system", "systemVersion": "0.0.0", "createdTime": 1748331161024, "modifiedTime": 1748409643379, "lastModifiedBy": "t2sWGWEYSMFrfBu3" }, "_key": "!journal.pages!pBOyeBDuTeowuDOE.PcdmuLgNM15h0in1" }, { "sort": 1000000, "name": "Graph", "type": "text", "category": "ZPAbuPbVOLWh75hL", "_id": "IXZpEBEJsvOpY3OL", "system": {}, "title": { "show": true, "level": 1 }, "image": {}, "text": { "format": 1 }, "video": { "controls": true, "volume": 0.5 }, "src": null, "ownership": { "default": -1, "t2sWGWEYSMFrfBu3": 3 }, "flags": {}, "_stats": { "compendiumSource": null, "duplicateSource": null, "exportSource": null, "coreVersion": "13.344", "systemId": "empty-system", "systemVersion": "0.0.0", "createdTime": 1748393806045, "modifiedTime": 1748394635911, "lastModifiedBy": "t2sWGWEYSMFrfBu3" }, "_key": "!journal.pages!pBOyeBDuTeowuDOE.IXZpEBEJsvOpY3OL" }, { "sort": 1100000, "name": "Table Manager", "type": "text", "category": "mrZHFR2i0MYp7aaY", "_id": "Z31C8BPl4ZXDn3R6", "system": {}, "title": { "show": true, "level": 1 }, "image": {}, "text": { "format": 1, "content": "" }, "video": { "controls": true, "volume": 0.5 }, "src": null, "ownership": { "default": -1, "t2sWGWEYSMFrfBu3": 3 }, "flags": {}, "_stats": { "compendiumSource": null, "duplicateSource": null, "exportSource": null, "coreVersion": "13.344", "systemId": "empty-system", "systemVersion": "0.0.0", "createdTime": 1748393919924, "modifiedTime": 1748394635911, "lastModifiedBy": "t2sWGWEYSMFrfBu3" }, "_key": "!journal.pages!pBOyeBDuTeowuDOE.Z31C8BPl4ZXDn3R6" }, { "sort": 850000, "name": "Enums", "type": "text", "category": "KGdeJUfatQ9v0raI", "_id": "WYaZPgSRDx8L7Zmq", "system": {}, "title": { "show": true, "level": 1 }, "image": {}, "text": { "format": 1, "content": "

Privacy Modes

" }, "video": { "controls": true, "volume": 0.5 }, "src": null, "ownership": { "default": -1, "t2sWGWEYSMFrfBu3": 3 }, "flags": {}, "_stats": { "compendiumSource": null, "duplicateSource": null, "exportSource": null, "coreVersion": "13.344", "systemId": "empty-system", "systemVersion": "0.0.0", "createdTime": 1748394110971, "modifiedTime": 1748394637940, "lastModifiedBy": "t2sWGWEYSMFrfBu3" }, "_key": "!journal.pages!pBOyeBDuTeowuDOE.WYaZPgSRDx8L7Zmq" }, { "sort": 1000000, "name": "Usage Within Macros", "type": "text", "category": "mrZHFR2i0MYp7aaY", "_id": "cpix3FpMmI1U1xXa", "system": {}, "title": { "show": true, "level": 1 }, "image": {}, "text": { "format": 1, "content": "

This module was designed from the ground up with the desire to be able to be used within macros, because of this it has first-class Macro support through the entire API.

Getting the API

The primary API that you will interact with inside of macros is held within CONFIG.stats, this is the core API which allows interacting with the stored data however the user wants it to be stored, it allows accessing the apps to view stats, manage the tables, and create new tables.

The API Methods

Each of the items within CONFIG.stats has a different purpose, but most of the programmatic interactions for the module are most likely to be interested in the CONFIG.stats.db part of the API, which handles all of the data within the module in your configured preference.

" }, "video": { "controls": true, "volume": 0.5 }, "src": null, "ownership": { "default": -1, "t2sWGWEYSMFrfBu3": 3 }, "flags": {}, "_stats": { "compendiumSource": null, "duplicateSource": null, "exportSource": null, "coreVersion": "13.344", "systemId": "empty-system", "systemVersion": "0.0.0", "createdTime": 1748408620967, "modifiedTime": 1748409821925, "lastModifiedBy": "t2sWGWEYSMFrfBu3" }, "_key": "!journal.pages!pBOyeBDuTeowuDOE.cpix3FpMmI1U1xXa" }, { "sort": 700000, "name": "Database Interface", "type": "text", "category": "KGdeJUfatQ9v0raI", "_id": "PlKHrrb61Uc1sGbN", "system": {}, "title": { "show": true, "level": 1 }, "image": {}, "text": { "format": 1, "content": "

This is the interface which all @UUID[Compendium.stat-tracker.docs.JournalEntry.pBOyeBDuTeowuDOE.JournalEntryPage.PcdmuLgNM15h0in1]{Database Adapters} must conform to in order for the module to function. If they do not conform to this a warning will be thrown and the module will override the provided database with a database adapter which does nothing, so that the existing data will be protected from errors.

" }, "video": { "controls": true, "volume": 0.5 }, "src": null, "ownership": { "default": -1, "t2sWGWEYSMFrfBu3": 3 }, "flags": {}, "_stats": { "compendiumSource": null, "duplicateSource": null, "exportSource": null, "coreVersion": "13.344", "systemId": "empty-system", "systemVersion": "0.0.0", "createdTime": 1748408916163, "modifiedTime": 1748409672979, "lastModifiedBy": "t2sWGWEYSMFrfBu3" }, "_key": "!journal.pages!pBOyeBDuTeowuDOE.PlKHrrb61Uc1sGbN" } ], "folder": null, "categories": [ { "name": "Overview", "sort": 100000, "_id": "mrZHFR2i0MYp7aaY", "flags": {}, "_stats": { "compendiumSource": null, "duplicateSource": null, "exportSource": null, "coreVersion": "13.344", "systemId": "empty-system", "systemVersion": "0.0.0", "createdTime": 1748328842906, "modifiedTime": 1748328842906, "lastModifiedBy": "t2sWGWEYSMFrfBu3" }, "_key": "!journal.categories!pBOyeBDuTeowuDOE.mrZHFR2i0MYp7aaY" }, { "name": "API", "sort": 300000, "_id": "KGdeJUfatQ9v0raI", "flags": {}, "_stats": { "compendiumSource": null, "duplicateSource": null, "exportSource": null, "coreVersion": "13.344", "systemId": "empty-system", "systemVersion": "0.0.0", "createdTime": 1748328851997, "modifiedTime": 1748328851997, "lastModifiedBy": "t2sWGWEYSMFrfBu3" }, "_key": "!journal.categories!pBOyeBDuTeowuDOE.KGdeJUfatQ9v0raI" }, { "name": "Key Concepts", "sort": 200000, "_id": "ZPAbuPbVOLWh75hL", "flags": {}, "_stats": { "compendiumSource": null, "duplicateSource": null, "exportSource": null, "coreVersion": "13.344", "systemId": "empty-system", "systemVersion": "0.0.0", "createdTime": 1748329482648, "modifiedTime": 1748329482648, "lastModifiedBy": "t2sWGWEYSMFrfBu3" }, "_key": "!journal.categories!pBOyeBDuTeowuDOE.ZPAbuPbVOLWh75hL" } ], "sort": 0, "ownership": { "default": 0, "t2sWGWEYSMFrfBu3": 3 }, "flags": { "core": { "locked": false } }, "_stats": { "compendiumSource": null, "duplicateSource": null, "exportSource": null, "coreVersion": "13.344", "systemId": "empty-system", "systemVersion": "0.0.0", "createdTime": 1748328832096, "modifiedTime": 1748393668194, "lastModifiedBy": "t2sWGWEYSMFrfBu3" }, "_key": "!journal!pBOyeBDuTeowuDOE" }