Dummy window question from a dummy

Does anyone know how to set @dummy_windows.each to be visible = true or = false

I'm doing it for a activate window command in Window_ActorCommand

Sorry if you don't really understand it but I'm trying not to post the script

Anyway here is a example but it gives a error

@dummy_windows.each { |window| window.visible = true }

That is a error I keep writing it wrong not just that way^
Any help? Please?

Spoiler
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
# This window displays the status of all party members on the battle screen.
#==============================================================================

class Window_BattleStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(-20, 300, 580, 200)
refresh
self.active = false
self.opacity = 0
# Make Background Dummy Window
make_dummy_windows
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
super
# Dispose dummy windows
@dummy_windows.each {|window| window.dispose }
end
#--------------------------------------------------------------------------
# * Get rectangle for displaying items
# index : item number
#--------------------------------------------------------------------------
def item_rect(index)
rect = Rect.new(0, 0, 0, 0)
rect.width = 136
rect.height = 24
rect.x = index * 136 + (544 - (136 * @item_max)) / 2
rect.y = 0
return rect
end
#--------------------------------------------------------------------------
# * Create Background Dummy Windows
#--------------------------------------------------------------------------
def make_dummy_windows
# Dummy Windows Array
@dummy_windows = []
for i in 0...@item_max
x = i * 136 + (544 - (136 * @item_max)) / 2
y = self.y + 46
@dummy_windows << Window_Base.new(x, y, 136, 70)
@dummy_windows.z = self.z - 10
end
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.members.size
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : Item number
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
rect.x += 4
rect.width -= 8
rect.height += 80
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
actor = $game_party.members[index]
self.contents.font.size = 16
# Draw Actors face
draw_actor_face(actor, rect.x + 20, 35 - 18)
# Draw Actors names
draw_actor_name(actor, rect.x + 10, 32)
self.contents.font.size = 14
draw_actor_hp(actor, rect.x + 10, 72 - 16, 113)
draw_actor_mp(actor, rect.x + 10, 72, 113)
# Draw Action Icon
# draw_action_icon(index)
end
#--------------------------------------------------------------------------
# * Draw Character Icon Matching their current Action
# index : Item number
#--------------------------------------------------------------------------
def draw_action_icon(index)
# Get Actor
actor = $game_party.members[index]
Return if actor action is nothing
return if actor.action.nothing?
Return if cannot act by player input
return if actor.confusion? or actor.berserker?
Set Icon Index to 0
icon_index = 0
Get Item Rect
rect = item_rect(index)
If action is to attack set main weapon icon
icon_index = actor.weapons[0] == nil ? 0 : actor.weapons[0].icon_index if actor.action.attack?
If action is to guard set shield icon
icon_index = actor.armors[0] == nil ? 0 : actor.armors[0].icon_index if actor.action.guard?
If action is to use a skill use skill icon
icon_index = actor.action.skill.icon_index if actor.action.skill?
If action is to use an item use item icon
icon_index = actor.action.item.icon_index if actor.action.item?
Action Icon
draw_icon(icon_index, rect.x + 110, 35)
end
#--------------------------------------------------------------------------
# * Update cursor
# index : window to set as active
#--------------------------------------------------------------------------
def set_active(index = @index)
# If Active Window Index is not nil
if @active_window_index != nil
@dummy_windows[@active_window_index].windowskin = Cache.system("Window")
end
# Set Active Window Index
@active_window_index = index
# Return if index is nil
return if index == nil
# Set Active Windowskin
@dummy_windows[index].windowskin = Cache.system("Active Windowskin")
end
#--------------------------------------------------------------------------
# * Update cursor
#--------------------------------------------------------------------------
def update_cursor
# If the cursor position is less than 0
if @index < 0
# Empty cursor
self.cursor_rect.empty
else
# Set Cursor Position
self.cursor_rect.set(@index * 136 + (544 - (136 * @item_max)) / 2 + 10, 36, 124, 58 )
end
end
#--------------------------------------------------------------------------
# * Draw Face Graphic
# face_name : Face graphic filename
# face_index : Face graphic index
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# size : Display size
#--------------------------------------------------------------------------
def draw_face(face_name, face_index, x, y, size = 96)
bitmap = Cache.face(face_name)
rect = Rect.new(0, 0, 0, 0)
rect.x = 96 / 2
rect.y = 96 / 2
rect.width = 78
rect.height = 78
self.contents.blt(x, y, bitmap, rect, 100)
self.contents.clear_rect(x, y, 100, 18)
bitmap.dispose
end
#--------------------------------------------------------------------------
# * Draw HP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : Width
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 120)
draw_actor_hp_gauge(actor, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, line_height, Vocab::hp_a)
self.contents.font.color = hp_color(actor)
last_font_size = self.contents.font.size
xr = x + width
self.contents.draw_text(xr - 99, y, 44, line_height, actor.hp, 2)
self.contents.font.color = normal_color
self.contents.draw_text(xr - 55, y, 11, line_height, "/", 2)
self.contents.draw_text(xr - 44, y, 44, line_height, actor.mhp, 2)
end
#--------------------------------------------------------------------------
# * Draw HP gauge
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : Width
#--------------------------------------------------------------------------
def draw_actor_hp_gauge(actor, x, y, width = 120)
gw = width * actor.hp / actor.mhp
gc1 = hp_gauge_color1
gc2 = hp_gauge_color2
self.contents.fill_rect(x, y + line_height - 8, width, 4, gauge_back_color)
self.contents.gradient_fill_rect(x, y + line_height - 8, gw, 4, gc1, gc2)
end
#--------------------------------------------------------------------------
# * Draw MP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : Width
#--------------------------------------------------------------------------
def draw_actor_mp(actor, x, y, width = 120)
draw_actor_mp_gauge(actor, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, line_height, Vocab::mp_a)
self.contents.font.color = mp_color(actor)
last_font_size = self.contents.font.size
xr = x + width
self.contents.draw_text(xr - 99, y, 44, line_height, actor.mp, 2)
self.contents.font.color = normal_color
self.contents.draw_text(xr - 55, y, 11, line_height, "/", 2)
self.contents.draw_text(xr - 44, y, 44, line_height, actor.mmp, 2)
end
#--------------------------------------------------------------------------
# * Draw MP Gauge
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : Width
#--------------------------------------------------------------------------
def draw_actor_mp_gauge(actor, x, y, width = 120)
gw = width * actor.mp / [actor.mmp, 1].max
gc1 = mp_gauge_color1
gc2 = mp_gauge_color2
self.contents.fill_rect(x, y + line_height - 8, width, 4, gauge_back_color)
self.contents.gradient_fill_rect(x, y + line_height - 8, gw, 4, gc1, gc2)
end
end


