-
-
Notifications
You must be signed in to change notification settings - Fork 38
Developers
This page is meant to provide Macro / Module / System developers with documentation on public API endpoints of my Module.
Corresponds to Application.close(). Can be used to close the Quest Log.
QuestLog.close()Corresponds to Application.render(). Can be used to force Quest Log open.
QuestLog.render(true)Corresponds to Application.rendered. Can be used to check if Quest Log is currently rendered (visible).
if (QuestLog.rendered)Enables and toggles direction of sorting. target can be one of: actor, title, checkedTasks.
direction is optional parameter, that when provided with asc or desc, sets desired direction instead of toggling it.
QuestLog.toggleSort('title', 'asc')
QuestLog.toggleSort('checkedTasks')Retrieves the "entity-like" instance of Quest class, provided the questId was valid Quest ID, Quest exists and user has permission for it.
Otherwise returns undefined
Quests.get("EtC6FyAEaxX9XeNC");Opens the Details window of Quest, provided the questId was valid Quest ID, Quest exists and user has permission for it.
Otherwise pushes error notification.
Quests.open("EtC6FyAEaxX9XeNC");Programmatically creates new Quest and returns it's instance.
actor needs to be valid Actor._id.
tasks and rewards needs to be arrays of respective instantiated objects, created by next API calls.
let quest = Quests.create({
actor: qgActor._id,
title: "My new Quest",
description: "It's <b>the best!</b>",
gmnotes: null,
tasks: [],
rewards: rewardsArray
});Programmatically creates new Reward and returns it's instance.
Supported types: Item, Abstract.
Item requires valid ItemData under risk of breaking when trying to apply Reward to an Actor.
Abstract requires exactly two data properties: { name: '', img: '' }, where img should be valid path.
let item = game.items.get("a5dhZpWjcVci8HbX");
let itemData = duplicate(item);
let reward = Quests.reward.create({
type: "Item",
data: itemData,
hidden: true
});Programmatically creates new Task and returns it's instance.
let task = Quests.task.create({
name: "Retrieve @Item[Silver Amulet]",
hidden: false
});If you can, please consider supporting me through my Patreon page. Thanks!
Forien's Quest Log is a module for Foundry VTT by Forien and is licensed under a Creative Commons Attribution 4.0 International License.
This work is licensed under Foundry Virtual Tabletop EULA - Limited License Agreement for module development from May 29, 2020.