Home Artists Posts Import Register

Downloads

Content

! See bottom of post for updates !

Hi all, introducing [CGMZ] Hooks!

This plugin allows you to write and run custom JavaScript code when certain actions occur. Some of these actions are from the base code, while others are CGMZ functions. Below is a list of the current hooks you can write custom JS for via this plugin:

RMMZ:

  • Common Event

  • Gold Changed

  • Item Changed

  • Actor Added

  • Actor Removed

  • Level Up

  • Level Down

  • Learn Skill

  • Forget Skill

  • Skill Use

  • Change Class

  • Get On Vehicle

  • Get Off Vehicle

  • Battle Start

  • Battle Win

  • Battle Escape

  • Enemy Kill

  • Switch Change

  • Variable Change

CGMZ:

  • After Load

  • Toast Window

  • Screenshot

  • Achievement Earned

  • Profession Level Up

  • Profession Level Down

  • Craft

  • Fast Travel

  • Difficulty Change

  • Skill Purchase

  • Dungeon Tool Use

  • Dungeon Tool Interact

You can also make custom hooks, assign them an ID, and then call that hook via plugin command. This is useful if you have a script command you use frequently, you can write (and edit it) once as a custom hook and then run it in many different places via the plugin command, similar to how my Sound IDs plugin works.

Of course over the course of the alpha/beta process this list will expand quite a lot! But, it will be helpful for me to know which other actions you'd like to run your own custom JavaScript code for. Leave suggestions below or in the #suggestions channel on my Discord!

Happy RPG Making!

Alpha R2: Hi all, this plugin was updated today with 2 new hooks as requested by users of the plugin: On Skill Use and On Enemy Kill. On Skill use will run the hook whenever a skill is used by either an actor or an enemy. This could be in battle, or from the menu for healing skills. On Enemy Kill will run the hook when an enemy dies in battle. This was suggested as a way to track enemy kills for a quest in [CGMZ] Quest System, but could also be used for other purposes too.

Alpha R3: Hi all, this plugin was updated with a new hook: Skill Purchase. This hook will run whenever you buy a skill from the [CGMZ] Skill Shop, and it will provide you easy access to the skill that was purchased, the price it was purchased at, and the actor that learned the skill in your JS parameter.

This update also fixes a bug with learning skill hooks, as they would fail to run due to a previous update causing the hook to run after the skill was already learned. Finally, this plugin will no longer crash when invalid JSON is detected, it will instead warn you in the dev tools console. These errors are still important to fix, as they will prevent your hook with the JSON error from working properly.

This update added some new hooks for you to try out and fixed a bug. For default RMMZ hooks, this update adds a hook for game variable and game switch changes. Now you can run custom JS whenever you change a variable or switch.

For CGMZ hooks, this update adds hooks for dungeon tool use and interact. Now you can run custom JS whenever a dungeon tool is used, and whenever a dungeon tool interacts with an event.

This update also fixed a bug with the Skill Purchase hook for [CGMZ] Skill Shop, so the actor argument should now correctly populate.

Comments

No comments found for this post.