Gaming@NINA

Ending IGN's monopoly, one play at a time

Forums · Important Code Fix For RMXP

neo_b!imx

0 +0

May 10 '05

Alot of people may want to use the 'Enter Hero Name' function in their events, but for alot of people when you use that event and run the game you get the 'Enter Hero Name' window opening but all the characters are blank.
I had this problem a while back aswell and got given a fix code so here is what you need to do if you have that problem:

First open your project...Then open the Script Editor.
On the left down the list you'll find a script called Window_NameInput.
Click on that script and then select all of the script in the right hand side of the shown screen. (Either by dragging the mouse over while holding left click or press Ctrl + A)) Once you've selected the code delete it...
Then copy the following code and paste it in that place saving the changes:

[quote]#============================================
#------------------------------------------------------------------------------
#  名前入力画面で、文字を選択するウィンドウです。
#=================================================
# Character name fix by Minkoff (Minkoff@gmail.com)
# More symbol, french letters and the SPACE character added by Alex.
# Bug with the confirm button also fixed by Alex.
# www.dubealex.com
#=================================================
class Window_NameInput < Window_Base
CHARACTER_TABLE =
[
"1","2","3","4","5",
" "," "," "," "," ",
"A","B","C","D","E",
"F","G","H","I","J",
"K","L","M","N","O",
"P","Q","R","S","T",
"U","V","W","X","Y",
"Z", "À" ,"Â", "Á" ,"É",
"È","Ê","Ï","Î","Ç",
"6", "7" ,"8", "9" ,"0",
" "," "," "," "," ",
"a","b","c","d","e",
"f","g","h","i","j",
"k","l","m","n","o",
"p","q","r","s","t",
"u","v","w","x","y",
"z","à","á","â","é",
"è","ê", "ï" , "î" , "ç" ,
"+","-","×","÷","=",
"√","≈","◊","}","{",
"!","@","#","$","%",
"&","*","(",")","?",
"♂","♀","♪","♫","☼",
"♠","♣","♥","♦","☻",
"←","↑","→","↓","☺",
"Ω", "•" ,"∆", "∞" ,"₧",
"«","»","<",">","—",
" ", " " ," ", " " ," ",
" "," "," "," "," ",
" "," "," "," "," ",
" "," "," "," "," ",
" "," "," "," "," ",
" "," "," "," "," ",
" "," "," "," "," ",
" "," "," "," "," ",
" "," ", " " , " " , " " ,
]
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 128, 640, 352)
self.contents = Bitmap.new(width - 32, height - 32)
@index = 0
refresh
update_cursor_rect
end
#--------------------------------------------------------------------------
# ● 文字の取得
#--------------------------------------------------------------------------
def character
return CHARACTER_TABLE[@index]
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.name = "Arial"
self.contents.font.size = 24
for i in 0..179
x = 4 + i / 5 / 9 * 152 + i % 5 * 28
y = i / 5 % 9 * 32
self.contents.draw_text(x, y, 28, 32, CHARACTER_TABLE[i], 1)
end
self.contents.draw_text(544, 9 * 32, 64, 32, "Ok !", 1)
end
#--------------------------------------------------------------------------
# ● カーソルの矩形更新
#--------------------------------------------------------------------------
def update_cursor_rect
# カーソル位置が [決定] の場合
if @index >= 180
self.cursor_rect.set(544, 9 * 32, 64, 32)
# カーソル位置が [決定] 以外の場合
else
x = 4 + @index / 5 / 9 * 152 + @index % 5 * 28
y = @index / 5 % 9 * 32
self.cursor_rect.set(x, y, 28, 32)
end
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
# カーソル位置が [決定] の場合
if @index >= 180
# カーソル下
if Input.trigger?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
@index -= 180
end
# カーソル上
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
@index -= 180 - 40
end
# カーソル位置が [決定] 以外の場合
else
# 方向ボタンの右が押された場合
if Input.repeat?(Input::RIGHT)
# 押下状態がリピートでない場合か、
# カーソル位置が右端ではない場合
if Input.trigger?(Input::RIGHT) or
@index / 45 < 3 or @index % 5 < 4
# カーソルを右に移動
$game_system.se_play($data_system.cursor_se)
if @index % 5 < 4
@index += 1
else
@index += 45 - 4
end
if @index >= 180
@index -= 180
end
end
end
# 方向ボタンの左が押された場合
if Input.repeat?(Input::LEFT)
# 押下状態がリピートでない場合か、
# カーソル位置が左端ではない場合
if Input.trigger?(Input::LEFT) or
@index / 45 > 0 or @index % 5 > 0
# カーソルを左に移動
$game_system.se_play($data_system.cursor_se)
if @index % 5 > 0
@index -= 1
else
@index -= 45 - 4
end
if @index < 0
@index += 180
end
end
end
# 方向ボタンの下が押された場合
if Input.repeat?(Input::DOWN)
# カーソルを下に移動
$game_system.se_play($data_system.cursor_se)
if @index % 45 < 40
@index += 5
else
@index += 180 - 40
end
end
# 方向ボタンの上が押された場合
if Input.repeat?(Input::UP)
# 押下状態がリピートでない場合か、
# カーソル位置が上端ではない場合
if Input.trigger?(Input::UP) or @index % 45 >= 5
# カーソルを上に移動
$game_system.se_play($data_system.cursor_se)
if @index % 45 >= 5
@index -= 5
else
@index += 180
end
end
end
# L ボタンか R ボタンが押された場合
if Input.repeat?(Input::L) or Input.repeat?(Input::R)
# ひらがな / カタカナ 移動
$game_system.se_play($data_system.cursor_se)
if @index / 45 < 2
@index += 90
else
@index -= 90
end
end
end
update_cursor_rect
end
end[/quote]

