Change Function
Category: Flow
An event content that toggles the visibility of a function button (currently the "Menu" button) always displayed on screen. It is used in situations where you do not want the player to freely open the menu, such as during story progression, before boss battles, or during cutscene playback.
Currently only the MENU button is supported
This event content currently controls only one type: the MENU (Menu) button. In the future it may support other function buttons (STATUS, ITEM, etc.), but currently it is MENU-only.
About the Menu button
The RPG Wizard G runtime has a mechanism for continuously displaying a Menu button on screen. It is drawn with the button design and display text (menu_button / menu_text) configured by the user on the System tab, and when the player clicks this button (or presses the INPUT_MENU key) the main menu screen opens.
Property list
| Item (tscn label) | Input format | Description |
|---|---|---|
| Menu (MENU) | Checkbox | ON = show the menu button, OFF = hide |
Property details
Menu (MENU)
Specifies the display state of the menu button.
- ON (checked): Show the menu button (the player can open the menu screen)
- OFF (unchecked): Hide the menu button (the player cannot open the menu screen)
Runtime behavior
When this event content is executed, the following processing is performed:
1. Change the display state of the menu button
- ON case: Sets the on-screen menu button to
visible = true - OFF case: Sets
visible = falseto hide it
2. Save the state to save data
The button's display state is saved to hud.function_button.visible.menu_button in save data. The state is retained across save/load and is restored to the same state when the game resumes.
3. Proceed to the next event content
Once the state change is complete, it proceeds immediately to the next event content.
4. Key input is also disabled while hidden
When the menu button is hidden, the INPUT_MENU key (keyboard menu assignment) also no longer opens the menu. This mechanism allows both click and key input to be controlled simultaneously.
5. Difference from automatic control during window open (enable_process)
- Automatic control (enable_process): While some window (Item / Status / Shop, etc.) is open, function buttons are automatically disabled/hidden (controlled internally by the runtime).
- This event content (Change Function): The user explicitly toggles the display state. Use it when you want to prohibit the menu for scenario reasons.
Typical usage flows
Flow 1: Prohibit menu at event start → release at end
Turn the menu off before a story scene and turn it back on after it ends:
- Change Function (this event content) (MENU: OFF) ← prohibit menu
- Fade Out Screen (black, time 1.0)
- (story scene)
- Fade In Screen (black, time 1.0)
- Change Function (this event content) (MENU: ON) ← restore menu
Flow 2: Prohibit menu before boss battle
Prohibit the menu during boss battle staging, restore after battle:
- Show Text ← "This boss is a tough enemy...!"
- Change Function (this event content) (MENU: OFF)
- (battle preparation staging)
- Start Battle
- (after battle ends)
- Change Function (this event content) (MENU: ON)
Flow 3: Prohibit menu during tutorial
Limit operations until tutorial completion:
- Change Function (this event content) (MENU: OFF)
- Show Text ← tutorial explanation
- (tutorial progression)
- Change Function (this event content) (MENU: ON) ← release after completion
Flow 4: Conditional menu prohibition
Prohibit the menu only during a specific variable state:
- Conditional Branch (Formula
{flag_critical_event} == 1) - Change Function (this event content) (MENU: OFF)
- Else
- Change Function (this event content) (MENU: ON)
- End If
Flow 5: Prohibit menu during cutscene playback
Always prohibit the menu during important staging:
- Change Function (this event content) (MENU: OFF)
- Show Image × multiple
- Play Animated Image
- Wait
- (cutscene ends)
- Change Function (this event content) (MENU: ON)
Flow 6: Opening at first launch
Prohibit menu immediately after game start, allow after opening ends:
- (game start event)
- Change Function (this event content) (MENU: OFF)
- Show Text × opening text
- Change Function (this event content) (MENU: ON) ← menu unlocked after opening ends
Typical combinations
For the overall picture, see Combination pattern collection.
Event start/end pattern
Toggle at the boundary of important events:
- Change Function (this event content) (OFF)
- (important event processing)
- Change Function (this event content) (ON)
Battle preparation pattern
Prohibit menu during pre-battle staging:
- Change Function (this event content) (OFF)
- (pre-battle staging)
- Start Battle
- Change Function (this event content) (ON) ← after battle
Combination with conditional branch
Dynamic control according to game progress:
- Conditional Branch
- Change Function (this event content) (ON/OFF according to each condition)
- End If
Related event content
| Related event content | Purpose |
|---|---|
| Fade Out Screen | Combined with scene-change staging to prohibit the menu |
| Fade In Screen | Paired with scene-change staging |
| Start Battle | Menu control before and after battle |
| Conditional Branch | Dynamic control based on conditions |
Related pages
| Page | Related content |
|---|---|
| System tab (editor) | menu_button / menu_text settings (menu button design and text) |
| Event content index | List of all event contents |
Notes
Currently only the MENU button is supported
What this event content can control is currently only one type, the Menu button. Other function buttons (STATUS, ITEM, etc.) are planned for future expansion.
Saved to save data
The menu button's display state is saved to save data. Because the state is retained across save/load, the behavior is "prohibit menu during event and save → menu remains prohibited after load". We recommend always turning it back to ON at the end.
Key input is also disabled while hidden
When set to OFF, not only clicks but also the INPUT_MENU key (ESC, etc.) on the keyboard will no longer open the menu. While this prevents unintended menu launches, it can cause operational confusion during debugging, so be careful not to forget to restore it.
Beware of confusion with enable_process
The runtime automatically disables function buttons while other windows (Item, Status, etc.) are open. This automatic control is separate from the explicit control by this event content. The display state set by this event content is maintained even after the window is closed.
If not restored to ON after event ends, permanently hidden
After setting to OFF by this event content, if the event ends without restoring to ON, the player will not be able to open the menu throughout the entire game. Always restore to ON at the exit of the scenario, or provide a mechanism to set it to ON in another event.
Follow-up on language switching
The display text on the menu button is automatically redrawn when the language is switched in the game settings. The user does not need to write additional processing.
Little meaning in using this event content while a window is open
While a window (Item, Status, etc.) is open, event processing including this event content does not proceed in the first place (enable_process=false), so you do not need to worry about behavior while a window is open.
