Skip to content

Commit a93c712

Browse files
committed
improve installation instructions and title menu integration
1 parent d4972d3 commit a93c712

2 files changed

Lines changed: 121 additions & 23 deletions

File tree

08-Horizontal-Title-Menu/Scene_Title.rb

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,18 @@ def main
2929
$game_system = Game_System.new
3030
@sprite = Sprite.new
3131
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
32-
@menu_labels = ["New Game", "Continue", "Shutdown"]
32+
@menu_labels = ["New Game", "Continue"]
33+
@bgm_player_available = defined?(Scene_Audio_BGM)
34+
if @bgm_player_available
35+
@menu_labels.push("Player")
36+
end
37+
@menu_labels.push("Shutdown")
3338
@menu_windows = []
34-
menu_w = 160
35-
menu_h = 56
3639
menu_margin = 24
40+
screen_padding = 20
41+
max_total = 640 - screen_padding * 2
42+
menu_w = [(max_total - (@menu_labels.size - 1) * menu_margin) / @menu_labels.size, 160].min
43+
menu_h = 56
3744
total_w = @menu_labels.size * menu_w + (@menu_labels.size - 1) * menu_margin
3845
start_x = 320 - total_w / 2
3946
y = 380
@@ -92,12 +99,14 @@ def update
9299
end
93100

94101
if Input.trigger?(Input::C)
95-
case @menu_index
96-
when 0
102+
case @menu_labels[@menu_index]
103+
when "New Game"
97104
command_new_game
98-
when 1
105+
when "Continue"
99106
command_continue
100-
when 2
107+
when "Player"
108+
command_bgm_player
109+
when "Shutdown"
101110
command_shutdown
102111
end
103112
end
@@ -162,6 +171,13 @@ def command_shutdown
162171
$scene = nil
163172
end
164173
#--------------------------------------------------------------------------
174+
# * Command: BGM Player
175+
#--------------------------------------------------------------------------
176+
def command_bgm_player
177+
$game_system.se_play($data_system.decision_se)
178+
$scene = Scene_Audio_BGM.new
179+
end
180+
#--------------------------------------------------------------------------
165181
# * Battle Test
166182
#--------------------------------------------------------------------------
167183
def battle_test

README.md

Lines changed: 98 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -109,26 +109,91 @@ Each script maintains full compatibility with the standard RPG Maker XP framewor
109109
### **Quick Setup**
110110
1. Open your RPG Maker XP project
111111
2. Press F11 to access the Script Editor
112-
3. Find the script you want to enhance (e.g., "Game_Player" for jump system)
113-
4. Replace the existing script content with the enhanced version
114-
5. Save your project (Ctrl+S) and test the new functionality
112+
3. Check whether the script is a **replacement** or a **new addition** (see tables below)
113+
4. For replacements, find the matching default script and replace its content
114+
5. For new additions, insert a new script entry above `Main` and paste the content
115+
6. Save your project (Ctrl+S) and test the new functionality
115116

116117
### **Adding Scripts to Your Project**
117118

118-
1. **Open Script Editor**
119+
Scripts in this library fall into two categories: **replacements** for existing default scripts and **new additions** that don't exist in the default editor.
120+
121+
#### **Replacement Scripts**
122+
123+
These scripts enhance existing default RPG Maker XP scripts. Find the matching script by name in the Script Editor (left panel), select all its content (Ctrl+A), delete it, and paste the enhanced version.
124+
125+
| Script | Replaces Default | Folder |
126+
|--------|------------------|--------|
127+
| `Game_Player.rb` | Game_Player | `01-Player-Jump-System` |
128+
| `Window_Message.rb` | Window_Message | `04-Typewriter-Message-System` |
129+
| `Window_Gold.rb` | Window_Gold | `05-Enhanced-Menu-Windows` |
130+
| `Window_Steps.rb` | Window_Steps | `05-Enhanced-Menu-Windows` |
131+
| `Window_PlayTime.rb` | Window_PlayTime | `05-Enhanced-Menu-Windows` |
132+
| `Sprite_Timer.rb` | Sprite_Timer | `06-Visual-Timer-System` |
133+
| `Scene_Save.rb` | Scene_Save | `07-Grid-Save-System` |
134+
| `Scene_Title.rb` | Scene_Title | `08-Horizontal-Title-Menu` |
135+
| `Scene_Menu.rb` | Scene_Menu | `09-Transparent-Menu-System` |
136+
| `Scene_Skill.rb` | Scene_Skill | `09-Transparent-Menu-System` |
137+
| `Scene_Status.rb` | Scene_Status | `09-Transparent-Menu-System` |
138+
| `Scene_Item.rb` | Scene_Item | `09-Transparent-Menu-System` |
139+
| `Scene_Equip.rb` | Scene_Equip | `09-Transparent-Menu-System` |
140+
141+
#### **New Addition Scripts**
142+
143+
These scripts add entirely new functionality. In the Script Editor, right-click an entry above `Main` and select **Insert**. Name the new entry to match the script, then paste the content.
144+
145+
| Script | New Entry Name | Folder |
146+
|--------|---------------|--------|
147+
| `Window_PlayerHUD.rb` | Window_PlayerHUD | `02-Player-HUD-System` |
148+
| `Window_BGMList.rb` | Window_BGMList | `03-BGM-Player-Menu` |
149+
| `Scene_Bestiary.rb` | Scene_Bestiary | `10-Bestiary-System` |
150+
| `Window_ItemPopup.rb` | Window_ItemPopup | `11-Item-Popup-System` |
151+
152+
#### **Step-by-Step: Replacing an Existing Script**
153+
154+
1. **Open the Script File**
155+
- Open the `.rb` file from this repository in a text editor (Notepad, Notepad++, VS Code, etc.)
156+
- Select all content (Ctrl+A) and copy it (Ctrl+C)
157+
158+
2. **Open Script Editor**
119159
- Launch RPG Maker XP and open your project
120160
- Press F11 to open the Script Editor
121161

