Help - Search - Members - Calendar
Full Version: [VX]Window Selectable issues
RPG RPG Revolution Forums > Scripting > Script Development and Support > RGSS2
DUFUTA
THE SCRIPT
CODE
class Window_States < Window_Selectable
  
  def initialize
    super(140, 120, 400, 300)
    @actor = $game_party.members[0]
    @column_max = 8
    self.index = 0
    refresh
  end
  
  #Getting States
  def active_states
    @active_states = []
    for active_state in @actor.states
      @active_states.push(active_state)
    end
  end
  
  #Drawing Active State
  def draw_active_state
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    state = @active_states[index]
    draw_actor_state(@actor, rect.x, rect.y )
  end
  
      
      
  #Refresh
  def refresh
    active_states
    @item_max = @active_states.size
    for i in 0...@item_max
      draw_active_state[i]
    end
  end
end


I'm trying to make a scene in my project wherein one is able to view the current states they're under and can select each one, bringing them up in a 'details' window which tells the cure for the state, how long the state lasts, etc. I can make the 'details' window just fine. But I am pulling my hair out trying to figure out exactly how to implement the above window_selectable to work.

I've read this topic here countless times:

THIS PAGE

I've also read through the countless window_selectables in the default scripts.

And though I get the properties of the window just fine, I can't figure out exactly how to implement it. I get the states icons drawn, but for some reason the cursor just will not move. So, I was wondering if maybe someone could help me along, maybe draw out some kind of sample as to how they should be laid out.

I use this line in the scene to set the window as active:
CODE
@window_states.active = true


I watched a few GubiD tutorials for that information. And still, I'm stuck. I want to be able to make selectable windows cause there are a few more I'll be attempting. I started on this one, because it seemed these easiest of my ideas.

So yeah, How?

There's another thing to:

Is there anyway to remove the little value on the given states? I just need the icons.

Any help would be greatly appreciated.
diamondandplatinum3
Sounds like you're looking to use a command window.

Look up how to do command windows and you should be getting that script working just fine wink.gif
DUFUTA
Well, diamond and platinum. Correct me if I'm wrong, but the window_command is more or less a list. Whereas this particular script will display more like a the window_item default script. Where as I want there to be rows and columns. That's why I chose selectable. I've got this little program which spawns window_selectables and I've used it before, but it creates more of the command-ish kind. And I don't really want to use it because I've been advancing my scripting knowledge like crazy lately. I've gotten pretty good at scenes and base windows. These darn Selectables are a killer though.

Anyway, thanks for the encouragement. I'll look over the command window again, but I really believe selectable is the way to go here.

If you can tell me 'why' you think command is better, I'm willing to hear you out and consider it.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.