MZ [CGMZ] Core

[CGMZ] Core
By: Casper Gaming
Last Update: May 1, 2026
Latest Version: 1.39.0
​
Forum-Header-Introduction.png

The core CGMZ plugin which provides many helper functions for my other plugins. This plugin is used extensively by other CGMZ plugins and is likely to be required.
Forum-Header-Features.png

  • Plug and play, no setup required
  • Allows the use of the CGMZ Engine
Forum-Header-HowTo.png

Import into plugin manager and enable the plugin.

Online documentation can be found on my website.
User documentation can be found on the Casper Gaming Wiki.
Forum-Header-Download.png

Plugin (along with all my other plugins) can be found here: https://www.caspergaming.com/plugins/cgmz/core/
Forum-Header-CreditAndTerms.png

https://www.caspergaming.com/terms-of-use/
Forum-Header-VersionHistory.png

Spoiler: Version History
Version 1.1.0
  • Added function to automatically check if any CGMZ plugin is out of date
  • Added function to split a string into multiple lines if the string is too long for a window to handle without reducing font size (text wrap).
  • Added class CGMZ_Window_Scrollable which can scroll vertically with handlers but no visible cursor. A mix between Window_Base, Window_Scrollable, and Window_Selectable
  • Added CGMZ map name meta access
Version 1.2.0
  • Removed unused code for a title window as this no longer fits with MZ touch buttons.
  • Added draw gauge functionality to windows that do not need sprite gauges
Version 1.2.1
  • Updated api call for version check to use semantic versioning
  • Added link to update directly from console
  • Cut down on outdated CGMZ plugin warnings in console
Version 1.3.0
  • Added basic input processing for all keys on keyboard
  • Added option to open dev tools on game start
Version 1.4.0
  • Added option to show fps on game start
  • Added option to go fullscreen on game start
  • Bugfix to add cap to scrollable window size
Version 1.5.0
  • Added new draw text function for text codes with automatic line breaks
  • Added update behavior
  • Added behavior after load in CGMZ classes
  • Added new timer class
  • Optimized existing code
Version 1.5.1
  • Added parameter to simulate deployed environment during playtest
  • Added new draw text function for drawing for a single line of text with text codes
Version 1.5.2
  • More concise error reporting
  • Bugfix for font size changes throwing off line wrap when drawing text with text codes
Version 1.5.3
  • Added function for getting file info
  • Removed deprecated code (if getting crash after update, update crashing plugin)
Version 1.6.0
  • Added support for subfolders for images
  • Added more customizable selectable window with categories
  • Added function to draw a divider on windows
  • Added support for spritesheet animations on map
  • Various bug fixes for text code drawing in unusual cases
Version 1.7.0
  • Added horizontally scrolling windows
  • Added filesystem functions
Version 1.7.1
  • Changed some CGMZ draw text functions to adjust width of text if too wide
  • Documentation should no longer horizontally scroll
Version 1.8.0
  • Added gamepad meta info detection
  • Added idle detection
  • Added CGMZ_Utils to replace some CGMZ_Temp utility functions
  • Added JSON parse helper function to better report errors
  • Added functions to help change data after saved game loaded
  • Fixed bug with centered text drawing when scaled into a small area with an offset
  • Out of date plugin checker should now only check once at boot
  • Documentation updated
Version 1.8.1
  • Add gamepad release function
  • Add Spanish language support
  • Bug fix for scaled left-align text drawing
Version 1.9.0
  • Added utility function for easier compare of numbers
  • Added utility function to draw background rectangle
  • Added utility function to draw input styles for checkbox, radio, and toggle switch
  • Added utility function to draw N-gons
  • Added utility function for opening URLs
  • Fix outdated plugin message for alpha/beta plugins
Version 1.10.0
  • Expanded function for getting item data objects to include skill/states
  • Added locale options
  • Moved date functions to CGMZ_Utils from CGMZ_Temp
Version 1.11.0
  • Added function to draw step animation on windows
  • Added sprite layer above/below windows in menus
  • Fix crash when using Event Test
Version 1.12.0
  • Added tracking for last input type
  • Added function to parse JSON SE parameters
