It's kind of hard to read without the default indenting, but I can see at least two potential problems - the first is: when and where do you call the refresh method of Window_5? The only place I see is the initialize method. Maybe you aren't sharing the whole code, but you will need to call the refresh method somewhere - maybe right before making it visible and active. In order to work, it needs to run.
Secondly you are saving the ID of the actor into $windex, not his or her party index. Yet, in the refresh method you are going through $game_party.actors. That won't do. In order for it to work, you need to either replace:
$windex = $game_party.actors[@window_4.index].id
with:
$windex = @window_4.index
OR replace:
actor = $win4_actor == false ? $game_party.actors[0] : $game_party.actors[$windex]
with:
actor = $win4_actor == false ? $game_party.actors[0] : $game_actors[$windex]
Just for the record, I don't like the way you are using global variables (like $win4_actor and $windex) - it's very difficult to track what values are likely to be in them and it seems like you are just using them to avoid passing any arguments. As a simple little guide:
http://c2.com/cgi/wiki?GlobalVariablesAreBadIt would be far easier to follow if, instead of using global variables here there and everywhere, you just did something like this:
def refresh (party_index = 0)
#this is the broken section... I think
actor = $game_party.actors[party_index]
@actor = actor
@data = []
for i in 0...@actor.skills.size #how many skills does actor have?
skill = $data_skills[@actor.skills[i]]
if skill != nil #if skill doesn't exist
@data.push(skill) #skip to next skill
end
end
# If item count is not 0, make a bit map and draw all items
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
and, in the first part, did this:
if Input.trigger?(Input::C)
if @window_4.active == true
#load actor # into game actor slot
@window_4.visible = false
@window_4.active = false
@window_5.refresh (@window_4.index)
@window_5.visible = true
@window_5.active = true
end
end
Global variables make code confusing, difficult to debug, and make it hard to know when or where they are being updated. They should be used sparingly, if at all.