Tutorials ‐ How to Make CPR Actions in Token Action Hud - MotoMoto1234/Midi-Wiki GitHub Wiki
Optional: Toggle edit unlock CPR's action compendium for a future optional step
-
Click the folder macros button to the left of the hotbar:
-
Make a macro folder called whatever, I called it Generic Actions:
-
Create a new macro using the macro button on the folders bar:
4(v11 CPR only). Copy and Paste the following code and edit the first line of the code to match the name of the generic action:
let featureName = 'Dash';
let feature = token.actor.items.getName(featureName);
if (!feature) {
let featureData = await chrisPremades.helpers.getItemFromCompendium('chris-premades.CPR Actions', featureName, false);
if (!featureData) return;
feature = new CONFIG.Item.documentClass(featureData, {parent: token.actor});
let targetUuids;
if (game.user.targets.size === 0) {
targetUuids = [token.document.uuid];
} else {
targetUuids = [game.user.targets.first().document.uuid];
}
let options = {
'showFullCard': false,
'createWorkflow': true,
'targetUuids': targetUuids,
'configureDialog': false,
'versatile': false,
'consumeResource': false,
'consumeSlot': false,
'workflowOptions': {
'autoRollDamage': 'always',
'autoFastDamage': true
}
};
await MidiQOL.completeItemUse(feature, {}, options);
} else {
await feature.use();
}
4(V12 CPR only) Copy and Paste the following code and edit the first line of the code to match the name of the generic action:
let featureData = await chrisPremades.utils.compendiumUtils.getItemFromCompendium('chris-premades.CPRActions', 'Check Cover', {object: true});
await chrisPremades.utils.workflowUtils.syntheticItemDataRoll(featureData, actor, [game.user.targets.first() ?? _token])
OPTIONAL: You can duplicate a generic action item, and change it, then store it in a compendium of your own, then pass that compendiums pack ID in place of chris-premades.CPR Actions
in either v11 or v12 versions of the macro.
OPTIONAL: Copy and paste the filepath of the generic action in the now unlocked CPR actions compendium and then paste the same path into the macros icon path
Note: You can't get the filepath without first unlocking the CPR action compendium temporarily for this task
-
Repeat this till you have made all of the macros in the macro folder
-
Navigate to the compendium sidebar and create a new Macro Compendium called whatever, I used "Generic Actions" note: this will show in the token action hud beware.
-
Go back to the folder macro window and right click on the macro folder you made with all the macros in it and choose Export to Compendium and pick the compendium you just made in step 6.
-
Unlock your Token Action Hud
-
Click the icon to the right of the lock, and in the next window make a new category called Generic Actions(or whatever)
-
Right click the newly created category, in that window click the white field and scroll down till you see your "Generic Actions" compendium or whatever you named the compendium in step 6
Addendum: You also need to set player permissions to the Generic Actions Compendium.
Also you may need to restart your client for changes to take effect with token action hud.