Help - Search - Members - Calendar
Full Version: Window_Selectable_List request
RPG RPG Revolution Forums > Scripting > Script Development and Support > Script Requests
Tsukihime
EDIT: oops this should be in RGSS3 script request lol

I'm still pretty bad at coding windows, but see some "types" of windows that should exist as raw templates for others to use.

I would like the following window with at least the following class definition (or something like it)

Window_Selectable_List

CODE
class Window_Selectable_List < Window_Selectable

   def initialize
      ...
      @selected = [] #the items you have selected
      @data =[] #the options you have, generated from some other source
   end

   def required
      5 #Default required number of items before you can proceed
   end

   def max_slots
      5 #Default number of slots that should be drawn
   end

   def item?(index)
      @selected[index] != nil #check if it's not nil
   end

   #implement drawing like this or something
   def draw_all_items
      for i in 0 .. max_slots
         if item?(i)
            #draw the item
         else
            draw_text("---")
         end
      end
   end
end


This is an extension of a selectable window.
When you select an item, it should be added to a list of items you have selected.

The basic menu will contain at least two windows. The first window displays the list of items you can choose. The second window displays the items you have chosen.

Pressing "confirm" in the item_list_window will add the item to the selected_list
Pressing "cancel" in the item_list_window will remove the most recently added item from the selected_list

The selected_list_window will list the items you have selected.
When you press the OK button, that will pass the list to other logic processes.
When you select an item from the selected list, that item will be removed from the list (and the other items will be shifted up if necessary)

Define a max_slots attribute that will limit how many items can be selected. Once the max has been reached, the cursor will automatically go to "OK", for convenience.

If you try to select more items, it will not work and you get the buzzer sound effect.

Define a "required" attribute which will indicate how many items you *must* have in the list before you may proceed. The "OK" button will be grayed out if the requirement is not met, and will be white when you are able to confirm.

Example usage: you're enchanting a weapon, you might select up to 3 items: the base weapon, and maybe two enchantment items. You will then press OK to confirm your selection.

Here's a quick idea of how it will function



Also, provide a basic scene that will demonstrate this functionality.

You can adapt it from any existing script as long as it does not depend on anything except the default engine.
rewells
im also a coding noob and would like to see a script like this. I'll review my notes from the tutorial section and see what I can come up with


QUOTE (Tsukihime @ Apr 30 2012, 06:10 PM) *
EDIT: oops this should be in RGSS3 script request lol

I'm still pretty bad at coding windows, but see some "types" of windows that should exist as raw templates for others to use.

I would like the following window with at least the following class definition (or something like it)

Window_Selectable_List

CODE
class Window_Selectable_List < Window_Selectable

   def initialize
      ...
      @selected = [] #the items you have selected
      @data =[] #the options you have, generated from some other source
   end

   def required
      5 #Default required number of items before you can proceed
   end

   def max_slots
      5 #Default number of slots that should be drawn
   end

   def item?(index)
      @selected[index] != nil #check if it's not nil
   end

   #implement drawing like this or something
   def draw_all_items
      for i in 0 .. max_slots
         if item?(i)
            #draw the item
         else
            draw_text("---")
         end
      end
   end
end


This is an extension of a selectable window.
When you select an item, it should be added to a list of items you have selected.

The basic menu will contain at least two windows. The first window displays the list of items you can choose. The second window displays the items you have chosen.

Pressing "confirm" in the item_list_window will add the item to the selected_list
Pressing "cancel" in the item_list_window will remove the most recently added item from the selected_list

The selected_list_window will list the items you have selected.
When you press the OK button, that will pass the list to other logic processes.
When you select an item from the selected list, that item will be removed from the list (and the other items will be shifted up if necessary)

Define a max_slots attribute that will limit how many items can be selected. Once the max has been reached, the cursor will automatically go to "OK", for convenience.

If you try to select more items, it will not work and you get the buzzer sound effect.

Define a "required" attribute which will indicate how many items you *must* have in the list before you may proceed. The "OK" button will be grayed out if the requirement is not met, and will be white when you are able to confirm.