You'll now be able to see the characters on the 'Enter Hero Name' screens. ;)
Rating: 0

isaac!gaming

0 +0

May 10 '05

I will sticky this. :)
Rating: 0

a_d00d!imx

0 +0

May 24 '05

When I use this patch I get an error message saying:

[quote]????? 'Scene_Name' ? 15 ??? NameError ????????

uninitialized constant Scene_Name::Window_NameEdit
[/quote]
and it then crashes. Does anyone know why this could be?
Rating: 0

neo_b!imx

0 +0

May 25 '05

[quote author=a_d00d link=topic=11255.msg57886#msg57886 date=1116953211]
When I use this patch I get an error message saying:
and it then crashes. Does anyone know why this could be?
[/quote]In the script editor, if you go down the left menu and select the option called 'Scene_Name'.

That error is saying that there is an error on the 15th line of code on that script.

If you go into that section could you copy what that line of code is to check if it says the right thing?
Rating: 0

flarestar

0 +0

May 29 '05

On test play when i have to put in my hero's names there are the letters to pick from but there invisible. why this?
Rating: 0

a_d00d!imx

0 +0

May 29 '05

Line 15 on Scene_Name says

  @edit_window = Window_NameEdit.new(@actor, $game_temp.name_max_char)

Is that the correct?

I don't remember editting this... but who knows.
Rating: 0

neo_b!imx

0 +0

May 29 '05

[quote author=flarestar link=topic=11255.msg59475#msg59475 date=1117388033]
On test play when i have to put in my hero's names there are the letters to pick from but there invisible. why this?
[/quote]The code fix I posted makes the letters show up in the enter name screen. :) Overwrite Window_NameInput in the script editor with all the code in the quote on my first post.
Rating: 0

neo_b!imx

0 +0

May 29 '05

[quote author=a_d00d link=topic=11255.msg59478#msg59478 date=1117388642]
Line 15 on Scene_Name says

  @edit_window = Window_NameEdit.new(@actor, $game_temp.name_max_char)

Is that the correct?

I don't remember editting this... but who knows.
[/quote]The code is right, strange that its having trouble reading the correct code. :-/
Rating: 0

a_d00d!imx

0 +0

May 30 '05

I've worked it out now, I copied the code into Name_Input instead of Name_Edit and it worked.
Rating: 0

Kyatto

0 +0

Jul 17 '05

YES! you are a GOD!! woot! its been buggin me for so long T_T

i registered just to say Thank You So Much!!
Rating: 0