Placing items on platforms to be sold?

Discussion in 'RPG Maker VX Ace' started by Roseredpinball, Aug 15, 2019.

  1. Roseredpinball

    Roseredpinball Veteran Veteran

    Messages:
    75
    Likes Received:
    15
    First Language:
    English
    Primarily Uses:
    RMVXA
    Hello all, I'm looking to make a game where you can sell things by placing them from your inventory on platforms. Only problem is, I'm not sure how to go about this. I was thinking I could do a select key item sort of thing but that would take forever if I were to include all the possible items you can have in your inventory. Besides that, I want the player to have to restock items so I can't make them all key items. Does anybody have any other suggestions about how to go about this? Are there any scripts that might help here? Thanks!
     
    #1
  2. Uzuki

    Uzuki Kawaii on the streets, Senpai in the sheets Veteran

    Messages:
    1,831
    Likes Received:
    1,252
    Location:
    Georgia
    First Language:
    English
    Primarily Uses:
    RMMV
    For the selecting items without making them select key items, you should use this script. Now as for the item restocking how exactly are you trying to go about that?
     
    #2
  3. Shaz

    Shaz Veteran Veteran

    Messages:
    37,718
    Likes Received:
    11,429
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    What does the need to restock have to do with making them key items or not?
     
    #3
  4. Roseredpinball

    Roseredpinball Veteran Veteran

    Messages:
    75
    Likes Received:
    15
    First Language:
    English
    Primarily Uses:
    RMVXA
    Thanks, that's very helpful! As for restocking, I was thinking that the player could place an item on the pedestal and as long as they have that item in their inventory it'll stay on the pedestal. For example, say the player places a tomato on the pedestal, and they have 10 tomatoes. A customer comes in and buys 1 tomato. Now the player has 9 tomatoes, and the tomato remains on the pedestal. After awhile, all the tomatoes are sold. Now the tomato no longer appears on the pedestal. Does that make sense? I sure hope so. Thanks again!

    I thought key items couldn't be consumed meaning the player would have an infinite stock of tomatoes or whatever other item which would defeat the purpose of having to restock. I was wrong.
     
    Last edited by a moderator: Aug 16, 2019
    #4
  5. Uzuki

    Uzuki Kawaii on the streets, Senpai in the sheets Veteran

    Messages:
    1,831
    Likes Received:
    1,252
    Location:
    Georgia
    First Language:
    English
    Primarily Uses:
    RMMV
    You can't double post on here. You can use the edit button next time to respond to multiple people make changes.

    That sounds like it'll put a lot of strain on the engine seeing as the only way that I can see this working is with a parallel common event running in the background and depending on how many items and variables that it'll have to check that can really slow your game down. Why not have it so that the player can choose the amount to place on the platform using a variable and then the NPC just "takes" one item from that variable. Also, how are you going to have NPCs take items from the platforms? Will all this take place in one map or will all this happen when the player isn't in the room?
     
    #5
  6. Shaz

    Shaz Veteran Veteran

    Messages:
    37,718
    Likes Received:
    11,429
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    How does "a customer come in and buy 1 tomato"? Do you have some event that controls when this happens? Or do you want to set it up so it's timed - as long as there is at least one tomato for sale, a customer will come in every 5 minutes and buy one, until there are none left?

    If the items are to be removed from your inventory when you place them, then you would need a variable for each item, saying how many are available to be sold. Then you will need something to reduce that variable according to whatever rules you use. This could be as easy as a parallel process common event that's set to Wait 5 minutes, then subtract 1 from all of the variables, not going below 0. Your events simply need to have 2 pages - one with no conditions, where you can place the items (use a different variable to determine how many you have in inventory, remove them from inventory, then add that number to the variable for that specific item), and a second page with the image for that item, with the condition 'variable >= 1' and the same commands (so you can top up and don't have to wait for them all to be sold before placing more).


    Making it a key item has nothing to do with being able to consume it. You just change the usage to none, so it can't be used from the menu OR in battle. And if you also don't want the player to be able to sell it at a shop, set the price to 0. This makes the assumption that they're also not buying it from a shop, but you're giving it to them by other means.
     
    #6
    Roseredpinball likes this.
  7. Roseredpinball

    Roseredpinball Veteran Veteran

    Messages:
    75
    Likes Received:
    15
    First Language:
    English
    Primarily Uses:
    RMVXA
    Ah, apologies. That's a good idea, I may just do that. I was planning on having it take place on one map. My vision is similar to that of Recettear or Hometown Story. By the way, do you happen to know how that script you linked me to works? I tried following the instructions but I'm afraid they're just too vague and poorly written for me to follow. By "poorly written" I mean no offense to the creator of the script, it's just that their english isn't the best, sorry.
     
    #7
  8. Uzuki

    Uzuki Kawaii on the streets, Senpai in the sheets Veteran

    Messages:
    1,831
    Likes Received:
    1,252
    Location:
    Georgia
    First Language:
    English
    Primarily Uses:
    RMMV
    If you're not using key items at all in your game, then scroll down to the KEYITEM_CATEGORY section and change "0 => ["&",[[:key_item, true]]]," to "0 => ["&",[[:item, true]]],".
     
    #8
  9. Heirukichi

    Heirukichi Veteran Veteran

    Messages:
    1,235
    Likes Received:
    492
    Location:
    Italy
    First Language:
    Italian
    Primarily Uses:
    RMVXA
    I think that an elegant solution to customers buying things and having them disappear if the player no longer has them in the inventory would simply be checking the player inventory every time a customer buys something. There is no need to run a parallel process if the whole thing is part of the very same act of buying.

    Buy -> Check Quantity -> Remove Item if it was the last one

    However, what Shaz said makes sense. How do customers buy items? Because decreasing the amount of items in the player inventory when placing them on the pedestal is already reducing the number of copies in the inventory. By logic, when the player has no more copies of a certain item, the one on the pedestal should still be available for purchase. Of course, if your purpose is not that of decreasing them when the player places them there, everything is fine. But in that case what is the point of having the player restock the item?

    Almost everything comes down to how you want the customers to buy those items and how you want the player to be able to restock them. It is possible to simply check them in the inventory, but then the player will not restock them at all, and it is possible to make them so that the player can restock them, but then there is no point in checking the player inventory. Just grab pen and paper and draw a flowchart of how you want this to work, everything else depends on that.
     
    #9
  10. Shaz

    Shaz Veteran Veteran

    Messages:
    37,718
    Likes Received:
    11,429
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    If you "place" the items but don't remove them from inventory, it's even easier. One of the conditions on an event page is "Item X in Inventory". This just means you can do the same as I said above, but not need to use variables. Mmm ... that would also remove the need to "place" it.

    Perhaps you can describe the mechanic more? How does the player get the items? Do you want it to appear on the counter when the player has it, or does the player specifically need to put it there? When the player puts it there, do they put ALL of the item, or do they get to choose a lower number? Does that get removed from their inventory at the time? If the player gets more of the item, does it get placed automatically or does it go into inventory? What controls the customers coming and buying? Do they buy at regular intervals? Do they only buy 1 item? How do you determine which item they buy? Does the player actually see the customer come and buy, or is it all done behind the scenes, and at some point the items on the counter are magically depleted without the player ever having to see anything?

    Do you have any parts of this working already, or partially working, and how have you done it?
     
    #10
  11. Roseredpinball

    Roseredpinball Veteran Veteran

    Messages:
    75
    Likes Received:
    15
    First Language:
    English
    Primarily Uses:
    RMVXA
    Ah, thank you. Thanks to everybody for all your help. I think I've resolved things for now. I found a workaround albeit it may take a lot longer to implement. Instead of using the script I've decided to have a conditional branch for each possible item the player may place on the pedestal. As for the rest of your questions, I'm afraid I haven't thought too deeply about all this. I'll have to think harder about it. I like Uzuki's idea of having the player place a certain number of the item on the pedestal and having the npcs take from there.
     
    #11
    Uzuki likes this.

Share This Page