{"id":10019,"date":"2026-09-14T19:48:42","date_gmt":"2026-09-14T10:48:42","guid":{"rendered":"https:\/\/salgudiy.com\/js\/rpg-maker-mz-%ec%8b%a4%ec%8b%9c%ea%b0%84-%ea%b2%8c%ec%9d%b4%ec%a7%80%eb%a5%bc-%ea%b2%8c%ec%9e%84-%ed%99%94%eb%a9%b4%ec%97%90-%ed%95%ad%ec%83%81-%ed%91%9c%ec%8b%9c%ed%95%98%eb%8a%94-%eb%b0%a9\/"},"modified":"2026-09-14T21:37:45","modified_gmt":"2026-09-14T12:37:45","slug":"rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen","status":"publish","type":"js","link":"https:\/\/salgudiy.com\/en\/js\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\/","title":{"rendered":"[RPG MAKER MZ] How to Keep a Real-Time Gauge Always Visible on the Game Screen"},"content":{"rendered":"<div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1248px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:20px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-title title fusion-title-1 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-text-color:var(--awb-custom_color_4);--awb-margin-bottom:30px;--awb-margin-top-small:20px;--awb-margin-bottom-small:10px;--awb-font-size:1.6em;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;text-transform:none;font-size:1em;--fontSize:25.6;line-height:var(--awb-typography1-line-height);\">Previous Post<\/h2><\/div><div class=\"fusion-content-boxes content-boxes columns row fusion-columns-1 fusion-columns-total-1 fusion-content-boxes-1 content-boxes-icon-with-title content-left\" style=\"--awb-backgroundcolor:var(--awb-color6);--awb-border-radius-top-left:15px;--awb-border-radius-top-right:15px;--awb-border-radius-bottom-right:15px;--awb-border-radius-bottom-left:15px;--awb-body-color:var(--awb-color1);--awb-title-color:var(--awb-custom_color_1);--awb-margin-top:0px;--awb-margin-bottom:30px;--awb-hover-accent-color:var(--awb-custom_color_1);--awb-circle-hover-accent-color:var(--awb-custom_color_1);--awb-item-margin-bottom:40px;\" data-animationOffset=\"top-into-view\"><div style=\"--awb-backgroundcolor:var(--awb-color6);\" class=\"fusion-column content-box-column content-box-column content-box-column-1 col-lg-12 col-md-12 col-sm-12 fusion-content-box-hover content-box-column-last content-box-column-last-in-row\"><div class=\"col content-box-wrapper content-wrapper-background link-area-box link-type-text content-icon-wrapper-yes icon-hover-animation-fade\" data-link=\"https:\/\/salgudiy.com\/en\/js\/rpg-maker-mz-creating-a-gauge-that-fills-from-bottom-to-top\/\" data-link-target=\"_blank\" data-animationOffset=\"top-into-view\"><div class=\"heading heading-with-icon icon-left\"><a class=\"heading-link\" style=\"float:left;\" href=\"https:\/\/salgudiy.com\/en\/js\/rpg-maker-mz-creating-a-gauge-that-fills-from-bottom-to-top\/\" target=\"_blank\" rel=\"noopener noreferrer\"><div class=\"icon\"><span style=\"height:42px;width:42px;line-height:22px;border-color:rgba(255,255,255,0);border-width:1px;border-style:solid;background-color:var(--awb-color8);box-sizing:content-box;border-radius:50%;\"><i style=\"border-color:var(--awb-color8);border-width:1px;background-color:var(--awb-color7);box-sizing:content-box;height:40px;width:40px;line-height:40px;border-radius:50%;position:relative;top:auto;left:auto;margin:0;border-radius:50%;font-size:20px;\" aria-hidden=\"true\" class=\"fontawesome-icon fa-link fas circle-yes\"><\/i><\/span><\/div><h2 class=\"content-box-heading fusion-responsive-typography-calculated\" style=\"--h2_typography-font-size:24px;--fontSize:24;line-height:var(--awb-typography1-line-height);\">Creating a Gauge that Fills from Bottom to Top<\/h2><\/a><\/div><div class=\"fusion-clearfix\"><\/div><div class=\"content-container\">\n<p>In RPG Maker MZ, you can create a rising gauge effect using showPicture and movePicture. By calculating the rate as done \/ goal and adjusting scaleY and the Y position, the gauge smoothly fills from bottom to top.<\/p>\n<\/div><div class=\"fusion-clearfix\"><\/div><a class=\" fusion-read-more\" style=\"float:left;\" href=\"https:\/\/salgudiy.com\/en\/js\/rpg-maker-mz-creating-a-gauge-that-fills-from-bottom-to-top\/\" target=\"_blank\" rel=\"noopener noreferrer\">Read More<\/a><div class=\"fusion-clearfix\"><\/div><\/div><\/div><div class=\"fusion-clearfix\"><\/div><\/div><div class=\"fusion-text fusion-text-1 fusion-text-no-margin\" style=\"--awb-margin-bottom:60px;\"><p>In the previous post, we explored how to create a gauge that fills upward from the bottom.<br \/>\nToday, let\u2019s take it a step further and learn how to keep that gauge always visible on the game screen. This way, players can easily track their progress at a glance, no matter where they are in the game. Shall we pin the gauge to the screen and make it a part of the user interface?<\/p>\n<\/div><div class=\"fusion-separator fusion-full-width-sep\" style=\"align-self: center;margin-left: auto;margin-right: auto;margin-bottom:60px;width:100%;\"><div class=\"fusion-separator-border sep-single sep-solid\" style=\"--awb-height:20px;--awb-amount:20px;--awb-sep-color:var(--awb-custom_color_4);border-color:var(--awb-custom_color_4);border-top-width:1px;\"><\/div><\/div><div class=\"fusion-title title fusion-title-2 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-text-color:var(--awb-custom_color_4);--awb-margin-bottom:30px;--awb-margin-top-small:20px;--awb-margin-bottom-small:10px;--awb-font-size:2em;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;text-transform:none;font-size:1em;--fontSize:32;line-height:var(--awb-typography1-line-height);\">1. Creating a Common Event: Displaying the Gauge Image on the Screen<\/h2><\/div><div class=\"fusion-text fusion-text-2 fusion-text-no-margin\" style=\"--awb-margin-bottom:30px;\"><p>The first thing we need to do is create a Common Event that displays the gauge image on the game screen. This event will be set up to remain visible even when the player moves between maps.<\/p>\n<\/div><div class=\"fusion-text fusion-text-3 fusion-text-no-margin\" style=\"--awb-margin-bottom:30px;\"><p>Here\u2019s how you can set it up:<\/p>\n<\/div><div class=\"fusion-alert alert custom alert-custom fusion-alert-center fusion-alert-capitalize awb-alert-native-link-color\" style=\"--awb-background-color:rgba(0,93,255,0.28);--awb-accent-color:#00faff;--awb-border-size:1px;--awb-border-top-left-radius:0px;--awb-border-top-right-radius:0px;--awb-border-bottom-left-radius:0px;--awb-border-bottom-right-radius:0px;--awb-margin-bottom:30px;\" role=\"alert\"><div class=\"fusion-alert-content-wrapper\"><span class=\"alert-icon\"><i class=\"fa-globe fas\" aria-hidden=\"true\"><\/i><\/span><span class=\"fusion-alert-content\">Setting Up Common Event 1<\/span><\/div><\/div><ul style=\"--awb-margin-bottom:30px;--awb-textcolor:var(--awb-custom_color_4);--awb-line-height:27.2px;--awb-icon-width:27.2px;--awb-icon-height:27.2px;--awb-icon-margin:11.2px;--awb-content-margin:38.4px;--awb-circlecolor:var(--awb-custom_color_1);--awb-circle-yes-font-size:14.08px;\" class=\"fusion-checklist fusion-checklist-1 fusion-checklist-default type-icons\"><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-yes\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">Name: Display Gauge Bar<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-yes\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">Trigger: None<\/p>\n<p>(We\u2019ll call this common event from a map event set to autorun.)<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-yes\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">Contents : Event Commands &gt; Script&#8230;<\/div><\/li><\/ul><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-1 > .CodeMirror, .fusion-syntax-highlighter-1 > .CodeMirror .CodeMirror-gutters {background-color:var(--awb-custom_color_4);}.fusion-syntax-highlighter-1 > .CodeMirror .CodeMirror-gutters { background-color: var(--awb-custom_color_8); }.fusion-syntax-highlighter-1 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-custom_color_4); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-1 fusion-syntax-highlighter-theme-dark syntaxhighlighter\" style=\"opacity:0;margin-top:30px;margin-right:0px;margin-bottom:60px;margin-left:0px;font-size:14px;border-width:0px;border-style:solid;border-color:var(--awb-color8);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_1\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_1\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_1\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/javascript\">$gameScreen.showPicture(1, 'gauge_bg', 0, 30, 30, 100, 100, 255, 0);\n$gameScreen.showPicture(2, 'gauge_fill', 0, 30, 94, 100, 0, 255, 0);<\/textarea><\/div><div class=\"fusion-text fusion-text-4 fusion-text-no-margin\" style=\"--awb-margin-bottom:30px;\"><p>Insert the same code we used last time to display the gauge images.<br \/>\nThen, add one more line to turn on a switch right below:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-2 > .CodeMirror, .fusion-syntax-highlighter-2 > .CodeMirror .CodeMirror-gutters {background-color:var(--awb-custom_color_4);}.fusion-syntax-highlighter-2 > .CodeMirror .CodeMirror-gutters { background-color: var(--awb-custom_color_8); }.fusion-syntax-highlighter-2 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-custom_color_4); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-2 fusion-syntax-highlighter-theme-dark syntaxhighlighter\" style=\"opacity:0;margin-top:30px;margin-right:0px;margin-bottom:60px;margin-left:0px;font-size:14px;border-width:0px;border-style:solid;border-color:var(--awb-color8);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_2\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_2\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_2\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/javascript\">$gameSwitches.setValue(n, true);<\/textarea><\/div><div class=\"fusion-text fusion-text-5 fusion-text-no-margin\" style=\"--awb-margin-bottom:60px;\"><p>Replace n with the number of the switch you want to use.<\/p>\n<p>We turn on the switch because it will be used in Step 3, where we&#8217;ll create another common event that updates the gauge in real time.<\/p>\n<ul>\n<li><mark class=\"fusion-highlight custom-textcolor highlight1 awb-highlight-background rounded\" style=\"--awb-color:#cbe2ac;--awb-text-color:#121212;\">true<\/mark> means the switch is turned ON<\/li>\n<li><mark class=\"fusion-highlight custom-textcolor highlight1 awb-highlight-background rounded\" style=\"--awb-color:#cbe2ac;--awb-text-color:#121212;\">false<\/mark> false would turn it OFF<\/li>\n<\/ul>\n<\/div><div class=\"fusion-image-element\" style=\"text-align:center;--awb-margin-bottom:60px;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-1 hover-type-none\"><a href=\"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Display_Gauge_Bar_Common_Event-en-1024x642.webp\" class=\"fusion-lightbox\" data-rel=\"iLightbox[ec8531866f3af054b06]\" data-title=\"Display Gauge Bar Common Event\" title=\"Display Gauge Bar Common Event\"><img decoding=\"async\" width=\"1024\" height=\"642\" alt=\"Display Gauge Bar Common Event\" src=\"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Display_Gauge_Bar_Common_Event-en.webp\" data-orig-src=\"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Display_Gauge_Bar_Common_Event-en-1024x642.webp\" class=\"lazyload img-responsive wp-image-10005\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271182%27%20height%3D%27741%27%20viewBox%3D%270%200%201182%20741%27%3E%3Crect%20width%3D%271182%27%20height%3D%27741%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Display_Gauge_Bar_Common_Event-en-200x125.webp 200w, https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Display_Gauge_Bar_Common_Event-en-400x251.webp 400w, https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Display_Gauge_Bar_Common_Event-en-600x376.webp 600w, https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Display_Gauge_Bar_Common_Event-en-800x502.webp 800w, https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Display_Gauge_Bar_Common_Event-en.webp 1182w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 1024px) 100vw, (max-width: 640px) 100vw, 1024px\" \/><\/a><\/span><\/div><div class=\"fusion-separator fusion-full-width-sep\" style=\"align-self: center;margin-left: auto;margin-right: auto;margin-bottom:60px;width:100%;\"><div class=\"fusion-separator-border sep-single sep-solid\" style=\"--awb-height:20px;--awb-amount:20px;--awb-sep-color:var(--awb-custom_color_1);border-color:var(--awb-custom_color_1);border-top-width:1px;\"><\/div><\/div><div class=\"fusion-title title fusion-title-3 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-text-color:var(--awb-custom_color_4);--awb-margin-bottom:30px;--awb-margin-top-small:20px;--awb-margin-bottom-small:10px;--awb-font-size:2em;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;text-transform:none;font-size:1em;--fontSize:32;line-height:var(--awb-typography1-line-height);\">2. Creating a Map Event: Auto-Running the Common Event<\/h2><\/div><div class=\"fusion-text fusion-text-6 fusion-text-no-margin\" style=\"--awb-margin-bottom:30px;\"><p>Next, let\u2019s create a map event that automatically runs the common event we just made.<\/p>\n<p>We\u2019ll place a simple, invisible event on the map. Its job is very straightforward. Run the common event once, then quietly disable itself.<\/p>\n<\/div><div class=\"fusion-alert alert custom alert-custom fusion-alert-center fusion-alert-capitalize awb-alert-native-link-color\" style=\"--awb-background-color:rgba(0,255,131,0.15);--awb-accent-color:#00ff83;--awb-border-size:1px;--awb-border-top-left-radius:0px;--awb-border-top-right-radius:0px;--awb-border-bottom-left-radius:0px;--awb-border-bottom-right-radius:0px;--awb-margin-bottom:30px;\" role=\"alert\"><div class=\"fusion-alert-content-wrapper\"><span class=\"alert-icon\"><i class=\"fa-map fas\" aria-hidden=\"true\"><\/i><\/span><span class=\"fusion-alert-content\">Setting Up the Map Event (1\/2)<\/span><\/div><\/div><ul style=\"--awb-margin-bottom:30px;--awb-textcolor:var(--awb-custom_color_4);--awb-line-height:27.2px;--awb-icon-width:27.2px;--awb-icon-height:27.2px;--awb-icon-margin:11.2px;--awb-content-margin:38.4px;--awb-circlecolor:var(--awb-custom_color_1);--awb-circle-yes-font-size:14.08px;\" class=\"fusion-checklist fusion-checklist-2 fusion-checklist-default type-icons\"><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-yes\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">Name: Auto-Run Gauge Bar Display<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-yes\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">Trigger: Autorun<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-yes\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">Contents : Event Commands &gt; Script&#8230;<\/div><\/li><\/ul><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-3 > .CodeMirror, .fusion-syntax-highlighter-3 > .CodeMirror .CodeMirror-gutters {background-color:var(--awb-custom_color_4);}.fusion-syntax-highlighter-3 > .CodeMirror .CodeMirror-gutters { background-color: var(--awb-custom_color_8); }.fusion-syntax-highlighter-3 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-custom_color_4); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-3 fusion-syntax-highlighter-theme-dark syntaxhighlighter\" style=\"opacity:0;margin-top:30px;margin-right:0px;margin-bottom:60px;margin-left:0px;font-size:14px;border-width:0px;border-style:solid;border-color:var(--awb-color8);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_3\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_3\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_3\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/javascript\">$gameTemp.reserveCommonEvent(COMMON_EVENT_ID);<\/textarea><\/div><div class=\"fusion-text fusion-text-7\"><p>Write a script that runs a common event. Replace COMMON_EVENT_ID with the actual ID number of your gauge display common event. (e.g: Common Event ID 5 \u2192 reserveCommentEvent(5) )<\/p>\n<\/div><div class=\"fusion-text fusion-text-8 fusion-text-no-margin\" style=\"--awb-margin-bottom:30px;\"><p>After running the common event, we\u2019ll turn Self Switch A ON so this map event doesn\u2019t run again.<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-4 > .CodeMirror, .fusion-syntax-highlighter-4 > .CodeMirror .CodeMirror-gutters {background-color:var(--awb-custom_color_4);}.fusion-syntax-highlighter-4 > .CodeMirror .CodeMirror-gutters { background-color: var(--awb-custom_color_8); }.fusion-syntax-highlighter-4 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-custom_color_4); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-4 fusion-syntax-highlighter-theme-dark syntaxhighlighter\" style=\"opacity:0;margin-top:30px;margin-right:0px;margin-bottom:60px;margin-left:0px;font-size:14px;border-width:0px;border-style:solid;border-color:var(--awb-color8);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_4\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_4\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_4\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/javascript\">$gameSelfSwitches.setValue([this._mapId, this.eventId(), 'A'], true);<\/textarea><\/div><div class=\"fusion-text fusion-text-9 fusion-text-no-margin\" style=\"--awb-margin-bottom:60px;\"><p>Let\u2019s write the code to turn on Self Switch A for this event.<\/p>\n<ul>\n<li><mark class=\"fusion-highlight custom-textcolor highlight1 awb-highlight-background rounded\" style=\"--awb-color:#cbe2ac;--awb-text-color:#121212;\">this._mapId<\/mark> : the map ID this event is on<\/li>\n<li><mark class=\"fusion-highlight custom-textcolor highlight1 awb-highlight-background rounded\" style=\"--awb-color:#cbe2ac;--awb-text-color:#121212;\">this.eventId()<\/mark> : the function that returns the ID of this event<\/li>\n<li><mark class=\"fusion-highlight custom-textcolor highlight1 awb-highlight-background rounded\" style=\"--awb-color:#cbe2ac;--awb-text-color:#121212;\">A<\/mark> :&nbsp; Self Switch A<\/li>\n<li><mark class=\"fusion-highlight custom-textcolor highlight1 awb-highlight-background rounded\" style=\"--awb-color:#cbe2ac;--awb-text-color:#121212;\">true<\/mark> : Turns the switch ON (use false to turn it OFF)<\/li>\n<\/ul>\n<\/div><div class=\"fusion-image-element\" style=\"text-align:center;--awb-margin-bottom:60px;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-2 hover-type-none\"><a href=\"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Auto-Run_Map_Event_Display_Gauge_Bar-1-en-1024x720.webp\" class=\"fusion-lightbox\" data-rel=\"iLightbox[a729f2d3bd11e6c3cfb]\" data-title=\"Auto-Run_Map_Event_Display_Gauge_Bar-1-en\" title=\"Auto-Run_Map_Event_Display_Gauge_Bar-1-en\"><img decoding=\"async\" width=\"1024\" height=\"720\" alt=\"Auto-Run Map Event Display Gauge Bar 1\" src=\"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Auto-Run_Map_Event_Display_Gauge_Bar-1-en.webp\" data-orig-src=\"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Auto-Run_Map_Event_Display_Gauge_Bar-1-en-1024x720.webp\" class=\"lazyload img-responsive wp-image-10006\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271054%27%20height%3D%27741%27%20viewBox%3D%270%200%201054%20741%27%3E%3Crect%20width%3D%271054%27%20height%3D%27741%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Auto-Run_Map_Event_Display_Gauge_Bar-1-en-200x141.webp 200w, https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Auto-Run_Map_Event_Display_Gauge_Bar-1-en-400x281.webp 400w, https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Auto-Run_Map_Event_Display_Gauge_Bar-1-en-600x422.webp 600w, https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Auto-Run_Map_Event_Display_Gauge_Bar-1-en-800x562.webp 800w, https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Auto-Run_Map_Event_Display_Gauge_Bar-1-en.webp 1054w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 1024px) 100vw, (max-width: 640px) 100vw, 1024px\" \/><\/a><\/span><\/div><div class=\"fusion-separator\" style=\"align-self: center;margin-left: auto;margin-right: auto;margin-bottom:60px;width:100%;max-width:50%;\"><div class=\"fusion-separator-border sep-single sep-solid\" style=\"--awb-height:20px;--awb-amount:20px;border-color:var(--awb-color2);border-top-width:1px;\"><\/div><\/div><div class=\"fusion-alert alert custom alert-custom fusion-alert-center fusion-alert-capitalize awb-alert-native-link-color\" style=\"--awb-background-color:rgba(0,255,131,0.15);--awb-accent-color:#00ff83;--awb-border-size:1px;--awb-border-top-left-radius:0px;--awb-border-top-right-radius:0px;--awb-border-bottom-left-radius:0px;--awb-border-bottom-right-radius:0px;--awb-margin-bottom:30px;\" role=\"alert\"><div class=\"fusion-alert-content-wrapper\"><span class=\"alert-icon\"><i class=\"fa-map fas\" aria-hidden=\"true\"><\/i><\/span><span class=\"fusion-alert-content\">Map Event Page Addition (2\/2)<\/span><\/div><\/div><ul style=\"--awb-margin-bottom:30px;--awb-textcolor:var(--awb-custom_color_4);--awb-line-height:27.2px;--awb-icon-width:27.2px;--awb-icon-height:27.2px;--awb-icon-margin:11.2px;--awb-content-margin:38.4px;--awb-circlecolor:var(--awb-custom_color_1);--awb-circle-yes-font-size:14.08px;\" class=\"fusion-checklist fusion-checklist-3 fusion-checklist-default type-icons\"><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-yes\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">Conditions : Self Switch A<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-yes\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">Trigger : Action Button<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-yes\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">Contents : (empty)<\/div><\/li><\/ul><div class=\"fusion-text fusion-text-10 fusion-text-no-margin\" style=\"--awb-margin-bottom:60px;\"><ol>\n<li>Click <mark class=\"fusion-highlight custom-textcolor highlight1 awb-highlight-background rounded\" style=\"--awb-color:#f2b885;--awb-text-color:#121212;\">New Event Page<\/mark> to create a second page for the event.<\/li>\n<li>In Conditions, check on Self Switch and select &#8216;A&#8217;<\/li>\n<li>Leave the Contents section completely empty.<\/li>\n<\/ol>\n<p>When the self switch turns on, the event switches to this new page and stops functioning.<\/p>\n<\/div><div class=\"fusion-image-element\" style=\"text-align:center;--awb-margin-bottom:60px;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-3 hover-type-none\"><a href=\"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Auto-Run_Map_Event_Display_Gauge_Bar-2-en-1024x720.webp\" class=\"fusion-lightbox\" data-rel=\"iLightbox[1e3e6bbd557093f8533]\" data-title=\"Auto-Run_Map_Event_Display_Gauge_Bar-2-en\" title=\"Auto-Run_Map_Event_Display_Gauge_Bar-2-en\"><img decoding=\"async\" width=\"1024\" height=\"720\" alt=\"Auto-Run Map Event Display Gauge Bar 2\" src=\"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Auto-Run_Map_Event_Display_Gauge_Bar-2-en.webp\" data-orig-src=\"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Auto-Run_Map_Event_Display_Gauge_Bar-2-en-1024x720.webp\" class=\"lazyload img-responsive wp-image-10007\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271054%27%20height%3D%27741%27%20viewBox%3D%270%200%201054%20741%27%3E%3Crect%20width%3D%271054%27%20height%3D%27741%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Auto-Run_Map_Event_Display_Gauge_Bar-2-en-200x141.webp 200w, https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Auto-Run_Map_Event_Display_Gauge_Bar-2-en-400x281.webp 400w, https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Auto-Run_Map_Event_Display_Gauge_Bar-2-en-600x422.webp 600w, https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Auto-Run_Map_Event_Display_Gauge_Bar-2-en-800x562.webp 800w, https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Auto-Run_Map_Event_Display_Gauge_Bar-2-en.webp 1054w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 1024px) 100vw, (max-width: 640px) 100vw, 1024px\" \/><\/a><\/span><\/div><div class=\"fusion-separator fusion-full-width-sep\" style=\"align-self: center;margin-left: auto;margin-right: auto;margin-bottom:60px;width:100%;\"><div class=\"fusion-separator-border sep-single sep-solid\" style=\"--awb-height:20px;--awb-amount:20px;--awb-sep-color:var(--awb-custom_color_1);border-color:var(--awb-custom_color_1);border-top-width:1px;\"><\/div><\/div><div class=\"fusion-title title fusion-title-4 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-text-color:var(--awb-custom_color_4);--awb-margin-bottom:30px;--awb-margin-top-small:20px;--awb-margin-bottom-small:10px;--awb-font-size:2em;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;text-transform:none;font-size:1em;--fontSize:32;line-height:var(--awb-typography1-line-height);\">3. Creating a Common Event: Gauge Bar Real-Time Operation<\/h2><\/div><div class=\"fusion-text fusion-text-11 fusion-text-no-margin\" style=\"--awb-margin-bottom:30px;\"><p>Now it\u2019s time to create a new common event that makes the on-screen gauge bar update in real time.<\/p>\n<\/div><div class=\"fusion-alert alert custom alert-custom fusion-alert-center fusion-alert-capitalize awb-alert-native-link-color\" style=\"--awb-background-color:rgba(0,93,255,0.28);--awb-accent-color:#00faff;--awb-border-size:1px;--awb-border-top-left-radius:0px;--awb-border-top-right-radius:0px;--awb-border-bottom-left-radius:0px;--awb-border-bottom-right-radius:0px;--awb-margin-bottom:30px;\" role=\"alert\"><div class=\"fusion-alert-content-wrapper\"><span class=\"alert-icon\"><i class=\"fa-globe fas\" aria-hidden=\"true\"><\/i><\/span><span class=\"fusion-alert-content\">Setting Up Common Event 2<\/span><\/div><\/div><ul style=\"--awb-margin-bottom:30px;--awb-textcolor:var(--awb-custom_color_4);--awb-line-height:27.2px;--awb-icon-width:27.2px;--awb-icon-height:27.2px;--awb-icon-margin:11.2px;--awb-content-margin:38.4px;--awb-circlecolor:var(--awb-custom_color_1);--awb-circle-yes-font-size:14.08px;\" class=\"fusion-checklist fusion-checklist-4 fusion-checklist-default type-icons\"><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-yes\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">Name: Operate Gauge Bar<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-yes\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">Trigger: Parallel<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-yes\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">Switch: The same switch you turned ON in Common Event 1<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-yes\"><i class=\"fusion-li-icon awb-icon-check\" aria-hidden=\"true\"><\/i><\/span><div class=\"fusion-li-item-content\">Contents : Event Commands &gt; Script&#8230;<\/div><\/li><\/ul><div class=\"fusion-text fusion-text-12 fusion-text-no-margin\" style=\"--awb-margin-bottom:30px;\"><p>This way, the event will run continuously in the background only when the switch is ON.<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-5 > .CodeMirror, .fusion-syntax-highlighter-5 > .CodeMirror .CodeMirror-gutters {background-color:var(--awb-custom_color_4);}.fusion-syntax-highlighter-5 > .CodeMirror .CodeMirror-gutters { background-color: var(--awb-custom_color_8); }.fusion-syntax-highlighter-5 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-custom_color_4); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-5 fusion-syntax-highlighter-theme-dark syntaxhighlighter\" style=\"opacity:0;margin-top:30px;margin-right:0px;margin-bottom:60px;margin-left:0px;font-size:14px;border-width:0px;border-style:solid;border-color:var(--awb-color8);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_5\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_5\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_5\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/javascript\">let goal = $gameVariables.value(n1);\nlet done = $gameVariables.value(n2);\nlet rate = done\/goal;\nrate = Math.max(0, Math.min(1, rate));\n \nlet originalPicW = 32; \/\/ Width of the gauge image\nlet originalPicH = 64; \/\/ Height of the gauge image\nlet margin = 30;\n \nlet picX = margin + 0;\nlet picY = margin + originalPicH - originalPicH * rate;\nlet scaleY = rate * 100;\n \n$gameScreen.movePicture(\n        2,\n        0,\n        picX,\n        picY,\n        100,\n        scaleY,\n        255,\n        0,\n        30,\n        1\n    );<\/textarea><\/div><div class=\"fusion-text fusion-text-13 fusion-text-no-margin\" style=\"--awb-margin-bottom:30px;\"><ol>\n<li>Insert the same code we used last time to make the gauge bar move according to the rate.<\/li>\n<li>Then, there\u2019s one important line we need to add.<\/li>\n<\/ol>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-6 > .CodeMirror, .fusion-syntax-highlighter-6 > .CodeMirror .CodeMirror-gutters {background-color:var(--awb-custom_color_4);}.fusion-syntax-highlighter-6 > .CodeMirror .CodeMirror-gutters { background-color: var(--awb-custom_color_8); }.fusion-syntax-highlighter-6 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-custom_color_4); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-6 fusion-syntax-highlighter-theme-dark syntaxhighlighter\" style=\"opacity:0;margin-top:30px;margin-right:0px;margin-bottom:60px;margin-left:0px;font-size:14px;border-width:0px;border-style:solid;border-color:var(--awb-color8);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_6\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_6\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_6\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/javascript\">this.wait(30); \/\/ waits for 0.5 seconds<\/textarea><\/div><div class=\"fusion-text fusion-text-14 fusion-text-no-margin\" style=\"--awb-margin-bottom:60px;\"><p>At the end, make sure to add a wait command.<br \/>\nWithout it, the script will run every frame, which can cause lag.<\/p>\n<p>In this.wait(n), n represents the number of frames to wait.<\/p>\n<p>For example:<\/p>\n<ul>\n<li>this.wait(60) \u2192 waits for 1 second<\/li>\n<li>this.wait(30) \u2192 waits for 0.5 seconds<\/li>\n<\/ul>\n<\/div><div class=\"fusion-image-element\" style=\"text-align:center;--awb-margin-bottom:60px;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-4 hover-type-none\"><a href=\"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Gauge_Bar_Operation_Common_Event-en-1024x642.webp\" class=\"fusion-lightbox\" data-rel=\"iLightbox[0df78cda92511b982bf]\" data-title=\"Gauge_Bar_Operation_Common_Event-en\" title=\"Gauge_Bar_Operation_Common_Event-en\"><img decoding=\"async\" width=\"1024\" height=\"642\" alt=\"Gauge Bar Operation Common Event\" src=\"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Gauge_Bar_Operation_Common_Event-en.webp\" data-orig-src=\"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Gauge_Bar_Operation_Common_Event-en-1024x642.webp\" class=\"lazyload img-responsive wp-image-10008\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%271182%27%20height%3D%27741%27%20viewBox%3D%270%200%201182%20741%27%3E%3Crect%20width%3D%271182%27%20height%3D%27741%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Gauge_Bar_Operation_Common_Event-en-200x125.webp 200w, https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Gauge_Bar_Operation_Common_Event-en-400x251.webp 400w, https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Gauge_Bar_Operation_Common_Event-en-600x376.webp 600w, https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Gauge_Bar_Operation_Common_Event-en-800x502.webp 800w, https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Gauge_Bar_Operation_Common_Event-en.webp 1182w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 1024px) 100vw, (max-width: 640px) 100vw, 1024px\" \/><\/a><\/span><\/div><div class=\"fusion-title title fusion-title-5 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-text-color:var(--awb-custom_color_4);--awb-margin-bottom:30px;--awb-margin-top-small:20px;--awb-margin-bottom-small:10px;--awb-font-size:1.8em;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;text-transform:none;font-size:1em;--fontSize:28.8;line-height:var(--awb-typography1-line-height);\">When you use a fixed number for goal, it works fine \u2014 but if you use a variable, it doesn&#8217;t work.<\/h3><\/div><div class=\"fusion-text fusion-text-15 fusion-text-no-margin\" style=\"--awb-margin-bottom:60px;\"><p>The reason it doesn&#8217;t work when using <mark class=\"fusion-highlight custom-textcolor highlight1 awb-highlight-background rounded\" style=\"--awb-color:#cbe2ac;--awb-text-color:#121212;\">let goal = $gameVariables.value(n1);<\/mark> is usually because the variable n1 hasn\u2019t been set yet or its value is still 0. In the line<mark class=\"fusion-highlight custom-textcolor highlight1 awb-highlight-background rounded\" style=\"--awb-color:#cbe2ac;--awb-text-color:#121212;\">rate = done \/ goal;<\/mark>, if goal is 0 or undefined, the result becomes NaN or Infinity, which breaks the rest of the calculation.&nbsp;That\u2019s why you need to make sure the variable for goal is properly set before turning on the switch that runs this parallel common event. Otherwise, it won\u2019t work correctly.<\/p>\n<\/div><div class=\"fusion-separator fusion-full-width-sep\" style=\"align-self: center;margin-left: auto;margin-right: auto;margin-bottom:60px;width:100%;\"><div class=\"fusion-separator-border sep-single sep-solid\" style=\"--awb-height:20px;--awb-amount:20px;--awb-sep-color:var(--awb-custom_color_4);border-color:var(--awb-custom_color_4);border-top-width:1px;\"><\/div><\/div><div class=\"fusion-title title fusion-title-6 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"--awb-text-color:var(--awb-custom_color_4);--awb-margin-bottom:30px;--awb-margin-top-small:20px;--awb-margin-bottom-small:10px;--awb-font-size:2em;\"><h2 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;text-transform:none;font-size:1em;--fontSize:32;line-height:var(--awb-typography1-line-height);\">Summary of the Full Flow: Displaying a Real-Time Gauge Bar in RPG Maker MZ<\/h2><\/div><ul style=\"--awb-margin-bottom:30px;--awb-iconcolor:var(--awb-custom_color_4);--awb-textcolor:var(--awb-custom_color_4);--awb-line-height:27.2px;--awb-icon-width:27.2px;--awb-icon-height:27.2px;--awb-icon-margin:11.2px;--awb-content-margin:38.4px;--awb-circlecolor:var(--awb-custom_color_8);--awb-circle-yes-font-size:14.08px;\" class=\"fusion-checklist fusion-checklist-5 fusion-checklist-default type-numbered\"><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-yes\">1<\/span><div class=\"fusion-li-item-content\">\n<p>Create a Common Event to Show the Gauge Images<\/p>\n<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-yes\">2<\/span><div class=\"fusion-li-item-content\">Create a Map Event to Run the Common Event Once (Autorun, Self Switch)<\/div><\/li><li class=\"fusion-li-item\" style=\"\"><span class=\"icon-wrapper circle-yes\">3<\/span><div class=\"fusion-li-item-content\">Create a Common Event for Real-Time Gauge Updates (Parallel+wait)<\/div><\/li><\/ul><div class=\"fusion-title title fusion-title-7 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-text-color:var(--awb-custom_color_4);--awb-margin-bottom:30px;--awb-margin-top-small:20px;--awb-margin-bottom-small:10px;--awb-font-size:1.5em;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;text-transform:none;font-size:1em;--fontSize:24;line-height:var(--awb-typography1-line-height);\">1. Create a Common Event to Show the Gauge Images<\/h3><\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-7 > .CodeMirror, .fusion-syntax-highlighter-7 > .CodeMirror .CodeMirror-gutters {background-color:var(--awb-custom_color_4);}.fusion-syntax-highlighter-7 > .CodeMirror .CodeMirror-gutters { background-color: var(--awb-custom_color_8); }.fusion-syntax-highlighter-7 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-custom_color_4); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-7 fusion-syntax-highlighter-theme-dark syntaxhighlighter\" style=\"opacity:0;margin-top:30px;margin-right:0px;margin-bottom:60px;margin-left:0px;font-size:14px;border-width:0px;border-style:solid;border-color:var(--awb-color8);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_7\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_7\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_7\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/javascript\">$gameScreen.showPicture(1, 'gauge_bg', 0, 30, 30, 100, 100, 255, 0);\n$gameScreen.showPicture(2, 'gauge_fill', 0, 30, 94, 100, 0, 255, 0);\n\n$gameSwitches.setValue(n, true); \/\/ Replace n with your switch ID)<\/textarea><\/div><div class=\"fusion-title title fusion-title-8 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-text-color:var(--awb-custom_color_4);--awb-margin-bottom:30px;--awb-margin-top-small:20px;--awb-margin-bottom-small:10px;--awb-font-size:1.5em;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;text-transform:none;font-size:1em;--fontSize:24;line-height:var(--awb-typography1-line-height);\">2. Create a Map Event to Run the Common Event Once (Autorun, Self Switch)<\/h3><\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-8 > .CodeMirror, .fusion-syntax-highlighter-8 > .CodeMirror .CodeMirror-gutters {background-color:var(--awb-custom_color_4);}.fusion-syntax-highlighter-8 > .CodeMirror .CodeMirror-gutters { background-color: var(--awb-custom_color_8); }.fusion-syntax-highlighter-8 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-custom_color_4); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-8 fusion-syntax-highlighter-theme-dark syntaxhighlighter\" style=\"opacity:0;margin-top:30px;margin-right:0px;margin-bottom:60px;margin-left:0px;font-size:14px;border-width:0px;border-style:solid;border-color:var(--awb-color8);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_8\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_8\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_8\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/javascript\">$gameTemp.reserveCommonEvent(COMMON_EVENT_ID); \/\/ Replace with the ID of the gauge display common event\n\n$gameSelfSwitches.setValue([this._mapId, this.eventId(), 'A'], true);<\/textarea><\/div><div class=\"fusion-title title fusion-title-9 fusion-sep-none fusion-title-text fusion-title-size-three\" style=\"--awb-text-color:var(--awb-custom_color_4);--awb-margin-bottom:30px;--awb-margin-top-small:20px;--awb-margin-bottom-small:10px;--awb-font-size:1.5em;\"><h3 class=\"fusion-title-heading title-heading-left fusion-responsive-typography-calculated\" style=\"margin:0;text-transform:none;font-size:1em;--fontSize:24;line-height:var(--awb-typography1-line-height);\">3. Create a Common Event for Real-Time Gauge Updates (Parallel+wait)<\/h3><\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-9 > .CodeMirror, .fusion-syntax-highlighter-9 > .CodeMirror .CodeMirror-gutters {background-color:var(--awb-custom_color_4);}.fusion-syntax-highlighter-9 > .CodeMirror .CodeMirror-gutters { background-color: var(--awb-custom_color_8); }.fusion-syntax-highlighter-9 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-custom_color_4); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-9 fusion-syntax-highlighter-theme-dark syntaxhighlighter\" style=\"opacity:0;margin-top:30px;margin-right:0px;margin-bottom:60px;margin-left:0px;font-size:14px;border-width:0px;border-style:solid;border-color:var(--awb-color8);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_9\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_9\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_9\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/javascript\">let goal = $gameVariables.value(n1); \/\/ Set your goal variable ID\nlet done = $gameVariables.value(n2); \/\/ Set your progress variable ID\nlet rate = done\/goal;\nrate = Math.max(0, Math.min(1, rate));\n\nlet originalPicW = 32; \/\/ Gauge image width\nlet originalPicH = 64; \/\/ Gauge image height\nlet margin = 30;\n\nlet picX = margin + 0;\nlet picY = margin + originalPicH - originalPicH * rate;\nlet scaleY = rate * 100;\n\n$gameScreen.movePicture(\n        2,\n        0,\n        picX,\n        picY,\n        100,\n        scaleY,\n        255,\n        0,\n        30,\n        1\n    );\n\nthis.wait(30); \/\/ \/\/ Wait 0.5 seconds before the next update<\/textarea><\/div><div class=\"fusion-text fusion-text-16 fusion-text-no-margin\" style=\"--awb-margin-bottom:60px;\"><div>\n<p>&nbsp;<\/p>\n<div>Now, whenever the player does something that changes the done variable,&nbsp;the gauge bar will smoothly update on screen \u2014 giving clear, real-time feedback.&nbsp;Perfect for showing progress in crafting, quests, training, or anything you like.<\/div>\n<\/div>\n<\/div><\/div><\/div><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This post explains how to keep a gauge bar always visible on the game screen in RPG Maker MZ, and make it update in real time based on progress. By combining common events, auto-run map events, and parallel process scripts, you can create a smooth and intuitive gauge UI.<\/p>\n","protected":false},"featured_media":10005,"template":"","meta":{"_acf_changed":false},"class_list":["post-10019","js","type-js","status-publish","has-post-thumbnail","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>[RPG MAKER MZ] How to Keep a Real-Time Gauge Always Visible on the Game Screen - Salgudiy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/salgudiy.com\/en\/js\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[RPG MAKER MZ] How to Keep a Real-Time Gauge Always Visible on the Game Screen - Salgudiy\" \/>\n<meta property=\"og:description\" content=\"This post explains how to keep a gauge bar always visible on the game screen in RPG Maker MZ, and make it update in real time based on progress. By combining common events, auto-run map events, and parallel process scripts, you can create a smooth and intuitive gauge UI.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/salgudiy.com\/en\/js\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\/\" \/>\n<meta property=\"og:site_name\" content=\"Salgudiy\" \/>\n<meta property=\"article:modified_time\" content=\"2026-09-14T12:37:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Display_Gauge_Bar_Common_Event-en.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1182\" \/>\n\t<meta property=\"og:image:height\" content=\"741\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/salgudiy.com\\\/en\\\/js\\\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\\\/\",\"url\":\"https:\\\/\\\/salgudiy.com\\\/en\\\/js\\\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\\\/\",\"name\":\"[RPG MAKER MZ] How to Keep a Real-Time Gauge Always Visible on the Game Screen - Salgudiy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/salgudiy.com\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/salgudiy.com\\\/en\\\/js\\\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/salgudiy.com\\\/en\\\/js\\\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/salgudiy.com\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/Display_Gauge_Bar_Common_Event-en.webp\",\"datePublished\":\"2026-09-14T10:48:42+00:00\",\"dateModified\":\"2026-09-14T12:37:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/salgudiy.com\\\/en\\\/js\\\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/salgudiy.com\\\/en\\\/js\\\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/salgudiy.com\\\/en\\\/js\\\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\\\/#primaryimage\",\"url\":\"https:\\\/\\\/salgudiy.com\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/Display_Gauge_Bar_Common_Event-en.webp\",\"contentUrl\":\"https:\\\/\\\/salgudiy.com\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/Display_Gauge_Bar_Common_Event-en.webp\",\"width\":1182,\"height\":741,\"caption\":\"Display Gauge Bar Common Event\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/salgudiy.com\\\/en\\\/js\\\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/salgudiy.com\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[RPG MAKER MZ] How to Keep a Real-Time Gauge Always Visible on the Game Screen\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/salgudiy.com\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/salgudiy.com\\\/en\\\/\",\"name\":\"Salgudiy\",\"description\":\"\uc57c\ud638\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/salgudiy.com\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[RPG MAKER MZ] How to Keep a Real-Time Gauge Always Visible on the Game Screen - Salgudiy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/salgudiy.com\/en\/js\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\/","og_locale":"en_US","og_type":"article","og_title":"[RPG MAKER MZ] How to Keep a Real-Time Gauge Always Visible on the Game Screen - Salgudiy","og_description":"This post explains how to keep a gauge bar always visible on the game screen in RPG Maker MZ, and make it update in real time based on progress. By combining common events, auto-run map events, and parallel process scripts, you can create a smooth and intuitive gauge UI.","og_url":"https:\/\/salgudiy.com\/en\/js\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\/","og_site_name":"Salgudiy","article_modified_time":"2026-09-14T12:37:45+00:00","og_image":[{"width":1182,"height":741,"url":"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Display_Gauge_Bar_Common_Event-en.webp","type":"image\/webp"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/salgudiy.com\/en\/js\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\/","url":"https:\/\/salgudiy.com\/en\/js\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\/","name":"[RPG MAKER MZ] How to Keep a Real-Time Gauge Always Visible on the Game Screen - Salgudiy","isPartOf":{"@id":"https:\/\/salgudiy.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/salgudiy.com\/en\/js\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\/#primaryimage"},"image":{"@id":"https:\/\/salgudiy.com\/en\/js\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\/#primaryimage"},"thumbnailUrl":"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Display_Gauge_Bar_Common_Event-en.webp","datePublished":"2026-09-14T10:48:42+00:00","dateModified":"2026-09-14T12:37:45+00:00","breadcrumb":{"@id":"https:\/\/salgudiy.com\/en\/js\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/salgudiy.com\/en\/js\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/salgudiy.com\/en\/js\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\/#primaryimage","url":"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Display_Gauge_Bar_Common_Event-en.webp","contentUrl":"https:\/\/salgudiy.com\/wp-content\/uploads\/2026\/09\/Display_Gauge_Bar_Common_Event-en.webp","width":1182,"height":741,"caption":"Display Gauge Bar Common Event"},{"@type":"BreadcrumbList","@id":"https:\/\/salgudiy.com\/en\/js\/rpg-maker-mz-how-to-keep-a-real-time-gauge-always-visible-on-the-game-screen\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/salgudiy.com\/en\/"},{"@type":"ListItem","position":2,"name":"[RPG MAKER MZ] How to Keep a Real-Time Gauge Always Visible on the Game Screen"}]},{"@type":"WebSite","@id":"https:\/\/salgudiy.com\/en\/#website","url":"https:\/\/salgudiy.com\/en\/","name":"Salgudiy","description":"\uc57c\ud638","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/salgudiy.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/salgudiy.com\/en\/wp-json\/wp\/v2\/js\/10019","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/salgudiy.com\/en\/wp-json\/wp\/v2\/js"}],"about":[{"href":"https:\/\/salgudiy.com\/en\/wp-json\/wp\/v2\/types\/js"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/salgudiy.com\/en\/wp-json\/wp\/v2\/media\/10005"}],"wp:attachment":[{"href":"https:\/\/salgudiy.com\/en\/wp-json\/wp\/v2\/media?parent=10019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}