Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> 


———
Before you ask! Read! ;)

You must have 30+ Posts to create a topic here!

Thanks for reading!
———

> Window_Selectable_List request
Tsukihime
post Apr 30 2012, 02:10 PM
Post #1


Level 25
Group Icon

Group: Revolutionary
Posts: 562
Type: None
RM Skill: Undisclosed
Rev Points: 25




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.

This post has been edited by Tsukihime: Apr 30 2012, 02:34 PM


__________________________
My Scripts
Go to the top of the page
 
+Quote Post
   



Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 25th May 2013 - 07:43 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker