Hey guys. I've this ploblem to create Window_Note that window of description note in RMVX. I've create string in item note and i want to show it in Window_Note but it's not does work!. Why can i add string of ItemNote to this block

this's script that I write it (so badly)
this Window_Note
CODE
#==============================================================================
# ** Window_Note
#==============================================================================
class Window_Note < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(272, 56, 272, 360)
end
#--------------------------------------------------------------------------
# * Set Text
# text : character string displayed in window
# align : alignment (0..flush left, 1..center, 2..flush right)
#--------------------------------------------------------------------------
def note_text(text, align = 5)
if text != @text or align != @align
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, self.width - 40, WLH, text, align)
@text = text
@align = align
end
end
end
And this my Scene_Item
CODE
#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
# This class performs the item screen processing.
#==============================================================================
class Scene_Item < Scene_Base
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
@viewport = Viewport.new(0, 0, 544, 416)
@help_window = Window_Help.new
@help_window.viewport = @viewport
@item_window = Window_Item.new(0, 56, 272, 360)
@item_window.viewport = @viewport
@note_window = Window_Note.new
@note_window.viewport = @viewport
@item_window.help_window = @help_window
@item_window.note_window = @note_window
@item_window.active = false
@target_window = Window_MenuStatus.new(0, 0)
hide_target_window
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@viewport.dispose
@help_window.dispose
@item_window.dispose
@note_window.dispose
@target_window.dispose
end
#--------------------------------------------------------------------------
# * Return to Original Screen
#--------------------------------------------------------------------------
def return_scene
$scene = Scene_Menu.new(0)
end
#--------------------------------------------------------------------------
# * Update Frame
#--------------------------------------------------------------------------
def update
super
update_menu_background
@help_window.update
@item_window.update
@note_window.update
@target_window.update
if @item_window.active
update_item_selection
update_note
elsif @target_window.active
update_target_selection
end
end
def update_note
last_item_id = @item.id
@note_window.note_text($data_items[last_item_id].note)
end
#--------------------------------------------------------------------------
# * Update Item Selection
#--------------------------------------------------------------------------
def update_item_selection
if Input.trigger?(Input::B)
Sound.play_cancel
return_scene
elsif Input.trigger?(Input::C)
@item = @item_window.item
if @item != nil
$game_party.last_item_id = @item.id
end
if $game_party.item_can_use?(@item)
Sound.play_decision
determine_item
else
Sound.play_buzzer
end
end
end
#--------------------------------------------------------------------------
# * Confirm Item
#--------------------------------------------------------------------------
def determine_item
if @item.for_friend?
show_target_window(@item_window.index % 2 == 0)
if @item.for_all?
@target_window.index = 99
else
if $game_party.last_target_index < @target_window.item_max
@target_window.index = $game_party.last_target_index
else
@target_window.index = 0
end
end
else
use_item_nontarget
end
end
#--------------------------------------------------------------------------
# * Update Target Selection
#--------------------------------------------------------------------------
def update_target_selection
if Input.trigger?(Input::B)
Sound.play_cancel
if $game_party.item_number(@item) == 0 # If item is used up
@item_window.refresh # Recreate the window contents
end
hide_target_window
elsif Input.trigger?(Input::C)
if not $game_party.item_can_use?(@item)
Sound.play_buzzer
else
determine_target
end
end
end
#--------------------------------------------------------------------------
# * Confirm Target
# If there is no effect (such as using a potion on an incapacitated
# character), play a buzzer SE.
#--------------------------------------------------------------------------
def determine_target
used = false
if @item.for_all?
for target in $game_party.members
target.item_effect(target, @item)
used = true unless target.skipped
end
else
$game_party.last_target_index = @target_window.index
target = $game_party.members[@target_window.index]
target.item_effect(target, @item)
used = true unless target.skipped
end
if used
use_item_nontarget
else
Sound.play_buzzer
end
end
#--------------------------------------------------------------------------
# * Show Target Window
# right : Right justification flag (if false, left justification)
#--------------------------------------------------------------------------
def show_target_window(right)
@item_window.active = false
width_remain = 544 - @target_window.width
@target_window.x = right ? width_remain : 0
@target_window.visible = true
@target_window.active = true
if right
@viewport.rect.set(0, 0, width_remain, 416)
@viewport.ox = 0
else
@viewport.rect.set(@target_window.width, 0, width_remain, 416)
@viewport.ox = @target_window.width
end
end
#--------------------------------------------------------------------------
# * Hide Target Window
#--------------------------------------------------------------------------
def hide_target_window
@item_window.active = true
@target_window.visible = false
@target_window.active = false
@viewport.rect.set(0, 0, 544, 416)
@viewport.ox = 0
end
#--------------------------------------------------------------------------
# * Use Item (apply effects to non-ally targets)
#--------------------------------------------------------------------------
def use_item_nontarget
Sound.play_use_item
$game_party.consume_item(@item)
@item_window.draw_item(@item_window.index)
@target_window.refresh
if $game_party.all_dead?
$scene = Scene_Gameover.new
elsif @item.common_event_id > 0
$game_temp.common_event_id = @item.common_event_id
$scene = Scene_Map.new
end
end
end
Window_Selectable
CODE
#==============================================================================
# ** Window_Selectable
#------------------------------------------------------------------------------
# This window contains cursor movement and scroll functions.
#==============================================================================
class Window_Selectable < Window_Base
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :item_max # item count
attr_reader :column_max # digit count
attr_reader :index # cursor position
attr_reader :help_window # help window
attr_reader :note_window # note window
#--------------------------------------------------------------------------
# * Object Initialization
# x : window X coordinate
# y : window Y coordinate
# width : window width
# height : window height
# spacing : width of empty space when items are arranged horizontally
#--------------------------------------------------------------------------
def initialize(x, y, width, height, spacing = 32)
@item_max = 1
@column_max = 1
@index = -1
@spacing = spacing
super(x, y, width, height)
end
#--------------------------------------------------------------------------
# * Create Window Contents
#--------------------------------------------------------------------------
def create_contents
self.contents.dispose
self.contents = Bitmap.new(width - 32, [height - 32, row_max * WLH].max)
end
#--------------------------------------------------------------------------
# * Set Cursor Position
# index : new cursor position
#--------------------------------------------------------------------------
def index=(index)
@index = index
update_cursor
call_update_help
call_update_note
end
#--------------------------------------------------------------------------
# * Get Row Count
#--------------------------------------------------------------------------
def row_max
return (@item_max + @column_max - 1) / @column_max
end
#--------------------------------------------------------------------------
# * Get Top Row
#--------------------------------------------------------------------------
def top_row
return self.oy / WLH
end
#--------------------------------------------------------------------------
# * Set Top Row
# row : row shown on top
#--------------------------------------------------------------------------
def top_row=(row)
row = 0 if row < 0
row = row_max - 1 if row > row_max - 1
self.oy = row * WLH
end
#--------------------------------------------------------------------------
# * Get Number of Rows Displayable on 1 Page
#--------------------------------------------------------------------------
def page_row_max
return (self.height - 32) / WLH
end
#--------------------------------------------------------------------------
# * Get Number of Items Displayable on 1 Page
#--------------------------------------------------------------------------
def page_item_max
return page_row_max * @column_max
end
#--------------------------------------------------------------------------
# * Get bottom row
#--------------------------------------------------------------------------
def bottom_row
return top_row + page_row_max - 1
end
#--------------------------------------------------------------------------
# * Set bottom row
# row : Row displayed at the bottom
#--------------------------------------------------------------------------
def bottom_row=(row)
self.top_row = row - (page_row_max - 1)
end
#--------------------------------------------------------------------------
# * Get rectangle for displaying items
# index : item number
#--------------------------------------------------------------------------
def item_rect(index)
rect = Rect.new(0, 0, 0, 0)
rect.width = (contents.width + @spacing) / @column_max - @spacing
rect.height = WLH
rect.x = index % @column_max * (rect.width + @spacing)
rect.y = index / @column_max * WLH
return rect
end
#--------------------------------------------------------------------------
# * Set Help Window
# help_window : new help window
#--------------------------------------------------------------------------
def help_window=(help_window)
@help_window = help_window
call_update_help
end
def note_window=(note_window)
@note_window = note_window
call_update_note
end
#--------------------------------------------------------------------------
# * Determine if cursor is moveable
#--------------------------------------------------------------------------
def cursor_movable?
return false if (not visible or not active)
return false if (index < 0 or index > @item_max or @item_max == 0)
return false if (@opening or @closing)
return true
end
#--------------------------------------------------------------------------
# * Move cursor down
# wrap : Wraparound allowed
#--------------------------------------------------------------------------
def cursor_down(wrap = false)
if (@index < @item_max - @column_max) or (wrap and @column_max == 1)
@index = (@index + @column_max) % @item_max
end
end
#--------------------------------------------------------------------------
# * Move cursor up
# wrap : Wraparound allowed
#--------------------------------------------------------------------------
def cursor_up(wrap = false)
if (@index >= @column_max) or (wrap and @column_max == 1)
@index = (@index - @column_max + @item_max) % @item_max
end
end
#--------------------------------------------------------------------------
# * Move cursor right
# wrap : Wraparound allowed
#--------------------------------------------------------------------------
def cursor_right(wrap = false)
if (@column_max >= 2) and
(@index < @item_max - 1 or (wrap and page_row_max == 1))
@index = (@index + 1) % @item_max
end
end
#--------------------------------------------------------------------------
# * Move cursor left
# wrap : Wraparound allowed
#--------------------------------------------------------------------------
def cursor_left(wrap = false)
if (@column_max >= 2) and
(@index > 0 or (wrap and page_row_max == 1))
@index = (@index - 1 + @item_max) % @item_max
end
end
#--------------------------------------------------------------------------
# * Move cursor one page down
#--------------------------------------------------------------------------
def cursor_pagedown
if top_row + page_row_max < row_max
@index = [@index + page_item_max, @item_max - 1].min
self.top_row += page_row_max
end
end
#--------------------------------------------------------------------------
# * Move cursor one page up
#--------------------------------------------------------------------------
def cursor_pageup
if top_row > 0
@index = [@index - page_item_max, 0].max
self.top_row -= page_row_max
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if cursor_movable?
last_index = @index
if Input.repeat?(Input::DOWN)
cursor_down(Input.trigger?(Input::DOWN))
end
if Input.repeat?(Input::UP)
cursor_up(Input.trigger?(Input::UP))
end
if Input.repeat?(Input::RIGHT)
cursor_right(Input.trigger?(Input::RIGHT))
end
if Input.repeat?(Input::LEFT)
cursor_left(Input.trigger?(Input::LEFT))
end
if Input.repeat?(Input::R)
cursor_pagedown
end
if Input.repeat?(Input::L)
cursor_pageup
end
if @index != last_index
Sound.play_cursor
end
end
update_cursor
call_update_help
end
#--------------------------------------------------------------------------
# * Update cursor
#--------------------------------------------------------------------------
def update_cursor
if @index < 0 # If the cursor position is less than 0
self.cursor_rect.empty # Empty cursor
else # If the cursor position is 0 or more
row = @index / @column_max # Get current row
if row < top_row # If before the currently displayed
self.top_row = row # Scroll up
end
if row > bottom_row # If after the currently displayed
self.bottom_row = row # Scroll down
end
rect = item_rect(@index) # Get rectangle of selected item
rect.y -= self.oy # Match rectangle to scroll position
self.cursor_rect = rect # Refresh cursor rectangle
end
end
#--------------------------------------------------------------------------
# * Call help window update method
#--------------------------------------------------------------------------
def call_update_help
if self.active and @help_window != nil
update_help
end
end
def call_update_note
if self.active and @note_window != nil
update_note
end
end
#--------------------------------------------------------------------------
# * Update help window (contents are defined by the subclasses)
#--------------------------------------------------------------------------
def update_help
end
def update_note
end
end
OH! If you have any script that's like this script or more COOL! this script. please reply in this topic. Thank you!!
P.S.(I bad English. I'm sorry for write badly. = =')
This post has been edited by mazixzero: Jan 24 2009, 11:44 PM