Display "Current / Max" Item Count on Item screen.

● ARCHIVED · READ-ONLY
Started by Blue001 4 posts View original ↗
  1. Hello forum.

    While normally it is used to increase item limits pas 99, I am using "Yanfly Engine Ace - Adjust Limits v1.00" in an interesting way. I am using it to limit the use of every item carried on a per item basis down to lower numbers.

    So my party can only carry 10 potions, and 5 Hi-potions. etc.

    However, I do not want to have to manually list the maximum number you can carry of these items in the HELP text, as that box is already limited on space as it is.

    Is there a way to change the text listing of an item... which currently look like this in the item list...

    ___________

    potion        x5
     

    to instead display 
    ____________
    potion        5/5

    where the first number is current count and the second is the max imposed by Yanflys limit notetag?

    I found where the text is drawn by the base Window_ItemList...

      #--------------------------------------------------------------------------

      # * Draw Number of Items

      #--------------------------------------------------------------------------

      def draw_item_number(rect, item)

        draw_text(rect, sprintf(":%2d", $game_party.item_number(item)), 2)

      end

     

     

    What do I have to write in a script to override the default and add the /max info?

     

     

    Thanks!
  2. I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.

    add this to a new script slot below Yanfly's script:

    Code:
    class Window_ItemList < Window_Selectable    #--------------------------------------------------------------------------  # overwrite method: draw_item_number  #--------------------------------------------------------------------------  def draw_item_number(rect, item)    contents.font.size = YEA::LIMIT::ITEM_FONT    quantity = $game_party.item_number(item).group    text = sprintf("%d/%d", quantity, item.max_limit)    draw_text(rect, text, 2)    reset_font_settings  end  end # Window_ItemList
  3. Sorry about miss-placed thread. Could have sworn that's where I was...

    (Oh wait, I see, you don't go to the forum for the game maker system you are using, instead the generalized forum for script help... sorry XD)

    And thanks for the answer!
  4. We have forums for each engine for non-script support, plus a huge forum JUST for scripts (to share, to request, to get help with). Scripting is a huge beast, and the sheer number of scripts available and requested for each engine would make it very difficult to keep the support forums organized, and for people who just want help with simple tasks to get their threads viewed and find them again. So yes, they're separate. If you need help with anything to do with scripts, it goes into the appropriate Scripts forum, not in the Support forum for that engine ;)


    This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.