#==============================================================================
# ** Window_Selectable
#------------------------------------------------------------------------------
# This window contains cursor movement and scroll functions.
#==============================================================================

class Window_Selectable < Window_Base
#--------------------------------------------------------------------------
# * Create Window Contents
#--------------------------------------------------------------------------
def create_contents
self.contents.dispose
self.contents = Bitmap.new(width - 32, [height - 32, row_max * 29].max)
end
#--------------------------------------------------------------------------
# * Get Top Row
#--------------------------------------------------------------------------
def top_row
return self.oy / 29
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 * 29
end
#--------------------------------------------------------------------------
# * Get Number of Rows Displayable on 1 Page
#--------------------------------------------------------------------------
def page_row_max
return (self.height - 32) / 29
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 = line_height
rect.x = index % @column_max * (rect.width + @spacing)
rect.y = index / @column_max * 29
return rect
end
end

#==============================================================================
# ** Window_Help
#------------------------------------------------------------------------------
# This window shows skill and item explanations along with actor status.
#==============================================================================

class Window_Help < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 233, 280, 200)
self.opacity = 0
# Make Dummy Windows
make_dummy_windows
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
super
# Dispose dummy windows
@dummy_windows.each {|window| window.dispose }
end
#--------------------------------------------------------------------------
# * Activate Command Window
#--------------------------------------------------------------------------
def activate
# Set Command Window Visibility to true
self.visible = true
# Set dummy windows to visible
@dummy_windows.each {|window| window.visible = true }
end
#--------------------------------------------------------------------------
# * De-Activate Command Window
#--------------------------------------------------------------------------
def deactivate
# Set Command Window Visibility to true
self.visible = false
# Set dummy windows to invisible
@dummy_windows.each {|window| window.visible = false }
end
#--------------------------------------------------------------------------
# * Create Background Dummy Windows
#--------------------------------------------------------------------------
def make_dummy_windows
# Dummy Windows Array
@dummy_windows = []
# Header Window
@dummy_windows << Window_Base.new(10, 251, 255, 41)
@dummy_windows[0].z = self.z - 10
# Text window
@dummy_windows << Window_Base.new(10, 251 + 49 , 255, 41)
@dummy_windows[1].z = self.z - 10
return
end
#--------------------------------------------------------------------------
# * Set Text
# text : character string displayed in window
# align : alignment (0..flush left, 1..center, 2..flush right)
#--------------------------------------------------------------------------
def set_text(text, align = 1)
if text != @text or align != @align
self.contents.clear
self.contents.font.color = normal_color

self.contents.draw_text(4, 59, self.width - 40, WLH, text, align)
self.contents.draw_text(4, 10, self.width - 40, WLH, text, align)
@text = text
@align = align
end
end
#--------------------------------------------------------------------------
# * Set ObjectText
# obj : Skill or item
#--------------------------------------------------------------------------
def set_object_text(obj)
if obj != @object
self.contents.clear
self.contents.font.color = normal_color
# If object is not nil
if obj != nil
# Set Header
header = "SKILL" if obj.is_a?(RPG::Skill)
header = "ITEM" if obj.is_a?(RPG::Item)
self.contents.font.color = system_color
self.contents.draw_text(4, 10, self.width - 40, line_height, header, 1)
self.contents.font.color = normal_color
self.contents.draw_text(4, 59, self.width - 40, line_height, obj.description, 1)
end
# Set object
@object = obj
end
end
end

#==============================================================================
# ** Window_BattleSkill
#------------------------------------------------------------------------------
# This window displays a list of usable skills on the skill screen, etc.
#==============================================================================