122-
2. **Locate Target Script**
123-
- Find the script you want to enhance in the script list (left panel)
162+
3. **Locate Target Script**
163+
- Find the matching default script in the script list (left panel)
124164
- Click to select it (e.g., "Game_Player" for jump system)
125165

126-
3. **Replace Script Content**
127-
- Select all existing content (Ctrl+A)
166+
4. **Replace Script Content**
167+
- Select all existing content in the code area (Ctrl+A)
128168
- Delete the selected content
129-
- Copy and paste the enhanced script from this repository
169+
- Paste the copied content (Ctrl+V)
170+
171+
5. **Save Changes**
172+
- Press Ctrl+S to save your changes
173+
- Close the Script Editor
174+
- Test your game to verify functionality
175+
176+
#### **Step-by-Step: Adding a New Script**
177+
178+
1. **Open the Script File**
179+
- Open the `.rb` file from this repository in a text editor (Notepad, Notepad++, VS Code, etc.)
180+
- Select all content (Ctrl+A) and copy it (Ctrl+C)
181+
- **Note:** Do not drag `.rb` files into RPG Maker XP directly - the Script Editor does not support file imports
182+
183+
2. **Open Script Editor**
184+
- Launch RPG Maker XP and open your project
185+
- Press F11 to open the Script Editor
130186

131-
4. **Save Changes**
187+
3. **Insert New Entry**
188+
- In the script list (left panel), scroll down to **Main**
189+
- Right-click any entry above `Main` and select **Insert**
190+
- Name the new entry to match the script (e.g., "Window_PlayerHUD")
191+
192+
4. **Paste Script Content**
193+
- Click into the empty code area on the right side
194+
- Paste the copied content (Ctrl+V)
195+
196+
5. **Save Changes**
132197
- Press Ctrl+S to save your changes
133198
- Close the Script Editor
134199
- Test your game to verify functionality
@@ -263,10 +328,23 @@ bgm.pitch = [bgm.pitch + 5, 150].min # ±5% increments
263328
```
264329

265330
### Title Screen Integration
331+
The BGM Player integrates automatically with the **Horizontal Title Menu** (Script 08). When both scripts are installed, the title screen will display a "Player" option between "Continue" and "Shutdown". No additional configuration is required.
332+
333+
If you are using the **default RPG Maker XP title screen** instead of the Horizontal Title Menu, you will need to manually add a menu option. In the default `Scene_Title` script, add a new command to the `Window_Command` and handle it:
266334
```ruby
267-
# In Scene_Title update method
268-
when 2 # BGM Player option
335+
# In Scene_Title, add "BGM Player" to the command list
336+
s1 = "New Game"
337+
s2 = "Continue"
338+
s3 = "BGM Player"
339+
s4 = "Shutdown"
340+
@command_window = Window_Command.new(192, [s1, s2, s3, s4])
341+
342+
# In the update_command method, handle the new option
343+
when 2 # BGM Player
344+
$game_system.se_play($data_system.decision_se)
269345
$scene = Scene_Audio_BGM.new
346+
when 3 # Shutdown (shifted from 2 to 3)
347+
command_shutdown
270348
```
271349

272350
## Typewriter Message System
@@ -430,10 +508,17 @@ Redesigned title screen with side-by-side menu options displayed in individual w
430508
- **Horizontal Layout:** Side-by-side arrangement instead of vertical list
431509
- **Visual Highlighting:** Selected option changes color dynamically
432510
- **Centered Design:** Automatically centers menu based on number of options
511+
- **BGM Player Detection:** Automatically adds "Player" option when BGM Player Menu (Script 03) is installed
433512

434513
### Key Implementation
435514
```ruby
436-
@menu_labels = ["New Game", "Continue", "Shutdown"]
515+
# Menu labels are built dynamically
516+
@menu_labels = ["New Game", "Continue"]
517+
if defined?(Scene_Audio_BGM) # Auto-detect BGM Player
518+
@menu_labels.push("Player")
519+
end
520+
@menu_labels.push("Shutdown")
521+
437522
menu_w = 160
438523
menu_h = 56
439524
menu_margin = 24
@@ -455,9 +540,6 @@ menu_w = 160 # Width of each menu window
455540
menu_h = 56 # Height of each menu window
456541
menu_margin = 24 # Space between windows
457542
y = 380 # Vertical position
458-
459-
# Add new menu options
460-
@menu_labels = ["New Game", "Continue", "BGM Player", "Shutdown"]
461543
```
462544

463545
## Transparent Menu System

0 commit comments

Comments
 (0)