Grouping items in shop

Discussion in 'Learning Ruby and RGSSx' started by Yuuta Kirishima, Jan 31, 2017.

  1. Yuuta Kirishima

    Yuuta Kirishima Software Engineer/Professional Mayonnaise Player Veteran

    Messages:
    548
    Likes Received:
    131
    Location:
    North Carolina
    First Language:
    Engilsh
    Primarily Uses:
    RMMV
    Let's say i have multiple items in a shop processing scene like so,

    [​IMG]



    Does anyone know of a method to group them together so instead of four potions it only shows one of them even though there are 4 in the shop?
     
    #1
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    It only shows one line by default.  Whatever script you're using must be designed to show them individually.  Either ditch the script, see if there are customisation options so it doesn't split them, or post a link to the script so someone can have a look and fix it.
     
    #2
  3. Yuuta Kirishima

    Yuuta Kirishima Software Engineer/Professional Mayonnaise Player Veteran

    Messages:
    548
    Likes Received:
    131
    Location:
    North Carolina
    First Language:
    Engilsh
    Primarily Uses:
    RMMV
    @Shaz I don't have any shop scripts, in case you're not understanding, I purposely added 4 or the same item in the shop processing event command like this,

    [​IMG]

    basically, because items are added to the shop processing dynamically, some of the same items might be added to shop processing, is there a way to group them together?
     
    #3
  4. Shaz

    Shaz Veteran Veteran

    Messages:
    37,184
    Likes Received:
    11,053
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    oh ... why would you do that?  If you add Potion to the shop, the player can buy up to 99 of them.  You don't add it 4 times to limit the player to only buying 4 - unless you have a script.


    What do you mean "added to the shop processing dynamically"?  The screenshot above isn't adding items dynamically - you're being very specific about what goes in there.  If you are adding them via another method (that's really dynamic), we'd probably need to see it to be able to help you.  If you're using some sort of script calls to add items, then you would be able to first do a search to see if the item exists in the list, and only add it if it's not already there.
     
    Last edited by a moderator: Jan 31, 2017
    #4
  5. Yuuta Kirishima

    Yuuta Kirishima Software Engineer/Professional Mayonnaise Player Veteran

    Messages:
    548
    Likes Received:
    131
    Location:
    North Carolina
    First Language:
    Engilsh
    Primarily Uses:
    RMMV
    I did that as an example, to show you how they're ungrouped, and i will try writing something using your suggestion.
     
    #5

Share This Page