Example usage: you're enchanting a weapon, you might select up to 3 items: the base weapon, and maybe two enchantment items. You will then press OK to confirm your selection.

Here's a quick idea of how it will function



Also, provide a basic scene that will demonstrate this functionality.

You can adapt it from any existing script as long as it does not depend on anything except the default engine.

rewells
Hey, I haven't forgot about you - unfortunately I just don't know enough to do this. Can anyone else help?


QUOTE (rewells @ May 1 2012, 10:06 AM) *
im also a coding noob and would like to see a script like this. I'll review my notes from the tutorial section and see what I can come up with


QUOTE (Tsukihime @ Apr 30 2012, 06:10 PM) *
EDIT: oops this should be in RGSS3 script request lol

I'm still pretty bad at coding windows, but see some "types" of windows that should exist as raw templates for others to use.

I would like the following window with at least the following class definition (or something like it)

Window_Selectable_List

CODE
class Window_Selectable_List < Window_Selectable

   def initialize
      ...
      @selected = [] #the items you have selected
      @data =[] #the options you have, generated from some other source
   end

   def required
      5 #Default required number of items before you can proceed
   end

   def max_slots
      5 #Default number of slots that should be drawn
   end

   def item?(index)
      @selected[index] != nil #check if it's not nil
   end

   #implement drawing like this or something
   def draw_all_items
      for i in 0 .. max_slots
         if item?(i)
            #draw the item
         else
            draw_text("---")
         end
      end
   end
end


This is an extension of a selectable window.
When you select an item, it should be added to a list of items you have selected.

The basic menu will contain at least two windows. The first window displays the list of items you can choose. The second window displays the items you have chosen.

Pressing "confirm" in the item_list_window will add the item to the selected_list
Pressing "cancel" in the item_list_window will remove the most recently added item from the selected_list

The selected_list_window will list the items you have selected.
When you press the OK button, that will pass the list to other logic processes.
When you select an item from the selected list, that item will be removed from the list (and the other items will be shifted up if necessary)

Define a max_slots attribute that will limit how many items can be selected. Once the max has been reached, the cursor will automatically go to "OK", for convenience.

If you try to select more items, it will not work and you get the buzzer sound effect.

Define a "required" attribute which will indicate how many items you *must* have in the list before you may proceed. The "OK" button will be grayed out if the requirement is not met, and will be white when you are able to confirm.

Example usage: you're enchanting a weapon, you might select up to 3 items: the base weapon, and maybe two enchantment items. You will then press OK to confirm your selection.

Here's a quick idea of how it will function



Also, provide a basic scene that will demonstrate this functionality.

You can adapt it from any existing script as long as it does not depend on anything except the default engine.


rewells
Are you looking for something like this? It's similar to FFIX's equipment synthesis system.

[quote name='rewells' date='May 14 2012, 11:34 AM' post='559012']
Hey, I haven't forgot about you - unfortunately I just don't know enough to do this. Can anyone else help?

Jonnie19
Moved this to Script Requests for you. For future reference if you do post in the wrong section you can use the report button to let us know biggrin.gif and can move it for you
Tsukihime
I've written the window selectable list myself lol


http://www.rpgmakervxace.net/topic/3593-wi...electable-list/
rewells
The link is broken.

QUOTE (Tsukihime @ May 14 2012, 06:22 PM) *
I've written the window selectable list myself lol


http://www.rpgmakervxace.net/topic/3593-wi...electable-list/

Tsukihime
Really works fine for me.
rewells
Oh I think you need an account to view it.

QUOTE (Tsukihime @ May 16 2012, 05:10 PM) *
Really works fine for me.

Tsukihime
Interesting.

Anyways here's a direct link http://db.tt/4xmceWMd
rewells
Thanks. This is awesome!

QUOTE (Tsukihime @ May 16 2012, 11:14 PM) *
Interesting.

Anyways here's a direct link http://db.tt/4xmceWMd

Tsukihime
I just realized the design is flawed after trying to fix another script that used this thing.

Selectable_List should function as an actual selectable list, rather than just a regular list.
The window should store both a selected list of data, as well as the regular list of data.
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.