Version 1.13.0
  • Added function to draw a gradient filled rect
  • Added function to parse JSON Tone parameters
  • Added function to setup common toast parameters
Version 1.14.0
  • Added selectable window that can show a tilemap
  • Added lerp functions
  • Fix gradient rect function to clear with contents
Version 1.14.1
  • Fix issue with idle timer when many keys pressed at same time
  • Removed deprecated $cgmzTemp.timeSplit
Version 1.15.0
  • Add common CGMZ window options to window classes
  • Add report dimensions utility function
  • Bug fix for some numbers not taking locale into account
  • Bug fix for toast parser crash when toast object was undefined
  • Bug fix for some rare cases where gamepad input could crash game
  • Bug fix for CGMZ Selectable Window not tracking top row properly
Version 1.16.0
  • Added window class to get various window parts as bitmaps
  • Added animated regions to windows
  • Added more customizable gauge class
  • Added tracking for last used gamepad index
Version 1.16.1
  • Added more options to header function, and text code support
  • Added easier lookup for actor/class/map/event/enemy/troop data
  • Fixed bug with scrolling height calculations when padding was changed
Version 1.17.0
  • Added utility function to check for any truthy values on an object
  • Added utility function for performing some math operations
  • Added utility function for reading meta parameters
  • Added function to get distance between characters
Version 1.18.0
  • Added function to draw sv actor sprite
  • Added function for basic event comment parsing
Version 1.19.0
  • Added function to get the last gamepad that had input
  • Added function to parse toast parameters easier
  • Fixed toast common property tone parsing
Version 1.20.0
  • Added function to load a face image before drawing it
  • Added functions for drawing selectable/command backgrounds
  • Added function to get random number within a range
Version 1.21.0
  • Added utility function to calculate the average level of battle actors
  • Added utility function to get sprite bitmap after effects applied
  • Fix bug with time to string function
Version 1.22.0
  • Added utility function to parse rumble JSON
  • Scrollable windows can now always be scrolled with right gamepad stick
  • Removed CGMZ_Temp number split function
Version 1.23.0
  • Added function to calculate mixed select/standard window height
  • Fix bug with horizontal scrolling [CGMZ] Windows with unique padding
  • Removed deprecated CGMZ_Temp functions
Version 1.24.0
  • Added defaults for scrolling windows
Version 1.25.0
  • Added utility function to parse new map parameter type
  • Added keyboard scroll keys
  • Mouse wheel can now always scroll scrollable windows if cursor over window
  • Text drawing functions now have better error handling
  • Removed deprecated temp function
Version 1.26.0
  • Added hotkeys for menu scenes
  • Added TTS parser function
  • URL opening now has option to try popup first instead of new tab
Version 1.27.0
  • Added a CGMZ Video class for video functionality
  • Removed deprecated cgmz temp functions
Version 1.28.0
  • Added battle wait functions
  • Improved scrolling window default handling
  • Fix bug with drawing \n text code in some cases
Version 1.28.1
  • Fix bug with \n text code and \n[x] text code handling
Version 1.29.0
  • Added sprite object for displaying animated walk sprite
  • Added sprite object for displaying animated battler sprite
  • Added Select Window index tracking
Version 1.30.0
  • Added title window class
Version 1.31.0
  • Added gamepad listeners
  • Added window background type tracking
  • Added previous map id tracking
Version 1.32.0
  • Added more exact clickable sprite option
  • Added empty functions to reduce order importance for [CGMZ] plugins
Version 1.33.0
  • Add radians and degrees conversion utility functions
  • Add hex and rgb conversion utility functions
  • Add input wait for events
  • Add CGMZ Circle class
  • Fix bug with input tracking incorrectly with shift
  • Fix bug with multiple window listeners
  • Removed Show FPS Counter parameter
  • Removed Simulate Production Environment parameter
Version 1.34.0
  • Add identification of controller brand
Version 1.35.0
  • Add utility function for checking current scene
  • Add utility function for success rolls
  • Add utility function for logging info to console
  • Remove draw icon bugfix
Version 1.36.0
  • Added disposable video class
  • Added mouse enter and leave listeners
  • Added utility function for video extension
  • Added option to show a space after labels in my plugins