class Window_BattleSkill < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(actor)
super(280, 251, 255, 90)
@actor = actor
@column_max = 1
self.index = 0
refresh
end
#--------------------------------------------------------------------------
# * Get Skill
#--------------------------------------------------------------------------
def skill
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
@data = []
for skill in @actor.skills
@data.push(skill)
if skill.id == @actor.last_skill_id
self.index = @data.size - 1
end
end
@item_max = @data.size
create_contents
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
skill = @data[index]
if skill != nil
rect.width -= 4
enabled = @actor.skill_can_use?(skill)
draw_item_name(skill, rect.x, rect.y, enabled)
self.contents.draw_text(rect, @actor.calc_mp_cost(skill), 2)
end
end
#--------------------------------------------------------------------------
# * Update Help Text
#--------------------------------------------------------------------------
def update_help
@help_window.set_object_text(skill)
end
end


#==============================================================================
# ** Window_BattleItem
#------------------------------------------------------------------------------
# This window displays a list of inventory items for the item screen, etc.
#==============================================================================

class Window_BattleItem < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(280, 251, 255, 90)
@column_max = 1
self.index = 0
refresh
end
#--------------------------------------------------------------------------
# * Get Item
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Whether or not to include in item list
# item : item
#--------------------------------------------------------------------------
def include?(item)
return false if item == nil
if $game_temp.in_battle
return false unless item.is_a?(RPG::Item)
end
return true
end
#--------------------------------------------------------------------------
# * Whether or not to display in enabled state
# item : item
#--------------------------------------------------------------------------
def enable?(item)
return $game_party.item_can_use?(item)
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
@data = []
for item in $game_party.items
next unless include?(item)
@data.push(item)
if item.is_a?(RPG::Item) and item.id == $game_party.last_item_id
self.index = @data.size - 1
end
end
@data.push(nil) if include?(nil)
@item_max = @data.size
create_contents
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
item = @data[index]
if item != nil
number = $game_party.item_number(item)
enabled = enable?(item)
rect.width -= 4
draw_item_name(item, rect.x, rect.y, enabled)
self.contents.draw_text(rect, sprintf(":%2d", number), 2)
end
end
#--------------------------------------------------------------------------
# * Update Help Text
#--------------------------------------------------------------------------
def update_help
@help_window.set_object_text(item)
end
end

#==============================================================================
# ** Window_PartyCommand
#------------------------------------------------------------------------------
# This window is used to select whether to fight or escape on the battle
# screen.
#==============================================================================

class Window_PartyCommand < Window_Command
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
s1 = Vocab::fight
s2 = Vocab::escape
super(544, 416)
draw_item(0, true)
draw_item(1, BattleManager.can_escape?)
self.y = 292
self.x = 5
self.opacity = 0
self.visible = false
self.active = false
make_dummy_windows
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
super
# Dispose dummy windows
@dummy_windows.each {|window| window.dispose}
end
#--------------------------------------------------------------------------
# * Activate Command Window
#--------------------------------------------------------------------------
def activate
# Set Command Window Visibility to true
self.visible = true
# Set dummy windows to visible
# @dummy_windows.each.visible = true
# Set Window To active
self.active = true
end
#--------------------------------------------------------------------------
# * De-Activate Command Window
#--------------------------------------------------------------------------
def deactivate
# Set Command Window Visibility to true
self.visible = false
# Set dummy windows to invisible
# @dummy_windows.each.visible = false
# Set Window To inactive
self.active = false
end
#--------------------------------------------------------------------------
# * Get rectangle for displaying items
# index : item number
#--------------------------------------------------------------------------
def item_rect(index)
rect = Rect.new(0, 0, 0, 0)
rect.width = 245
rect.height = 24
rect.x = index % 2 * 265
rect.y = index / 2 * 49
return rect
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
# enabled : enabled flag. When false, draw semi-transparently.
#--------------------------------------------------------------------------
def draw_item(index, enabled = true)
rect = item_rect(index)
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(rect, @commands[index], 1)
end
#--------------------------------------------------------------------------
# * Create Background Dummy Windows
#--------------------------------------------------------------------------
def make_dummy_windows
# Dummy Windows Array
@dummy_windows = []
for i in 0...2
x = self.x + 5 + i % 2 * 270 #265
y = self.y + 8 + i / 2 * 49
@dummy_windows << Window_Base.new(x, y, 255, 41)
@dummy_windows.visible = true
@dummy_windows.z = self.z - 10
end
end
#--------------------------------------------------------------------------
# * Update cursor
#--------------------------------------------------------------------------
def update_cursor
# Set Cursor Position
self.cursor_rect.set((@index % 2 * 270), (@index / 2 * 49), 233, 25)
end
end

#==============================================================================
# ** Window_ActorCommand
#------------------------------------------------------------------------------
# This window is used to select actor commands, such as "Attack" or "Skill".
#==============================================================================

