Latest version | 1.0.6 |
---|---|
Minimum Core | 0.6.0 |
Compatible Core | 0.7.9 |
Last updated | 3 years ago |
Created | 4 years ago |
Authors | |
Languages |
|
Systems | All systems |
Project source | Project URL |
Report bugs | Bug tracker URL |
Using this Foundry VTT module, you can mark macros as active giving them a coloured border and an alternative icon.
Experiencing issues? Ping me on the Foundry Discord Server: Stan#1549
Dimming the inactive macros is configurable in the module settings.
This module is 100% compatible with Custom Hotbar and Token Hotbar!
The primary way to use this module, is to set a condition or trigger when the marker is activated. This is done in the macro configuration. This dialog now has an extra tab named "marker".
The script will execute on any change to the character sheet, when the hotbar renders (e.g. on page changes) and when you select a token.
When the script returns true
, the marker will be activated. When it returns false
, it will be deactivated.
Like in the actual macro, you can use the this
(current macro), token
(selected token), actor
(actor of selected token) and character
(the user's character) variables.
Example: The following trigger activates the marker when a) a token is selected; and b) the strength modifier is less than 0.
if (!token)
return false;
return actor.data.data.abilities.str.mod < 0;
If using a trigger like the one above is not an option, you can use flags instead.
Alternatively, you can return a colour to dynamically colour your marker:
if (!token)
return false; // marker deactivated
const hp = actor.data.data.attributes.hp.value;
const max = actor.data.data.attributes.hp.max;
const ratio = (hp / max) * 100;
if (ratio < 33) return "red"; // active marker with a red colour
if (ratio < 67) return "#FF8000"; // active marker with an yellow colour
return false; // marker deactivated
If using a trigger like the one above is not an option, you can use flags instead.
You can toggle the state on one of three entities:
NB: Flag-based toggles should only be used inside the actual macro, not inside the marker configuration!
Toggling the state on the macro will make it visible for every user, irregardless of the token they have selected.
MacroMarker.toggle(macro);
NB:
macro
is a variable pointing to a macro. In general you can usethis
instead inside your own macros or you can toggle another macro by finding it ingame.macros
. For examplelet macro = game.macros.getName('Toggle Rage');
. The script macro then becomes this to toggle itself:MacroMarker.toggle(this);Or this to toggle another macro:
let macro = game.macros.getName('Toggle Rage'); MacroMarker.toggle(macro);
Toggling the state on the token will make it visible for whoever controls the token. If the token is linked, the state will be synchronized across all other linked tokens of the same actor.
let token = canvas.tokens.controlled[0];
if (token)
MacroMarker.toggle(macro, { entity: token });
Toggling the state on the user will make it visible for only that user irregardless of the token they have selected.
let user = game.user;
MacroMarker.toggle(macro, { entity: user });
Alternatively, you can manually activate and deactivate it, using the same function signature as the toggle
function.
NB: Manual toggles should only be used inside the actual macro, not inside the marker configuration!
MacroMarker.activate(macro);
MacroMarker.deactivate(macro);
MacroMarker.activate(macro, { entity: user });
MacroMarker.deactivate(macro, { entity: token });
Finally, you can also check the state:
MacroMarker.isActive(macro);
MacroMarker.isActive(macro, { entity: token });
MacroMarker.isActive(macro, { entity: user });
You can configure an alternative tooltip, icon and colour when editing the macro.
You can find more examples in the included compendium Macro Marker Examples.
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: macro-marker 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.