Version 1.37.0
  • Added basic bad luck protection for success rolls
  • Added page up / down functionality to scrolling windows
  • Fix bug with video load time sometimes causing issue
Version 1.38.0
  • Add simple function to search an event page command list for a comment
  • Made error reporting for parsing audio object more accurate
Version 1.39.0
  • Added animate for menu walk and battle sprites
  • Added lerp router function
  • Added currency helper function
  • Added focus listeners
Hi all, added some new things to my core plugin today which future plugins might depend on:

Version 1.1:
- Added function to automatically check if any CGMZ plugin is out of date
- Added function to split a string into multiple lines if the string is too long for a window to handle without reducing font size (word wrap).
- Added class CGMZ_Window_Scrollable which can scroll vertically with handlers but no visible cursor. A mix between Window_Base, Window_Scrollable, and Window_Selectable
- Added CGMZ map name meta access
Hi all,
Update to 1.2 (required for my achievements plugin):

- Removed unused code for a title window as this no longer fits with MZ touch buttons.
- Added draw gauge functionality to windows that do not need sprite gauges
Hi all, update to 1.3.0 today, will eventually be used by many plugins but right now only the beta of my vehicle interiors plugin requires this update.

Version 1.3.0:
- Added basic input processing for all keys on keyboard
- Added option to open dev tools on game start
Hi all, update for 1.4.0 today. Includes some extra options like starting in fullscreen/with fps counter showing as well as a bugfix for the scrollable window many CGMZ plugins use.

Version 1.4.0:
- Added option to show fps on game start
- Added option to go fullscreen on game start
- Bugfix to add cap to scrollable window size
Hello, do you know if this is compatible with Visual Stella?
@whiteswords12 Hi, it should be compatible, but I only test with my own plugins so can't say for sure what they are compatible with.
help
Screenshot 2023-07-03 212451.png
@taterbot44 This error usually comes from one of my other plugins when you haven't installed CGMZ Core or you have CGMZ Core placed below it in the plugin list, CGMZ Core must be at the top of all other CGMZ plugins. If you have already done the above, you can press F8 or F12 to open the developer tools and then switch to the console tab at the top to get more information for troubleshooting.
1689788905858.png

I have a problem with the core, on this line:
//-----------------------------------------------------------------------------
// Register Plugin Commands
//-----------------------------------------------------------------------------
CGMZ_Temp.prototype.registerPluginCommands = function() {
PluginManager.registerCommand("CGMZ_Core", "Initialize", this.pluginCommandReinitialize);
};
@Pakle That indicates there's a syntax error in some kind of JavaScript in your project.

Check any plugin parameters that take JavaScript. Check any notetags you're using. The most common cause of this is missing a close brace.

The CGMZ core does not produce any errors when I load it by itself in a new test project (a good first check for you next time 😉).
PluginManager.registerCommand has been an MZ function since v0.9.5. Try using Game -> Update Corescript from the editor's menu bar to refresh your project's core scripts.
So, if anyone has my problem, I imported the script in a project imported from MV. I opened it in a new project and worked...
So, if anyone has my problem, I imported the script in a project imported from MV. I opened it in a new project and worked...
Opening an MV project in MZ is still an MV project. You can use the new map editor because the map data is the same, but in terms of any plugins it's still using MV's code so one shouldn't expect MZ plugins to be compatible unless the author says it works on both.
Hey @CasperGaming, any chance to make your Core (and other plugins?) compatible with web builds? It gives error with "require is not a function" on HTML play. I wanted to build mobile game, but also wanted to use your plugins...
Hey @CasperGaming, any chance to make your Core (and other plugins?) compatible with web builds? It gives error with "require is not a function" on HTML play. I wanted to build mobile game, but also wanted to use your plugins...
Hi, this should be compatible with web builds, are you sure it is this plugin causing the issue? I have playable demos in browser for my plugins that use the core so I would expect those to not work if it was not working in web builds, for example: https://casper-gaming.itch.io/cgmz-splash-screen
Well....right. Sadly I'm not sure, can't really check because testing it on the mobile phone. Gonna test it out a little more, then. Sorry to bother you!

Original thread: https://forums.rpgmakerweb.com/threads/cgmz-core.125616/