diff --git a/wiki/Modifying-Your-Game-with-Scripts.md b/wiki/Modifying-Your-Game-with-Scripts.md index 9bcdf9139e..922a177041 100644 --- a/wiki/Modifying-Your-Game-with-Scripts.md +++ b/wiki/Modifying-Your-Game-with-Scripts.md @@ -46,8 +46,9 @@ Hooks.once("init", () => { CONFIG.DND5E.abilities.grt = { label: "Grit", abbreviation: "grt", - type: "mental", ///mental or physical - defaults: {vehicle: 0} ///Optional + type: "mental", // mental or physical + defaults: {vehicle: 0}, // Optional + improvement: false, // Explicitly set this to 'false' to prevent it showing up for ASIs. }; }); ``` @@ -108,15 +109,16 @@ Hooks.once("init", () => { ## Add new Feature Item Type and Subtypes ```js /// Adds in a new feature type, similar to "Class Feature" called "Martial Exploit", with 3 different subtypes for it. -Hooks.once("setup", function(){ +Hooks.once("init", () => { CONFIG.DND5E.featureTypes.marexploit = { - label: "Martial Exploit", - subtypes: { - first: "1st-Degree", - second: "2nd-Degree", - third: "3rd-Degree" + label: "Martial Exploit", + subtypes: { + first: "1st-Degree", + second: "2nd-Degree", + third: "3rd-Degree" } -}; + }; +}); ``` ## Add a new Armor Calculation @@ -141,24 +143,24 @@ Hooks.once("init", () => { ## Remove, Rename, and Add new Languages ```js /// Removes Common, Renames Deepspeech to Voidspeech, and adds a languages called Ochnun -Hooks.once("setup", function addLanguages(){ +Hooks.once("init", () => { delete CONFIG.DND5E.languages.common; CONFIG.DND5E.languages.deep = "Voidspeech"; - CONFIG.DND5E.languages.ochnun= "Ochnun"; + CONFIG.DND5E.languages.ochnun = "Ochnun"; }); ``` ## Add new Item Activation Cost Types ```js /// Adds in options to display in the Activation Cost dropdown -Hooks.once("setup", function(){ - CONFIG.DND5E.abilityActivationTypes.crithit = 'Critical Hit'; - CONFIG.DND5E.abilityActivationTypes.attack = 'On Attack'; - CONFIG.DND5E.abilityActivationTypes.attack = 'Replaces Attack'; - CONFIG.DND5E.abilityActivationTypes.meleehit = 'On Melee Hit'; - CONFIG.DND5E.abilityActivationTypes.rangedhit = 'On Ranged Hit'; - CONFIG.DND5E.abilityActivationTypes.weaponhit = 'On Weapon Hit'; -}), +Hooks.once("init", () => { + CONFIG.DND5E.abilityActivationTypes.crithit = "Critical Hit"; + CONFIG.DND5E.abilityActivationTypes.attack = "On Attack"; + CONFIG.DND5E.abilityActivationTypes.replaceattack = "Replaces Attack"; + CONFIG.DND5E.abilityActivationTypes.meleehit = "On Melee Hit"; + CONFIG.DND5E.abilityActivationTypes.rangedhit = "On Ranged Hit"; + CONFIG.DND5E.abilityActivationTypes.weaponhit = "On Weapon Hit"; +}); ``` ## Add new Weapon Types