[TWings] Trade Shop (Suikoden-like)

Discussion in 'JS Plugin Releases (RMMV)' started by TWings, Jun 29, 2019.

    Tags:
  1. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    362
    Likes Received:
    633
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    That's because the demo isn't 100% optimized for limited inventory (since I added the feature over what was already there).
    What's happening basically is that I'm adding a lot of items to the party in the initialization event (regardless of any limitation). The result you get there is because the plugin actually takes into account only "trade items" (meaning items used in Trade Shops), while I'm creating the shops only when the player talks to the shop PNJ for the first time. So while some shops aren't yet created, some items aren't considered as trade items.
    There are actually 2 ways arround that :
    1 - Create all the shops from the start (but it also means, produced items might pile up too early in the game).
    2 - First create a dummy Trade Shop (not accessible by the player) with all the trade items.
     
    #21
  2. Kenchee

    Kenchee Villager Member

    Messages:
    18
    Likes Received:
    3
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks for clarifying.
    I'll create a dummy shop and all the shops from the start.
     
    Last edited: Sep 13, 2019
    #22
  3. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    362
    Likes Received:
    633
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    I meant one or the other (depending on what's needed). There's no need to do both. :LZSwink:
     
    #23
  4. Kenchee

    Kenchee Villager Member

    Messages:
    18
    Likes Received:
    3
    First Language:
    English
    Primarily Uses:
    RMMV
    TWings. Just to check if there's a limit to the number of shops I can have.
    (So far I have 73 'Buy' and 73 'Sell', about 147 including a dummy. Might have a few more extras...)

    Just to let you know. Somehow I managed to get 0.25G, 0.5G and 0.75G after selling goods repeatedly.
    I don't really mind the decimals... just that it's the first time I see decimals ingame for currency...

    This is the buying shop Plugin command: addTSItem 1 8 90 90 15 15 20 1
    This is the selling shop Plugin command: addTSItem 76 8 1 90 74 74 100 9
     

    Attached Files:

    Last edited: Sep 14, 2019
    #24
  5. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    362
    Likes Received:
    633
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    There's no limit, but you shouldn't get decimals.
    Can you also show me the shop event, and the plugin's parameters ?
     
    #25
  6. Kenchee

    Kenchee Villager Member

    Messages:
    18
    Likes Received:
    3
    First Language:
    English
    Primarily Uses:
    RMMV
    Here are the screenshots of the game, shop event and plugin parameters.
    I did use Yanfly's core engine to change the gold and item max, but when I turned it off the decimals were still there, so I guess it's not caused by Yanfly's plugin.
    Interestingly, if I multiplied the price by 100, the decimals don't appear.
    I guess maybe rpgmaker mv have to use Yen instead of Dollar?
     

    Attached Files:

    #26
  7. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    362
    Likes Received:
    633
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    I may have found the problem.
    When adding new products, I default initialize the selling price to 75% of the buying price without rounding it.
    I'll fix that in the next update.
     
    #27
    Kenchee likes this.
  8. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    362
    Likes Received:
    633
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    The new update is finally here with some minor improvements.
    Hopefully, this time I took care of most of the bugs.

    Version 1.30 :
    • Display of item's max stock.
    • Timer option is now also available for item removal.
    • Customizable selling price min/max percentage.
    • In some cases, prices could become decimal.
    • It was possible to sell more items than the shop's max stock quantity.
     
    #28
    Kenchee likes this.
  9. Kenchee

    Kenchee Villager Member

    Messages:
    18
    Likes Received:
    3
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks TWings!

    Can you clarify the part on item removal? Is it the total removal of the item from the shop? Or is it decrease of shop stock?

    addTSItem [shop number] [item id] ([inital stock] [max stock] [sell price] [min buy price] [max buy price] [timer])

    The timer indicated above is for stock increase or decrease?
    Is it dependent on whether if my shop is a 'buy' only or 'sell' only?

    I would like my 'buy' shop stock to increase over time so I can buy more,
    while my 'sell' shop stock decrease over time so I can sell more.

    Thanks.
     
    Last edited: Sep 22, 2019
    #29
  10. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    362
    Likes Received:
    633
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    By removal, I mean stock decrease. Since the timer was only working for stock increase in the previous version.

    it's used for both increase and decrease depending if the items is "produced" or not by the shop.
    Produced items are defined when you first create the Shop (command : addTradeShop x [item id]*). Items not defined here decrease over time.
     
    #30
    Kenchee likes this.
  11. ShadowHawkDragon

    ShadowHawkDragon Veteran Veteran

    Messages:
    471
    Likes Received:
    841
    First Language:
    English
    So just been trying this out and seems cool so far.

    Just wondering if instead of a shop either producing an item or not, if there's any plans to allow shops to 'normalise' their stock?
    What I mean is, shop 1 will increase its stock of item 1 up to 5 but when over 5 will instead decrease it, things like that.
    Also it'd be cool if we could manually trigger sudden price rises/drops or manually increase/decrease the stock.

    Just some suggestions ;)
     
    #31
  12. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    362
    Likes Received:
    633
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    Manually changing the stocks would be simple enough to add (it's technically already possible using scripts).
    Changing the prices within the limitation of the max and min price is also pretty doable.
    Allowing to go over the max stock quantity however could mess with the price (I corrected that bug in the last update), so I'm not sure about that one.
     
    #32
    ShadowHawkDragon likes this.
  13. ShadowHawkDragon

    ShadowHawkDragon Veteran Veteran

    Messages:
    471
    Likes Received:
    841
    First Language:
    English
    Thanks for considering these suggestions.


    In regards to the last one I was referring to it reverting the stock (and maybe price) to the 'starting values' more than exceeding the maximum.

    So you'd have a shop which starts with 7 potions and has a max of 10.
    If you then buy two it'll increase the potion count over the next couple of stock updates, reverting to the starting price upon reaching the starting value of 7. Whereas if you sold 3 potions pushing the stock to max it would then slowly reduce the amount with each stock update until reaching 7 again (and again maybe reset the price).

    Think of it as only producing when there's demand and keeping room to buy spares then selling those spares to other merchants/locals while you are off exploring.


    But if it can't be done no worries.
     
    #33
  14. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    362
    Likes Received:
    633
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    Version 1.40 available !
    Including new plugin commands to have yet a bit more control over the shops, various optimisations, and a nasty bug removed.
    • New Stock increase/decrease plugin commands.
    • New Set selling price plugin command.
    • Memory usage optimisation.
    • More detailed and organised plugin description.
    • In some cases, prices could still get stucked to limit values.
     
    #34
    ShadowHawkDragon likes this.
  15. Diz89

    Diz89 Warper Member

    Messages:
    4
    Likes Received:
    0
    First Language:
    German
    Primarily Uses:
    RMMV
    Hey there,

    First: Thank you for making and sharing this nice Plugin.

    I'm still experimenting with the parameter a bit, but I wonderd, if it's possible to increasing the price while buying, not decreasing like your default setup. Is this possible? If so, which paramters and where could I set the formula to f.e. increase the price for every brought item to 5% more?

    So for the first Item 1 I have to pay 100, the stocks decreases so the shop decides to increase the price (as the item is worth more), so the next item I buy costs 105 and so on?

    Sorry for any errors language-wise. English isn't my first language :)

    But again: Thx for making this plugin and also the nice updates :)
     
    #35
  16. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    362
    Likes Received:
    633
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    Yeah, as it is, the price doesn't decrease unless the stock reaches 0.
    You probably can't change that with the current setting, but I could look into it and tweak the formula to at least make a temporary increase when buying.
     
    #36
  17. Diz89

    Diz89 Warper Member

    Messages:
    4
    Likes Received:
    0
    First Language:
    German
    Primarily Uses:
    RMMV
    Thx for replying this fast :)

    Another quick question: Is it possible to disable alle the timers completly? I wanted to include the stock-changing dynamically with the day/night-System I'm using (some days, the stock might increase by a lot, some day not at all)
     
    #37
  18. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    362
    Likes Received:
    633
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    Well the key to update the shops is the "updateTShops" command.
    If you don't need the item specific timer, you can let the default to 1.
    Then, if you want to manually control the shop updates, you'll probably want to set the Shops refresh timer to 0 so that each time you call "updateTShops", it actually updates the shops. However to prevent people from messing too much with the timer, the minimum is set to 60, so you'll need to force it to 0 in the text tab of the parameter (that's something I haven't tried, but I believe it should work).
     
    #38
  19. Diz89

    Diz89 Warper Member

    Messages:
    4
    Likes Received:
    0
    First Language:
    German
    Primarily Uses:
    RMMV
    Isn't it also possible to just make a shop withe the tradeshop and just using other items and then working with the "incTSStock"-command to update the Items I want at the Moment I want? or do I have to add the "producing items" to the created shop?

    Also: the updateTShops updates all Shops or am I wrong? I want this to work for just specific TShops I create (so the Inc/Dec-commands might be the way to go for me, if I can abuse them this way :3)

    Also: thx again for clarifying and giving pointer how you intended to use this Plugin :)
     
    #39
  20. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    362
    Likes Received:
    633
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    Indeed, I didn't think about it since those commands are a pretty recent addition, but I guess you could just not use "updateTShops" at all and manage the stocks independently with the increase/decrease stock commands.

    EDIT : If you do that the timers don't matter anyway, whatever their value.
     
    #40

Share This Page