class Window_ActorCommand < Window_Command
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(540, 4)
self.y = 243
self.x = 5
self.visible = false
self.active = false
self.opacity = 0
# Make Background Dummy Window
make_dummy_windows
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
super
# Dispose dummy windows
@dummy_windows.each {|window| window.dispose }
end
#--------------------------------------------------------------------------
# * Get rectangle for displaying items
# index : item number
#--------------------------------------------------------------------------
def item_rect(index)
rect = Rect.new(0, 0, 0, 0)
rect.width = 245
rect.height = 24
rect.x = index % 2 * 270
rect.y = index / 2 * 49
return rect
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
# enabled : enabled flag. When false, draw semi-transparently.
#--------------------------------------------------------------------------
def draw_item(index, enabled = true)
rect = item_rect(index)
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(rect, command_name(index), 1)
self.contents.draw_text(item_rect_for_text(index), command_name(index), alignment)
end
#--------------------------------------------------------------------------
# * Create Background Dummy Windows
#--------------------------------------------------------------------------
def make_dummy_windows
# Dummy Windows Array
@dummy_windows = []
for i in 0...4
x = self.x + 5 + i % 2 * 270
y = self.y + 8 + i / 2 * 49
@dummy_windows << Window_Base.new(x, y, 255, 41)
@dummy_windows.visible = true
@dummy_windows.z = self.z - 10
end
end
#--------------------------------------------------------------------------
# * Activate Command Window
#--------------------------------------------------------------------------
def activate
# Set dummy windows to visible
@dummy_windows.each {|window| window.visible = true }
# Set Command Window Visibility to true
self.visible = true
# Set Window To active
self.active = true
end
#--------------------------------------------------------------------------
# * De-Activate Command Window
#--------------------------------------------------------------------------
def deactivate
# Set dummy windows to invisible
@dummy_windows.each {|window| window.visible = false }
# Set Command Window Visibility to true
self.visible = false
# Set Window To inactive
self.active = false
end
#--------------------------------------------------------------------------
# * Setup
# actor : actor
#--------------------------------------------------------------------------
def make_command_list
return unless @actor
add_attack_command
add_skill_commands
add_guard_command
add_item_command
end
#--------------------------------------------------------------------------
# * Add Attack Command to List
#--------------------------------------------------------------------------
def add_attack_command
add_command(Vocab::attack, :attack, @actor.attack_usable?)
end
#--------------------------------------------------------------------------
# * Add Skill Command to List
#--------------------------------------------------------------------------
def add_skill_commands
@actor.added_skill_types.sort.each do |stype_id|
name = $data_system.skill_types[stype_id]
add_command(name, :skill, true, stype_id)
end
end
#--------------------------------------------------------------------------
# * Add Guard Command to List
#--------------------------------------------------------------------------
def add_guard_command
add_command(Vocab::guard, :guard, @actor.guard_usable?)
end
#--------------------------------------------------------------------------
# * Add Item Command to List
#--------------------------------------------------------------------------
def add_item_command
add_command(Vocab::item, :item)
end
#--------------------------------------------------------------------------
# * Update cursor
#--------------------------------------------------------------------------
def update_cursor
# Set Cursor Position
self.cursor_rect.set((@index % 2 * 270), (@index / 2 * 49), 233, 25)
end
end
 

Honestly the whole thing is bugged to hell 

and there are so many errors.
What is the error? We can't help if we don't know what it is telling you is wrong.
One error is

undefined method 'each' for nil:NilClass
It's saying there's nothing in @dummy_windows.


You have to start by initializing it to [] so it knows it's an array, then actually populate it with window objects.


You're going to have to show us your script if you really want help (and we prefer not to guess and have you try things). Post the script, enclosed in [ code] tags, and the lot enclosed in [ spoiler] tags if it's a big script.
I only ment I didn't really wanna post it cause I'm using my phone my desktop is not connected to the Internet I honestly wouldn't mind sharing it let me see if I can find a way to upload it first ill edit my post after
Well, check what I said first. @dummy_windows hasn't been initialized (it doesn't know it's an array), and there's nothing in it. So you're probably calling that method before setting up the variable properly.
If I # that line out the battle will load but only the blank windows will show it's weird there's no information gauges or words being displayed anywhere. And they were written in the script I believe
Why did you comment that line out? That's not what I suggested.
That's just something I tried I'm kinda bad at scripting in general and I didn't really know what you ment when you said Initialize it to [] sorry
You didn't add the code tags. Your script is really hard to read. (and if you want to fix it, you can't just go and ADD the code tags now - the formatting has already been lost).


With a quick glance, I don't really see what's wrong with that code. You don't normally create other windows IN a window class - you normally do it in the Scene class, but I doubt that has a lot to do with it.


Maybe someone else can see what I'm missing.
@dummy_windows is nil, Ruby's version of Null, nothing, nada, zilch. It is nothing. It was never given a value, you just tried to use it, so it is set to nil. nil can't really do anything. You're trying to set every 'visible' value held in nothing to true or false. But it is nothing. It contains no data. You never set @dummy_windows to hold anything, there are no windows referenced, held, found by, seen, poked at, modifiable by, reachable by @dummy_windows. It. Is. Nothing.

You are getting an error because obviously you can't do something with nothing. Ruby wants you to set it to an array (like @dummy_windows = []). You need to initialize it, originally set it, as an array, which will then hold all your windows.
Oh that I defined that

@dummy_windows = [ ]

For i in 0...@item_max

x = i * 136 + (544 - (136 * @item_max)) / 2

y = self.y + 46

@dummy_windows << Window_Base.new (x,y 136, 70)

@dummy_windows.z = self.z - 10

No wait I think that only made a background

I'm trying to learn ruby as fast as I can but I'm also back in school so I have little time now
I'll just assume there's an 'end' after that last line.

