Latest version | 1.3.0 |
---|---|
Minimum Core | 12 |
Compatible Core | 12 |
Last updated | 3 months ago |
Created | 5 months ago |
Authors |
|
Languages |
English |
Systems |
Dnd5e |
Project source | Project URL |
Report bugs | Bug tracker URL |
Changelog | Changelog URL |
License | License URL |
dnd5e
system, which allows you to attach one or more JS scripts to an item. Each of these scripts can have multiple triggers that determine when or how the script is executed.After installing this module, you can find a 'Scriptable Items' button in any item sheet header. Clicking this button opens an overview where you can edit that item's scripts.
A script receives the following arguments (very similar to a normal Foundry macro!) when run:
this
- is a copy of the Script itselfitem
- the item containing the scriptspeaker
- speaker data of the item's Actor or the currently selected token or user's characteractor
- actor from the speaker data, usually the item's ownertoken
- token from the speaker datacharacter
- the current user's character or nulltrigger
- the trigger of the script, such as a button press or on item use. Is equal to debug
when ran from the script's config sheet.optional
- an object containing additional, optional arguments
optional.message
- The chat message containing the clicked button (if trigger === "button"
is true)Available triggers are currently:
preUseItem
- When using the item (Hook is dnd5e.preUseItem
)
true
from the scriptitem.use()
inside the script, you can use item.use({}, {skipScripts: true})
button
A button in the item's chat card that triggers the script when clickedaddToActor
When the item is added to an actorremoveFromActor
When the item is removed from an actorFor more information and submitting issues as well as pull requests, visit the modules page at https://github.com/FurtherV/scriptable-items.
To install this package, open your Foundry Setup screen and navigate to your Module tab and click the Install Module button.
From there, you can either search for the package unique name: scriptable-items or copy its manifest URL:
And paste it to the input box at the bottom of your window.
You can install this package directly to your Forge account.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Advertisement cookies are used to deliver visitors with customized advertisements based on the pages they visited before and analyze the effectiveness of the ad campaign.