Welcome to PGMZ! My goal is to make it easy for everyone to find and share great plugins for creating amazing games. As a plugin developer myself, I'm excited to grow this community with all of you.
MNKR MKR Event Gauge MZ - MNKR_MKR_EventGaugeMZ.js
Plugin desc : Event gauge display
License : MIT License
Author : munokura
Website : http://x.com/munokura
Desc page : https://raw.githubusercontent.com/munokura/MNKR-MZ-plugins/master/MNKR_MKR_EventGaugeMZ.js
File name : MNKR_MKR_EventGaugeMZ.js
Help of plugin :
@target MZ @url https://raw.githubusercontent.com/munokura/MNKR-MZ-plugins/master/MNKR_MKR_EventGaugeMZ.js @plugindesc Event gauge display @author munokura @license MIT License @help Displays a gauge at the base of the specified event. (The display position is adjustable.) The gauge’s maximum value/remaining value is set by the value (variables can be used) specified in the Event_Memo field when the event is created (moving across the map). (If a variable is used for the gauge’s maximum value/remaining value,) the gauge’s maximum value/remaining value corresponds to the variable’s value, and the variable value and the gauge’s remaining value are synchronized. (However, the gauge’s remaining value will never exceed the maximum value or fall below 0.) The gauge is hidden by making the event transparent, and reappears when transparency is turned off. For events (pages) without an event image, the gauge is not displayed. For events using tileset images, you can set the gauge to display or not using plugin parameters. (The top-left corner of tileset B is treated as an empty square, and the gauge is not displayed.) However, if you hide the gauge using the plugin/script command described below, you must also display the gauge using the plugin/script command, regardless of whether transparency or an image is set. When the event command [Temporarily Clear Event] is executed, the gauge associated with that event will also be cleared. [Examples for copying and pasting, memo field settings and commands] *The meaning of each item is explained below. The content is on one line, so please copy and use the example part of the line you need. Event_Memo field: <Egauge:vr10> <Egauge:mvr11> <Egauge:vr10 mvr11> <Egauge:15> <Egauge:3 Wh20 Ht6> <Egauge:vr12 Wh100 Ht10 Fx3 Vs0> <Egauge:5 Ys-50> <Egauge:vr5 Xs10 Ys10 Fx1 Fc3 Sc11 Bc7> <Egauge:50 op80>Plugin command (affects the gauges of the executed event): Show gauge Hide gauge Increase/decrease remaining gauge A specified amount of remaining gauge A specified maximum value of gauge Gauge X coordinate offset Gauge Y coordinate offset Gauge background setting Specify gauge display color 1 Specify gauge display color 2 Specify gauge opacity Script command (affects the gauges of the event with the specified ID): $gameMap.showGaugeWindow(1); $gameMap.hideGaugeWindow(1); $gameMap.isHideGaugeWindow(1); $gameMap.addGaugeValue(1, 3); $gameMap.addGaugeValue(this._eventId, 3); $gameMap.setGaugeValue(1, 5); $gameMap.setGaugeValue(this._eventId, 5); $gameMap.setGaugeMaxValue(1, 5); $gameMap.setGaugeOffsetX(1, 20); $gameMap.setGaugeOffsetY(1, 40); $gameMap.setGaugeBackColor(1, 16); $gameMap.setGaugeColor1(1, 17); $gameMap.setGaugeColor2(1, 17); $gameMap.addGaugeValue(1, $gameVariables.value(10)); $gameMap.addGaugeValue(this._eventId, $gameVariables.value(10)); $gameMap.setGaugeValue(1, $gameVariables.value(15)); $gameMap.setGaugeMaxValue(1, $gameVariables.value(20)); $gameMap.setOpacity(1, 255);About gauge colors: This plugin requires that the gauge color number be specified in the plugin parameters or memo field. (This can be changed later using script/plugin commands.) The color numbers correspond to the colorful square frames in the lower right corner of system/Window.png. The top left square frame (the white square by default) is number 0, and numbers are counted to the right. The bottom right is 31. The default color numbers 20 and 21 specified in the plugin parameters Gauge_Color_1 and Gauge_Color_2 are the same colors as the HP gauge displayed in menus, etc. (By default, a square frame is painted reddish-yellow.) Similarly, the default color number 19 specified in the plugin parameter Gauge_Back_Color is the same as the background color of the gauge displayed in menus, etc. (By default, a square frame is painted navy blue.) Event_Memo_Basic Settings: <Egauge:vr[Variable Number]> ・Displays a gauge in the event. A variable is used for the remaining amount of the gauge. Specify the variable number in the [Variable Number] part. ・Enter a value greater than 0 for the variable used for the remaining amount of the gauge. ・If no maximum value for the gauge is specified, the value of the variable at the time the event is generated will be used as the maximum value. (After setting, the variable value will function as the remaining amount of the gauge.) <Egauge:mvr[Variable Number]> ・Displays a gauge in the event. A variable is used for the maximum value of the gauge. Specify the variable number in the [Variable Number] part. ・Enter a value greater than 0 for the variable used for the maximum value of the gauge. ・If no remaining amount of the gauge is specified, the value of the variable at the time the event is generated will be used as the remaining amount. (After setting, the variable value will function as the gauge’s maximum value) <Egauge:vr[variable number 1] mvr[variable number 2]> - Displays a gauge in an event. The gauge’s remaining amount/maximum value uses a variable. Specify the variable number in the [variable number 1], [variable number 2] parts. - [Variable number 1] is the variable used for the gauge remaining amount, and [Variable number 2] is the variable used for the gauge’s maximum value. - Enter a value greater than 0 for the variable used for the gauge remaining amount/maximum value. - If the value of the variable set for the gauge remaining amount is greater than the value of the variable set for the gauge’s maximum value, the gauge’s maximum value will automatically be set as the remaining amount. <Egauge:[number]> - Displays a gauge in an event. [number] becomes the gauge’s maximum/remaining amount. You can also set the gauge remaining amount and maximum value using the commands described below. Use this if you do not want to use variables. - Enter a value greater than 0 for the [number] used for the gauge’s maximum value. * Two patterns are provided for specifying the gauge value: using variables and numbers. However, if both are specified, the variable setting takes precedence. It is possible to change the value specification method for each event, so please use either one or the other when setting up. Memo field_options (separate each option with a space): Wh[number] - Specify the length of the gauge using a number. Ht[number] - Specify the height of the gauge using a number. Xs[number] - Shifts the X coordinate of the gauge by [number]. (Positive value moves to the right, negative value moves to the left) Ys[number] - Shifts the Y coordinate of the gauge by [number]. (Positive value moves down, negative value moves up) Vs[number from 0 to 1] - Specifies the initial display state of the gauge. 0: The gauge is hidden when the event is created. 1: The gauge is displayed when the event is created. Fx[number from 1 to 3] - Fixed the gauge to the bottom of the screen. (The default setting is a 20px margin between the bottom of the gauge and the screen.) - The gauge’s X coordinate varies depending on [a number from 1 to 3]. 1: The gauge is positioned so that there is a 20px margin on the left side of the screen and on the left side of the gauge. 2: The gauge is displayed in the center of the screen, taking into account its length. 3: The gauge is positioned so that there is a 20px margin on the right side of the screen and on the right side of the gauge. The margin value varies depending on the gauge offset. Fc[number] - Specifies gauge color 1 using a number. (This takes precedence over the Gauge_Color_1 plugin parameter setting.) Sc[number] - Specifies gauge color 2 using a number. - If you do not need a gauge gradient, specify the same number as Gauge Color 1. (This takes precedence over the Gauge_Color_2 plugin parameter setting.) Bc[number] - Specifies the gauge background color using a number. (This takes precedence over the Gauge_Back_Color plugin parameter setting.) Op[number] - Specifies the gauge opacity using a number. (This takes precedence over the Gauge_Opacity setting in the plugin parameters.) Examples of settings in the Event_Memo field: <Egauge:vr10> - Displays a gauge in the event. The value of variable 10 is reflected for both the maximum value and remaining amount of the gauge. (The remaining amount of the gauge changes depending on fluctuations in the variables.) <Egauge:mvr11> - Displays a gauge in the event. The value of variable 11 is reflected for both the maximum value and remaining amount of the gauge. (The maximum value of the gauge changes depending on fluctuations in the variables.) <Egauge:vr10 mvr11> - Displays a gauge in the event. The maximum value of the gauge is reflected by the value of variable 11, and the remaining amount is reflected by the value of variable 10. (The maximum value of the gauge changes depending on fluctuations in variable 11, and the remaining amount changes depending on fluctuations in variable 10.) <Egauge:15> - Displays a gauge in the event. The gauge display is set to a maximum value of 15 and a remaining amount of 15. <Egauge:3 Wh20 Ht6> - Displays a gauge in the event. The gauge display is set to a maximum value of 3 and a remaining amount of 3. - The gauge length is 20px and the height is 6px. <Egauge:vr20 Xs30 Ys-40> - Displays a gauge in an event. The value of variable 20 is reflected in the gauge display for both maximum value and remaining amount. (The remaining amount of the gauge will change when the variable changes.) - The gauge’s X coordinate is displayed as +30px by default, and its Y coordinate is displayed as -40px by default. <Egauge:200 Wh300 Ht10 Xs-10 Ys-10 Fx1> - The gauge is displayed fixedly at the bottom, left side of the screen. The gauge display is set to a maximum value of 200 and a remaining amount of 200. - The gauge length is displayed as 300px, the height is 10px, the X coordinate is displayed as -10px by default, and the Y coordinate is displayed as -10px by default. <Egauge:vr5 Xs10 Ys10 Fx1 Fc3 Sc11 Bc7> - Displays a gauge fixed at the bottom right of the screen. The gauge’s maximum value and remaining amount are reflected by variable 5. (The remaining amount of the gauge changes when the variable fluctuates.) - The gauge length and height are default, with the X coordinate set to default +10px and the Y coordinate set to default +10px. - The gauge’s color 1 is drawn using color 3, color 2 using color 11, and the gauge background using color 7. Script Command: *When using this command, replace [] with the actual value or script. $gameMap.showGaugeWindow([Event ID]); - Sets the gauge for the specified [Event ID] to visible. - By setting [Event ID] to this._eventId, the event that executed the command will be targeted. - If the event is transparent and the event image is not set, the gauge will not be displayed even when the command is executed. - If the gauge is hidden, you can use this command to set it to visible.・If gauge display is not set in the event_memo field, nothing will change. $gameMap.hideGaugeWindow([event ID]); ・Hides the gauge for the specified [event ID]. ・By setting [event ID] to this._eventId, the event that executed the command will be targeted. ・If the event is not transparent and an event image is set, the gauge will be hidden by executing the command. ・If gauge display is not set in the event_memo field, nothing will change. $gameMap.isHideGaugeWindow([event ID]); ・Returns true if the gauge for the specified [event ID] is hidden, false if it is displayed. ・By setting [event ID] to this._eventId, the event that executed the command will be targeted. ・If gauge display is not set in the event_memo field, false will be returned. $gameMap.addGaugeValue([event ID], [number]); ・Increases/decreases the remaining gauge value for the specified [event ID] by the specified [number]. (If [Number] is a negative value, it will decrease.)・By setting [Event ID] to this._eventId, the event that executed the command will be the target.・By using the script $gameVariables.value(n) instead of [Number], you can increase/decrease the value of variable n.・If the gauge remaining amount is determined by a variable, this command will change the variable’s value.・The gauge remaining amount will never exceed the maximum value, nor will it fall below 0.・If gauge display is not set in the event_memo field, no change will occur. $gameMap.setGaugeValue([Event ID], [Number]);・Sets the gauge remaining amount of the specified [Event ID] to the specified [Number]. ([Number] must be a value greater than or equal to 0. Also, the gauge remaining amount will never exceed the maximum value.)・By setting [Event ID] to this._eventId, the event that executed the command will be the target.・By using the script $gameVariables.value(n) instead of [Number], you can set the gauge remaining amount to the value of variable n.・If the gauge remaining amount is determined by a variable, this command will change the variable’s value. ・If gauge display is not set in the event_memo field, nothing will change. $gameMap.setGaugeMaxValue([Event ID], [Number]); ・Sets the maximum gauge value for the specified [Event ID] to the specified [Number]. ([Number] must be a value greater than 0.) ・By setting [Event ID] to this._eventId, the event that executed the command will be targeted. ・By using the script $gameVariables.value(n) instead of [Number], you can set the value of variable n to the maximum gauge value. ・If the maximum gauge value is lower than the gauge remaining amount, this command will make the gauge remaining amount the same as the maximum gauge value. ・If the gauge maximum value/remaining amount is determined by a variable, this command will change the variable’s value. ・If gauge display is not set in the event_memo field, nothing will change. $gameMap.getGaugeValue([Event ID]); ・Returns the remaining gauge value for the specified [Event ID]. ・By setting [Event ID] to this._eventId, the event that executed the command will be targeted.・If the gauge remaining amount is determined by a variable, the returned value is the same as the variable value. ・If gauge display is not set in the event_memo field, it returns -1. $gameMap.getGaugeMaxValue([Event ID]); ・Returns the maximum gauge value for the specified [Event ID]. ・If [Event ID] is set to 0, it will target the event that executed the command. ・If gauge display is not set in the event_memo field, it will return -1. $gameMap.setGaugeOffsetX([Event ID], [Number]); ・Sets the gauge X coordinate offset for the specified [Event ID] to the specified [Number]. ・Gauges with an offset specified will be displayed shifted horizontally from their original drawing position by the specified [Number]. ・By setting [Event ID] to this._eventId, it will target the event that executed the command. ・By using the script $gameVariables.value(n) instead of [Number], you can set the value of variable n to the gauge offset. $gameMap.setGaugeOffsetY([Event ID], [Number]); - Sets the gauge Y coordinate offset for the specified [Event ID] to the specified [Number]. ・Gauges with an offset specified will be displayed vertically offset from their original drawing position by the specified [number]. ・By setting [Event ID] to this._eventId, the event that executed the command will be targeted. ・By using the script $gameVariables.value(n) instead of [number], you can set the value of variable n to the gauge offset. $gameMap.setGaugeBackColor([Event ID], [number]); ・Sets the gauge background color number of the specified [Event ID] to the specified [number]. ・By setting [Event ID] to this._eventId, the event that executed the command will be targeted. ・By using the script $gameVariables.value(n) instead of [number], you can set the value of variable n to the gauge background color number. $gameMap.setGaugeColor1([Event ID], [number]); ・Sets the gauge display color number of the specified [Event ID] to the specified [number]. ・By setting [Event ID] to this._eventId, the event that executed the command will be targeted.・By using the script $gameVariables.value(n) instead of [number], you can set the value of variable n to the gauge display color number. $gameMap.setGaugeColor2([Event ID], [Number]); ・Sets the gauge display color number of the specified [Event ID] to the specified [Number]. ・If you don’t need a gauge gradient, specify the same number as Gauge Color 1. ・By setting [Event ID] to this._eventId, the event that executed the command will be the target. ・By using the script $gameVariables.value(n) instead of [number], you can set the value of variable n to the gauge display color number. $gameMap.setGaugeOpacity([Event ID], [Number]); ・Sets the gauge opacity of the specified [Event ID] to the specified [Number]. ([Number] must be a value between 0 and 255.) ・By setting [Event ID] to this._eventId, the event that executed the command will be the target.・By using the script $gameVariables.value(n) instead of [number], you can set the value of variable n to the gauge opacity. Note: ・The settings in the memo field and plugin commands for this plugin are not case-sensitive. ・Plugin parameter descriptions marked [Default value] can be set individually in the event memo field. Please note that if set, the memo field setting will take precedence over the [Default value]. # Contact Information This is a plugin originally created for RPG Maker MV ported for MZ. Please contact the modifier for any inquiries. # Terms of Use MIT License. http://opensource.org/licenses/mit-license.php Modifications and redistribution are permitted without permission from the author, and there are no restrictions on usage (commercial, 18+ use, etc.). @param Gauge_Width @text Gauge Width @desc [Initial value] Specify the gauge length as a number. (Default: 40) @default 40 @param Gauge_Height @text Gauge Height @desc [Initial value] Specify the height of the gauge as a number. (Default: 10) @default 10 @param Gauge_Offset_X @text Gauge Offset X @desc [Initial value] Specify whether to shift the gauge X coordinate. (Positive value moves it to the right, negative value moves it to the left) (Default: 0) @default 0 @param Gauge_Offset_Y @text Gauge offset Y @desc [Initial value] Specify whether to shift the Y-coordinate of the gauge. (Positive value moves it down, negative value moves it up) (Default: 0) @default 0 @param Gauge_Visible @text Gauge visibility @desc [Initial value] Specify true if you want the gauge to be displayed from the beginning, or false if you want it to be displayed later. (Default: true) @type boolean @on Initial display @off Do not display initially @default true @param Gauge_Color_1 @text Gauge Color 1 @desc [Initial value] Specifies the gauge display color number. (See system/Window.png for the actual color) (Default: 20) @default 20 @param Gauge_Color_2 @text Gauge Color 2 @desc [Initial Value] Specify the gauge display color number. (This item is for gradation) (Default: 21) @default 21 @param Gauge_Back_Color @text Gauge Background Color @desc Specify the display color number of the gauge background. (The entire gauge is painted in the background color, and the remaining amount is painted in the gauge display color.) (Default: 19) @default 19 @param Gauge_Opacity @text Gauge Opacity @desc [Initial Value] Specify the opacity of the gauge (0 to 255). (0 makes the gauge transparent) (Default: 255) @default 255 @param Gauge_In_Picture @text Gauge picture @desc Displays the gauge above the picture with the specified number. (If 0, the gauge will be displayed below all pictures.) (Default: 0) @default 0 @param Tile_Gauge_Enable @text Enable Tile Gauge @desc Select whether to display a gauge for the tile set image event. (Default: Do not display) @type boolean @on Display @off Do not display @default false @command show @text Show Gauge @desc Set the gauge for the executed event to be displayed. @command hide @text Hide Gauge @desc Hides the gauge for the executed event. @command add @text Increase/Decrease remaining gauge @desc Increases/decreases the remaining gauge for the executed event. @arg value @text Amount of change @desc The amount of change in the remaining gauge. (If the [number] is a negative value, it will decrease.) @default 0 @command set @text Gauge remaining amount to specified value @desc Sets the gauge remaining capacity to the specified value. @arg value @text Specified value @desc The specified value for the remaining gauge amount. ([Number] must be a value greater than or equal to 0. The remaining amount will never exceed the maximum value of the gauge.) @default 0 @command maxset @text Set the gauge maximum value to the specified value. @desc Sets the gauge maximum to the specified value. @arg value @text Specified value @desc The maximum value of the gauge (please specify a value greater than 0). @default 1 @command setx @text Gauge X coordinate offset @desc Sets the gauge X coordinate offset. @arg value @text Offset amount @desc The image will be shifted horizontally from the default position (positive: right / negative: left). @default 0 @command sety @text Gauge Y coordinate offset @desc Sets the gauge Y coordinate offset. @arg value @text Offset amount @desc It is displayed vertically shifted from the default drawing position (positive: below / negative: above). @default 0 @command backcolor @text Gauge background settings @desc Sets the gauge background. @arg value @text Background Color Number @desc Specifies the background color number. @default 0 @command color1 @text Specify gauge display color 1 @desc Specifies gauge display color 1. @arg value @text Gauge display color 1 number @desc Specify the gauge display color 1 number. @default 0 @command color2 @text Specify gauge display color 2 @desc Specifies gauge display color 2. @arg value @text Gauge display color 2 number @desc Specify gauge display color 2 number. @default 0 @command opacity @text Specify the gauge opacity @desc Specifies the gauge opacity. @arg value @text Gauge Opacity @desc Specify opacity (value between 0-255). @default 0