[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:
    347
    Likes Received:
    610
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    Plugin
    TWings_Trade v1.40

    Author
    TWings

    Introduction / Features
    This plugin is part of a Suikoden features plugins series and works similarly to the Trade Shops (although there's still room for some improvements).
    For those not familiar with it, it's an alternative kind of shops (doesn't replace the standard shops) that works like financial markets.

    So what does this plugins do exactly ?
    It allows you to create special shops that buy and sell only specific items.
    Every shop have limited items stocks, and the value of those items changes according to those stocks.
    Every shop can also refill ("produce") at least one item on its own, while the other items will eventually "vanish" from the stocks.

    TradeShop.png

    How to use
    While I tried to make it easy, this plugin is pretty advanced and I strongly advise to have a look at the demo to understand better how to use it properly.
    Be sure to carefully choose what variable you want the plugin to use and never overwrite that variable in your events.
    You will need to use the plugin commands to create your shops and define their stocks of items. After this step your shops will be useable, but to activate the auto-update property of the shops (stocks and prices variations), you will need to use the "updateTShops" command in a parallel common event (don't forget to turn ON the switch of this event).

    Demo
    There's a demo project available to download on my itch.io page showing a possible use of this plugin.

    FAQ
    You can use this thread or drop on my Discord server for questions.

    Terms of use
    Credit : TWings
    Free to use for non-commercial games.
    Contact me for commercial games.

    Versions
    • Version 1.40 :
      • 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.
    • 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.
    • Version 1.20 :
      • New Limited Inventory option.
      • New Item production timer option.
      • Customizable "stock" text.
      • In some cases it was possible to buy more items than the player's limit.
      • The shops could produce more items than the default max quantity.
      • The shops produced items prices were constantly droping even with 0 stock.
      • The prices variation could be frozen when reaching max or min value.
      • There was an error in the buying price formula.
      • Items customized min and max buying price values weren't correctly saved.
      • Loading a save file could fail if shops weren't in numerical order.
    • Version 1.10 :
      • New Buy/Sell only option.
      • New advanced parameters to customize the prices update formula.
      • Sell window redesigned to look like Buy window.
      • The plugin was crashing if shops weren't created in numerical order.
    • Version 1.00 :
      • Release.
     

    Attached Files:

    Last edited: Oct 6, 2019
    #1
  2. Tea's Jams

    Tea's Jams I'm human Veteran

    Messages:
    765
    Likes Received:
    1,917
    First Language:
    English
    Primarily Uses:
    RMMV
    I can't help but wonder if you're planning on doing battle system plugins. I can't think of a better battle system in a jrpg, it's has to be the best, imo.
     
    #2
    Jeremiah Eastman likes this.
  3. Neo Soul Gamer

    Neo Soul Gamer Veteran Veteran

    Messages:
    612
    Likes Received:
    329
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    N/A
    *Yoink!*

    I'll be taking that, thank you. Nice to have this with its own scene instead of eventing it.
     
    #3
    Jeremiah Eastman and TWings like this.
  4. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    347
    Likes Received:
    610
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    I've started working on a Star Ocean-like battle system a while ago. That will likely take me a long time since I have to rewrite pretty much the whole RM battle system, and it's low on my priority list (more like a very long term hobby project).
    A Suikoden-like battle system seems "easier" to do, however I wonder if it's not already achievable using some available plugins.
     
    #4
  5. Tea's Jams

    Tea's Jams I'm human Veteran

    Messages:
    765
    Likes Received:
    1,917
    First Language:
    English
    Primarily Uses:
    RMMV
    Maybe, I haven't kept up on the latest plugins for awhile, until recently. :biggrin:
     
    #5
    Jeremiah Eastman likes this.
  6. Kenchee

    Kenchee Villager Member

    Messages:
    16
    Likes Received:
    3
    First Language:
    English
    Primarily Uses:
    RMMV
    Hi TWings.

    I love your Trade plugin and have some ideas on planning to use it to make a trading game like uncharted waters. But I have encountered some issues and would like your help.

    1) I noticed that if we sell one item at a time, the price gets lower and lower, which is a nice feature. But at the same time, if we were to buy the same item repeatedly, one at a time, the price also gets cheaper and cheaper, which is kind of weird. Can you advise how we can fix the formula so the price does not decrease/change when we buy?

    2) I'll like to ask if it's possible for the 'SELL' screen to show the same screen as the 'BUY' screen. i.e without the 'Trade goods' category but instead showing the 'Price', 'Possession' and 'Stock' just like the 'BUY' screen. If we can have the option of inserting some text/icons etc into the empty space on top will be a big bonus.

    3) FYI, I realised that if we put // into [ this.addCommand(TextManager.sell, 'sell'); ], to become [/ this.addCommand(TextManager.sell, 'sell');/ ], we can make it into a BUY only shop (or sell only).
    So I did a test and duplicated your script, replacing 'TWShop' to 'SWShap' for example and inserted it as a new plugin and it worked as well, side by side the original, just to let you know. So now I can have dedicated BUY and SELL only shops. (I do not know if I've messed up anything else by doing this...)

    Also, it will be nice if you can release duplicates of the scripts as different plugins, as this will greatly expand the possibilities of trading.

    And thanks again for the plugin! :)
     

    Attached Files:

    #6
    TWings likes this.
  7. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    347
    Likes Received:
    610
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    The idea is that as long as the shop has an item in stock the price gets lower, however it should evolve more or less considering the quantity. When an item stock is empty the price starts to get higher again.
    Athough I'm considering enabling more customisation on the maths formula computing the prices.

    It sure isn't impossible. It's just a bit more work. I believe I created it using the basic shop as a template. I'd need to rwrite parts of it to make it that way.
    That's actually the item's description in the database. Put a description there and you'll see it in the shop. :LZSwink:


    I can't guarantee that it won't cause any problem. What I can do is add the option to choose within the plugin with a new parameter.
     
    #7
    Kenchee likes this.
  8. Kenchee

    Kenchee Villager Member

    Messages:
    16
    Likes Received:
    3
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks for the swift reply TWings.
    I'll be looking forward for any updates to the script. Cheers!
     
    #8
  9. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    347
    Likes Received:
    610
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    Here we go ! Version 1.10 is live with some shiny new features :
    • New Buy/Sell only option.
    • New advanced parameters to customize the prices update formula.
    • Sell window redesigned to look like Buy window.
    • The plugin was crashing if shops weren't created in numerical order.
     
    Last edited: Aug 24, 2019
    #9
    Kenchee likes this.
  10. Kenchee

    Kenchee Villager Member

    Messages:
    16
    Likes Received:
    3
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks Twings!
     
    #10
  11. Kenchee

    Kenchee Villager Member

    Messages:
    16
    Likes Received:
    3
    First Language:
    English
    Primarily Uses:
    RMMV
    Hi Twings, by the way, does your plugin happen to work with any limited inventory plugins?
     
    #11
  12. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    347
    Likes Received:
    610
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    It depends how those plugins work... If they just overwrite $gameParty.maxItems(), then it should work.

    One exception though, I catched another bug when checking it. As it is, you can't buy more items if you already have reach the limit, however you can buy as much as you want if you're under the limit...
    I will release a small update soon to fix that.

    EDIT : If you're talking about limited number of different items, I have no idea. I guess you'll have to try.
     
    Last edited: Aug 25, 2019
    #12
  13. Kenchee

    Kenchee Villager Member

    Messages:
    16
    Likes Received:
    3
    First Language:
    English
    Primarily Uses:
    RMMV
    Unfortunately, most plugins uses the default shop, so their plugins doesn't really work with yours.
    Anyways, I have decided to use variables to limit my inventory.
    So that if my current inventory exceeds my allowed limit, I will use conditional branch close the "Buy shop".

    Is it possible to insert some custom text and variables into the shop menu under "Possession" or "Stock"?
    i.e. (Custom text) [(variable 2 is current total inventory / (variable 3 is maximum limit of inventory allowed)]
    so we see something like the one in the picture?
     

    Attached Files:

    #13
  14. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    347
    Likes Received:
    610
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    What kind of limit are we talking about ?
    Amount of the same item ? Amount of different items ? Both ?
    The first case should already be handled, but the other two require two different solutions.
     
    #14
  15. Kenchee

    Kenchee Villager Member

    Messages:
    16
    Likes Received:
    3
    First Language:
    English
    Primarily Uses:
    RMMV
    I am talking about the total summation of different items.
    E.g. 10 potions + 10 magic water = 20 cargo spaces.
    The screenshot should clarify things a bit.
     

    Attached Files:

    #15
  16. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    347
    Likes Received:
    610
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    I'm currently working on an update :
    tsv1.2.png tsv1.2params.png
    Doing so I've also identified a number of bugs that are beeing taken care of.
     
    #16
  17. TWings

    TWings The Dragon Whisperer Veteran

    Messages:
    347
    Likes Received:
    610
    Location:
    Kyoto
    First Language:
    French
    Primarily Uses:
    RMMV
    New version available !
    It ended up beeing a biggest update than I had anticipated.
    Version 1.20 :
    • New Limited Inventory option.
    • New Item production timer option.
    • Customizable "stock" text.
    • In some cases it was possible to buy more items than the player's limit.
    • The shops could produce more items than the default max quantity.
    • The shops produced items prices were constantly droping even with 0 stock.
    • The prices variation could be frozen when reaching max or min value.
    • There was an error in the buying price formula.
    • Items customized min and max buying price values weren't correctly saved.
    • Loading a save file could fail if shops weren't in numerical order.
     
    #17
    Kenchee likes this.
  18. Kenchee

    Kenchee Villager Member

    Messages:
    16
    Likes Received:
    3
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks TWings! :D
     
    #18
  19. Finnuval

    Finnuval World (his)story builder and barrel of ideas Veteran

    Messages:
    1,261
    Likes Received:
    3,707
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    Okay this is pretty cool and useful. Thanks TWings!
     
    #19
  20. Kenchee

    Kenchee Villager Member

    Messages:
    16
    Likes Received:
    3
    First Language:
    English
    Primarily Uses:
    RMMV
    Hi TWings.
    I tried out your demo and found that if I walk around and talked to the 3 shopkeepers without buying anything,
    my inventory will jump from 47/50 to 72/50.
    I think it did not take into account the 5 Potions, 5 Magic Water, 5 Dispel Herb, 5 Stimulant and the 5 Elixir initially.
     

    Attached Files:

    #20

Share This Page