Also, for 0...@item_max will not include item_max. '...' is exclusive, it won't go from the first number you chose to the last. To do an include range, use '..', only two dots.
I think ... is fine, because if you're starting at 0, you actually WANT it to go to one less than the number of items.


And even if @item_max is 0, @dummy_windows has at least been defined as an array, so the .each method should be recognized.


I didn't realize you had so many. WHICH line is it throwing the error on? WHICH class has the method that it doesn't like?


It seems as if you haven't created the dummy windows in one of them, or at least haven't created them prior to activating the parent window.
When I used the .. It just made 2 blank windows

Lines 695,706,
Yeah, I'm not going to count 700 lines to help you when your script is already hard to read because you didn't include the code tags. Sorry. I asked you which class has the method that's throwing the error.


Edit: If you want to load your project up somewhere, and tell me what I have to do to trigger the error, I can spend a LITTLE time debugging it myself.


Edit 2: I think this is the problem ...


In your initialize, you call super, then you do some stuff, then you make the dummy windows.


Part of super (right back up in Window_Selectable), is to call deactivate.


So your init runs, calls super, calls deactivate, and calls the update on the dummy windows array, then AFTER that is all done, your make_dummy_windows method gets called.


In each initialize method, call make_dummy_windows BEFORE you call super() and see if there's a difference.
I put it on my website it's in my signature

Messy.rar is the file

