The api is reachable from the variable game.modules.get('downtime-dnd5e').api or from the socket libary socketLib on the variable game.modules.get('downtime-dnd5e').socket if present and active.
The documentation can be out of sync with the API code checkout the code if you want to dig up API
You can find some javascript examples here => macros <=
This method will update the selected Tracked Item, replacing the value of the progress property with the value provided.
Returns: Promise<void> - Return nothing
| Param | Type | Description | Note |
|---|---|---|---|
| actor | Actor or string |
The reference to the actor can be the Actor object or the id or the uuid or the name of the actor (it is advisable to not use the name it will remain for retro compatibility) | |
| activityName | string |
The activity name, is a string that matches the name of the Tracked Item you'd like to update. It's case sensitive. | |
| newProgress | number or string |
The progress to apply is an integer. This is the value you'd like to set the item's progress to. (can be a number on string format too) |
Example basic:
await game.modules.get('downtime-dnd5e').api.updateActivityProgress("Nazir", "Smithing Proficiency", 75)or
await game.modules.get('downtime-dnd5e').api.updateActivity("Nazir", "Smithing Proficiency", 75)Return all the activities on the actor
Returns: Activity[] - Return all the activities on the actor
| Param | Type | Description | Note |
|---|---|---|---|
| actor | Actor or string |
The reference to the actor can be the Actor object or the id or the uuid or the name of the actor (it is advisable to not use the name it will remain for retro compatibility) |
Example basic:
game.modules.get('downtime-dnd5e').api.getActivitiesForActor("Nazir")or
game.modules.get('downtime-dnd5e').api.getActivities("Nazir")Return a specific activity on the actor
Returns: Activity - Return a specific activity
| Param | Type | Description | Note |
|---|---|---|---|
| actor | Actor or string |
The reference to the actor can be the Actor object or the id or the uuid or the name of the actor (it is advisable to not use the name it will remain for retro compatibility) | |
| activityName | string |
The activity name, is a string that matches the name of the Tracked Item you'd like to update. It's case sensitive. |
Example basic:
game.modules.get('downtime-dnd5e').api.getActivity("Nazir", "Smithing Proficiency")Return all the categories on the actor
Returns: Category[] - Return all the categories on the actor
| Param | Type | Description | Note |
|---|---|---|---|
| actor | Actor or string |
The reference to the actor can be the Actor object or the id or the uuid or the name of the actor (it is advisable to not use the name it will remain for retro compatibility) |
Example basic:
game.modules.get('downtime-dnd5e').api.getCategories("Nazir")This method will update the selected Tracked Item, replacing the value of the progress property with the value provided.
Returns: Promise<void> - Return nothing
| Param | Type | Description | Note |
|---|---|---|---|
| activityName | string |
The activity name, is a string that matches the name of the Tracked Item you'd like to update. It's case sensitive. | |
| newProgress | number or string |
The progress to apply is an integer. This is the value you'd like to set the item's progress to. (can be a number on string format too) | |
| explicitActor | Actor or string |
OPTIONAL: The reference to a explicit actor can be the Actor object or the id or the uuid or the name of the actor (it is advisable to not use the name it will remain for retro compatibility) | ATTENTION: If no explicit actor is benn set the actor connected to the player will be used |
Example basic:
await game.modules.get('downtime-dnd5e').api.updateWorldActivityProgress("Smithing Proficiency", 75, "Nazir")or
await game.modules.get('downtime-dnd5e').api.updateWorldActivity("Smithing Proficiency", 75, "Nazir")Return all the world activities on the actor
Returns: Activity[] - Return all the activities of the world
| Param | Type | Description | Note |
|---|
Example basic:
game.modules.get('downtime-dnd5e').api.getWorldActivities()Return a specific activity world
Returns: Activity - Return a specific activity
| Param | Type | Description | Note |
|---|---|---|---|
| activityName | string |
The activity name, is a string that matches the name of the Tracked Item you'd like to update. It's case sensitive. |
Example basic:
game.modules.get('downtime-dnd5e').api.getWorldActivity("Smithing Proficiency");Return all the world categories on the actor
Returns: Category[] - Return all the categories of the world
| Param | Type | Description | Note |
|---|
Example basic:
game.modules.get('downtime-dnd5e').api.getWorldCategories()