And it's on my homepage
It's not crashing for me.
Spoiler
#==============================================================================# ** Window_BattleStatus#------------------------------------------------------------------------------# This window displays the status of all party members on the battle screen.#==============================================================================class Window_BattleStatus < Window_Selectable #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(-20, 300, 580, 200) refresh self.active = false self.opacity = 0 # Make Background Dummy Window make_dummy_windows end #-------------------------------------------------------------------------- # * Dispose #-------------------------------------------------------------------------- def dispose super # Dispose dummy windows @dummy_windows.each {|window| window.dispose } end #-------------------------------------------------------------------------- # * Get rectangle for displaying items # index : item number #-------------------------------------------------------------------------- def item_rect(index) rect = Rect.new(0, 0, 0, 0) rect.width = 136 rect.height = 24 rect.x = index * 136 + (544 - (136 * @item_max)) / 2 rect.y = 0 return rect end #-------------------------------------------------------------------------- # * Create Background Dummy Windows #-------------------------------------------------------------------------- def make_dummy_windows # Dummy Windows Array @dummy_windows = [] for i in 0...@item_max x = i * 136 + (544 - (136 * @item_max)) / 2 y = self.y + 46 @dummy_windows << Window_Base.new(x, y, 136, 70) @dummy_windows.z = self.z - 10 end end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear @item_max = $game_party.members.size for i in 0...@item_max draw_item(i) end end #-------------------------------------------------------------------------- # * Draw Item # index : Item number #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) rect.x += 4 rect.width -= 8 rect.height += 80 self.contents.clear_rect(rect) self.contents.font.color = normal_color actor = $game_party.members[index] self.contents.font.size = 16 # Draw Actors face draw_actor_face(actor, rect.x + 20, 35 - 18) # Draw Actors names draw_actor_name(actor, rect.x + 10, 32) self.contents.font.size = 14 draw_actor_hp(actor, rect.x + 10, 72 - 16, 113) draw_actor_mp(actor, rect.x + 10, 72, 113) # Draw Action Icon # draw_action_icon(index) end #-------------------------------------------------------------------------- # * Draw Character Icon Matching their current Action # index : Item number #-------------------------------------------------------------------------- def draw_action_icon(index) # Get Actor actor = $game_party.members[index] Return if actor action is nothing return if actor.action.nothing? Return if cannot act by player input return if actor.confusion? or actor.berserker? Set Icon Index to 0 icon_index = 0 Get Item Rect rect = item_rect(index) If action is to attack set main weapon icon icon_index = actor.weapons[0] == nil ? 0 : actor.weapons[0].icon_index if actor.action.attack? If action is to guard set shield icon icon_index = actor.armors[0] == nil ? 0 : actor.armors[0].icon_index if actor.action.guard? If action is to use a skill use skill icon icon_index = actor.action.skill.icon_index if actor.action.skill? If action is to use an item use item icon icon_index = actor.action.item.icon_index if actor.action.item? Action Icon draw_icon(icon_index, rect.x + 110, 35) end #-------------------------------------------------------------------------- # * Update cursor # index : window to set as active #-------------------------------------------------------------------------- def set_active(index = @index) # If Active Window Index is not nil if @active_window_index != nil @dummy_windows[@active_window_index].windowskin = Cache.system("Window") end # Set Active Window Index @active_window_index = index # Return if index is nil return if index == nil # Set Active Windowskin @dummy_windows[index].windowskin = Cache.system("Active Windowskin") end #-------------------------------------------------------------------------- # * Update cursor #-------------------------------------------------------------------------- def update_cursor # If the cursor position is less than 0 if @index < 0 # Empty cursor self.cursor_rect.empty else # Set Cursor Position self.cursor_rect.set(@index * 136 + (544 - (136 * @item_max)) / 2 + 10, 36, 124, 58 ) end end #-------------------------------------------------------------------------- # * Draw Face Graphic # face_name : Face graphic filename # face_index : Face graphic index # x : draw spot x-coordinate # y : draw spot y-coordinate # size : Display size #-------------------------------------------------------------------------- def draw_face(face_name, face_index, x, y, size = 96) bitmap = Cache.face(face_name) rect = Rect.new(0, 0, 0, 0) rect.x = 96 / 2 rect.y = 96 / 2 rect.width = 78 rect.height = 78 self.contents.blt(x, y, bitmap, rect, 100) self.contents.clear_rect(x, y, 100, 18) bitmap.dispose end #-------------------------------------------------------------------------- # * Draw HP # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # width : Width #-------------------------------------------------------------------------- def draw_actor_hp(actor, x, y, width = 120) draw_actor_hp_gauge(actor, x, y, width) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, line_height, Vocab::hp_a) self.contents.font.color = hp_color(actor) last_font_size = self.contents.font.size xr = x + width self.contents.draw_text(xr - 99, y, 44, line_height, actor.hp, 2) self.contents.font.color = normal_color self.contents.draw_text(xr - 55, y, 11, line_height, "/", 2) self.contents.draw_text(xr - 44, y, 44, line_height, actor.mhp, 2) end #-------------------------------------------------------------------------- # * Draw HP gauge # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # width : Width #-------------------------------------------------------------------------- def draw_actor_hp_gauge(actor, x, y, width = 120) gw = width * actor.hp / actor.mhp gc1 = hp_gauge_color1 gc2 = hp_gauge_color2 self.contents.fill_rect(x, y + line_height - 8, width, 4, gauge_back_color) self.contents.gradient_fill_rect(x, y + line_height - 8, gw, 4, gc1, gc2) end #-------------------------------------------------------------------------- # * Draw MP # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # width : Width #-------------------------------------------------------------------------- def draw_actor_mp(actor, x, y, width = 120) draw_actor_mp_gauge(actor, x, y, width) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, line_height, Vocab::mp_a) self.contents.font.color = mp_color(actor) last_font_size = self.contents.font.size xr = x + width self.contents.draw_text(xr - 99, y, 44, line_height, actor.mp, 2) self.contents.font.color = normal_color self.contents.draw_text(xr - 55, y, 11, line_height, "/", 2) self.contents.draw_text(xr - 44, y, 44, line_height, actor.mmp, 2) end #-------------------------------------------------------------------------- # * Draw MP Gauge # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # width : Width #-------------------------------------------------------------------------- def draw_actor_mp_gauge(actor, x, y, width = 120) gw = width * actor.mp / [actor.mmp, 1].max gc1 = mp_gauge_color1 gc2 = mp_gauge_color2 self.contents.fill_rect(x, y + line_height - 8, width, 4, gauge_back_color) self.contents.gradient_fill_rect(x, y + line_height - 8, gw, 4, gc1, gc2) endend#==============================================================================# ** Window_Selectable#------------------------------------------------------------------------------# This window contains cursor movement and scroll functions.#==============================================================================class Window_Selectable < Window_Base #-------------------------------------------------------------------------- # * Create Window Contents #-------------------------------------------------------------------------- def create_contents self.contents.dispose self.contents = Bitmap.new(width - 32, [height - 32, row_max * 29].max) end #-------------------------------------------------------------------------- # * Get Top Row #-------------------------------------------------------------------------- def top_row return self.oy / 29 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 * 29 end #-------------------------------------------------------------------------- # * Get Number of Rows Displayable on 1 Page #-------------------------------------------------------------------------- def page_row_max return (self.height - 32) / 29 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 = line_height rect.x = index % @column_max * (rect.width + @spacing) rect.y = index / @column_max * 29 return rect endend#==============================================================================# ** Window_Help#------------------------------------------------------------------------------# This window shows skill and item explanations along with actor status.#==============================================================================class Window_Help < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 233, 280, 200) self.opacity = 0 # Make Dummy Windows make_dummy_windows end #-------------------------------------------------------------------------- # * Dispose #-------------------------------------------------------------------------- def dispose super # Dispose dummy windows @dummy_windows.each {|window| window.dispose } end #-------------------------------------------------------------------------- # * Activate Command Window #-------------------------------------------------------------------------- def activate # Set Command Window Visibility to true self.visible = true # Set dummy windows to visible @dummy_windows.each {|window| window.visible = true } end #-------------------------------------------------------------------------- # * De-Activate Command Window #-------------------------------------------------------------------------- def deactivate # Set Command Window Visibility to true self.visible = false # Set dummy windows to invisible @dummy_windows.each {|window| window.visible = false } end #-------------------------------------------------------------------------- # * Create Background Dummy Windows #-------------------------------------------------------------------------- def make_dummy_windows # Dummy Windows Array @dummy_windows = [] # Header Window @dummy_windows << Window_Base.new(10, 251, 255, 41) @dummy_windows[0].z = self.z - 10 # Text window @dummy_windows << Window_Base.new(10, 251 + 49 , 255, 41) @dummy_windows[1].z = self.z - 10 return end #-------------------------------------------------------------------------- # * Set Text # text : character string displayed in window # align : alignment (0..flush left, 1..center, 2..flush right) #-------------------------------------------------------------------------- def set_text(text, align = 1) if text != @text or align != @align self.contents.clear self.contents.font.color = normal_color self.contents.draw_text(4, 59, self.width - 40, WLH, text, align) self.contents.draw_text(4, 10, self.width - 40, WLH, text, align) @text = text @align = align end end #-------------------------------------------------------------------------- # * Set ObjectText # obj : Skill or item #-------------------------------------------------------------------------- def set_object_text(obj) if obj != @object self.contents.clear self.contents.font.color = normal_color # If object is not nil if obj != nil # Set Header header = "SKILL" if obj.is_a?(RPG::Skill) header = "ITEM" if obj.is_a?(RPG::Item) self.contents.font.color = system_color self.contents.draw_text(4, 10, self.width - 40, line_height, header, 1) self.contents.font.color = normal_color self.contents.draw_text(4, 59, self.width - 40, line_height, obj.description, 1) end # Set object @object = obj end endend#==============================================================================# ** Window_BattleSkill#------------------------------------------------------------------------------# This window displays a list of usable skills on the skill screen, etc.#==============================================================================class Window_BattleSkill < Window_Selectable #-------------------------------------------------------------------------- # * Object Initialization # actor : actor #-------------------------------------------------------------------------- def initialize(actor) super(280, 251, 255, 90) @actor = actor @column_max = 1 self.index = 0 refresh end #-------------------------------------------------------------------------- # * Get Skill #-------------------------------------------------------------------------- def skill return @data[self.index] end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh @data = [] for skill in @actor.skills @data.push(skill) if skill.id == @actor.last_skill_id self.index = @data.size - 1 end end @item_max = @data.size create_contents for i in 0...@item_max draw_item(i) end end #-------------------------------------------------------------------------- # * Draw Item # index : item number #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) self.contents.clear_rect(rect) skill = @data[index] if skill != nil rect.width -= 4 enabled = @actor.skill_can_use?(skill) draw_item_name(skill, rect.x, rect.y, enabled) self.contents.draw_text(rect, @actor.calc_mp_cost(skill), 2) end end #-------------------------------------------------------------------------- # * Update Help Text #-------------------------------------------------------------------------- def update_help @help_window.set_object_text(skill) endend#==============================================================================# ** Window_BattleItem#------------------------------------------------------------------------------# This window displays a list of inventory items for the item screen, etc.#==============================================================================class Window_BattleItem < Window_Selectable #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(280, 251, 255, 90) @column_max = 1 self.index = 0 refresh end #-------------------------------------------------------------------------- # * Get Item #-------------------------------------------------------------------------- def item return @data[self.index] end #-------------------------------------------------------------------------- # * Whether or not to include in item list # item : item #-------------------------------------------------------------------------- def include?(item) return false if item == nil if $game_temp.in_battle return false unless item.is_a?(RPG::Item) end return true end #-------------------------------------------------------------------------- # * Whether or not to display in enabled state # item : item #-------------------------------------------------------------------------- def enable?(item) return $game_party.item_can_use?(item) end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh @data = [] for item in $game_party.items next unless include?(item) @data.push(item) if item.is_a?(RPG::Item) and item.id == $game_party.last_item_id self.index = @data.size - 1 end end @data.push(nil) if include?(nil) @item_max = @data.size create_contents for i in 0...@item_max draw_item(i) end end #-------------------------------------------------------------------------- # * Draw Item # index : item number #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) self.contents.clear_rect(rect) item = @data[index] if item != nil number = $game_party.item_number(item) enabled = enable?(item) rect.width -= 4 draw_item_name(item, rect.x, rect.y, enabled) self.contents.draw_text(rect, sprintf(":%2d", number), 2) end end #-------------------------------------------------------------------------- # * Update Help Text #-------------------------------------------------------------------------- def update_help @help_window.set_object_text(item) endend#==============================================================================# ** Window_PartyCommand#------------------------------------------------------------------------------# This window is used to select whether to fight or escape on the battle# screen.#==============================================================================class Window_PartyCommand < Window_Command #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize s1 = Vocab::fight s2 = Vocab::escape super(544, 416) draw_item(0, true) draw_item(1, BattleManager.can_escape?) self.y = 292 self.x = 5 self.opacity = 0 self.visible = false self.active = false make_dummy_windows end #-------------------------------------------------------------------------- # * Dispose #-------------------------------------------------------------------------- def dispose super # Dispose dummy windows @dummy_windows.each {|window| window.dispose} end #-------------------------------------------------------------------------- # * Activate Command Window #-------------------------------------------------------------------------- def activate # Set Command Window Visibility to true self.visible = true # Set dummy windows to visible # @dummy_windows.each.visible = true # Set Window To active self.active = true end #-------------------------------------------------------------------------- # * De-Activate Command Window #-------------------------------------------------------------------------- def deactivate # Set Command Window Visibility to true self.visible = false # Set dummy windows to invisible # @dummy_windows.each.visible = false # Set Window To inactive self.active = false end #-------------------------------------------------------------------------- # * Get rectangle for displaying items # index : item number #-------------------------------------------------------------------------- def item_rect(index) rect = Rect.new(0, 0, 0, 0) rect.width = 245 rect.height = 24 rect.x = index % 2 * 265 rect.y = index / 2 * 49 return rect end #-------------------------------------------------------------------------- # * Draw Item # index : item number # enabled : enabled flag. When false, draw semi-transparently. #-------------------------------------------------------------------------- def draw_item(index, enabled = true) rect = item_rect(index) self.contents.clear_rect(rect) self.contents.font.color = normal_color self.contents.font.color.alpha = enabled ? 255 : 128 self.contents.draw_text(rect, @commands[index], 1) end #-------------------------------------------------------------------------- # * Create Background Dummy Windows #-------------------------------------------------------------------------- def make_dummy_windows # Dummy Windows Array @dummy_windows = [] for i in 0...2 x = self.x + 5 + i % 2 * 270 #265 y = self.y + 8 + i / 2 * 49 @dummy_windows << Window_Base.new(x, y, 255, 41) @dummy_windows.visible = true @dummy_windows.z = self.z - 10 end end #-------------------------------------------------------------------------- # * Update cursor #-------------------------------------------------------------------------- def update_cursor # Set Cursor Position self.cursor_rect.set((@index % 2 * 270), (@index / 2 * 49), 233, 25) endend#==============================================================================# ** Window_ActorCommand#------------------------------------------------------------------------------# This window is used to select actor commands, such as "Attack" or "Skill".#==============================================================================class Window_ActorCommand < Window_Command #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(540, 4) self.y = 243 self.x = 5 self.visible = false self.active = false self.opacity = 0 # Make Background Dummy Window make_dummy_windows end #-------------------------------------------------------------------------- # * Dispose #-------------------------------------------------------------------------- def dispose super # Dispose dummy windows @dummy_windows.each {|window| window.dispose } end #-------------------------------------------------------------------------- # * Get rectangle for displaying items # index : item number #-------------------------------------------------------------------------- def item_rect(index) rect = Rect.new(0, 0, 0, 0) rect.width = 245 rect.height = 24 rect.x = index % 2 * 270 rect.y = index / 2 * 49 return rect end #-------------------------------------------------------------------------- # * Draw Item # index : item number # enabled : enabled flag. When false, draw semi-transparently. #-------------------------------------------------------------------------- def draw_item(index, enabled = true) rect = item_rect(index) self.contents.clear_rect(rect) self.contents.font.color = normal_color self.contents.font.color.alpha = enabled ? 255 : 128 self.contents.draw_text(rect, command_name(index), 1) self.contents.draw_text(item_rect_for_text(index), command_name(index), alignment) end #-------------------------------------------------------------------------- # * Create Background Dummy Windows #-------------------------------------------------------------------------- def make_dummy_windows # Dummy Windows Array @dummy_windows = [] for i in 0...4 x = self.x + 5 + i % 2 * 270 y = self.y + 8 + i / 2 * 49 @dummy_windows << Window_Base.new(x, y, 255, 41) @dummy_windows.visible = true @dummy_windows.z = self.z - 10 end end #-------------------------------------------------------------------------- # * Activate Command Window #-------------------------------------------------------------------------- def activate # Set dummy windows to visible @dummy_windows.each {|window| window.visible = true } # Set Command Window Visibility to true self.visible = true # Set Window To active self.active = true end #-------------------------------------------------------------------------- # * De-Activate Command Window #-------------------------------------------------------------------------- def deactivate # Set dummy windows to invisible @dummy_windows.each {|window| window.visible = false } # Set Command Window Visibility to true self.visible = false # Set Window To inactive self.active = false end #-------------------------------------------------------------------------- # * Setup # actor : actor #-------------------------------------------------------------------------- def make_command_list return unless @actor add_attack_command add_skill_commands add_guard_command add_item_command end #-------------------------------------------------------------------------- # * Add Attack Command to List #-------------------------------------------------------------------------- def add_attack_command add_command(Vocab::attack, :attack, @actor.attack_usable?) end #-------------------------------------------------------------------------- # * Add Skill Command to List #-------------------------------------------------------------------------- def add_skill_commands @actor.added_skill_types.sort.each do |stype_id| name = $data_system.skill_types[stype_id] add_command(name, :skill, true, stype_id) end end #-------------------------------------------------------------------------- # * Add Guard Command to List #-------------------------------------------------------------------------- def add_guard_command add_command(Vocab::guard, :guard, @actor.guard_usable?) end #-------------------------------------------------------------------------- # * Add Item Command to List #-------------------------------------------------------------------------- def add_item_command add_command(Vocab::item, :item) end #-------------------------------------------------------------------------- # * Update cursor #-------------------------------------------------------------------------- def update_cursor # Set Cursor Position self.cursor_rect.set((@index % 2 * 270), (@index / 2 * 49), 233, 25) endend 

Here's the code in a code tag, and line numbers.

Oh, and I didn't test it, I just copied and formatted this (I have a button for formatting. I like that button. Yay buttons!)
I =begin , =end the original script you would have to un do the two lines and erase the break away scripts to generate it and if it still doesn't crash then on the lines 695 or 705 I think I commented out the error earlier when you said that's not what you suggested

Also if you saw the windows all over the place can you tell me why nothing is in them? If you wouldn't mind

Original thread: https://forums.rpgmakerweb.com/threads/dummy-window-question-from-a-dummy.17791/