Burning Orca Shops

Discussion in 'JS Plugin Releases (RMMV)' started by BurningOrca, May 11, 2019.

?

Does this plugin fullfill some of your needs?

This poll will close on May 11, 2020 at 6:09 AM.
  1. Yes

    100.0%
  2. No

    0 vote(s)
    0.0%
  1. BurningOrca

    BurningOrca Veteran Veteran

    Messages:
    49
    Likes Received:
    33
    First Language:
    German
    Primarily Uses:
    RMMV
    First of all I know Tsukihime has written a Shop Manager and propably other authors have done similar things
    and I didn't think I would be able to do the same, but it actually didn't take that long.

    Use:
    As always totally free for commercial and non-commercial use and it doesn't need credits.

    Features:
    - Define entire shops in the plugin parameters (Yes that is the difference between my plugin and Tsukihimes ShopManager)
    This may be more work, but I like it that way.
    - Limit the available items via javascript code within the plugin parameters.
    - Limit the amount of items in the shops stock, either by fix amount or variable.
    - Limit shops to only accept items from you, that they also offer to you.
    - Handle discounts via javascript code.

    Plugin Parameters.PNG

    You can open a shop with the plugin parameter OpenShop <Name>.
    You do not need to use the Shop Processing Command afterwards.
    You can still open normal shops via the Shop Processing Command.

    The Shop Number Window will display the number of items in stock:
    Shop Infinite.PNG
    If it is not infinite it will display the stock quantity minus the number you've selected to buy:
    Shop Limited.PNG

    You can specify if and how the shops do refill their stock.

    You can also trigger refilling the stock via the plugin command:
    RefillShopStock <Name>

    You can also close the shop, via the plugin command:
    CloseShop <Name>
    If it is reopened later it's stock will be refilled.

    I would really appreciate any feedback.

    Compatibility:
    Please place this under any shop related plugins.
    It is not compatible to Tsukihimes ShopManager.

    Edit:
    - Found a bug and fixed it. Please download the new version.
    - Forgot to mention it requires MV Version 1.5.0 or higher
    - Forgot to mention if you define two or more items of same kind in the shop, they will be combined into a single one with the combined stock quantity and if you use custom prices, it will have the highest custom price.

    Edit 2:
    - Fixed some other issues.
    - The help window will now display the shops name instead whenever it would have displayed an empty text.

    Edit 3:
    - Shop names are now allowed to have white space.
    - Two new plugin parameters:
    Sold out text: Will be displayed in the help window alongside the shops name, when it is completely sold out.
    Display sold out items in shop: Determines when the shop is opened via the plugin command whether sold out items should be visible in the buy window. If items get sold out while the shop is already open they are just greyed out.

    Edit 4:
    - Compatibility with mjshi NPCDialogueShop: My plugin removed the common event command. Now it will also add the common event command when mjshi's plugin is installed aswell.
    Please place this plugin under mjshi's plugin.

    Edit 5:
    Added functionality for granting discounts under certain conditions.
    Shops keep track on #Total items sold, #Individual items sold, #Times visited.

    Edit 6:
    Fixed very big bug. This plugin didn't pass the plugin command and it's arguments to other plugins.

    Examples for discount conditions:
    this.getNumberBoughtOf(kind, id) >= 3 Means #individual items sold >= 3
    this._nrOfVisits == 3
    this._totalItemsBought == 100

    Discount percentages stack by multiplying them, e.g. if the conditions for 10% and another 20% are fulfilled, this does not mean a discount of 30%, but rather only 28% as
    e.g. if the original price = 100:
    100 * (1 - 10 / 100) = 90
    90 * (1 - 20 / 100) = 72
    Edit 7:
    - Fixed a bug, that make normal shops being opened endlessly.
    - Added custom selling prices. If not given half of the custom buying price is taken as selling price. If this is not given either half of the price from the database is taken as selling price just like the default behaviour.

    The resulting price is rounded down, in case it is a floating point number.
    The plugin now has version 1.5.
     

    Attached Files:

    Last edited: May 30, 2019
    #1
    atoms, zerobeat032, Roguedeus and 6 others like this.
  2. JtheDuelist

    JtheDuelist Just a dev who actually got a game finished Veteran

    Messages:
    1,127
    Likes Received:
    1,400
    Location:
    RMW Forums, Granvia, or Askr
    First Language:
    English
    Primarily Uses:
    RMMV
    @BurningOrca You, good sir, have done the work of the gods- a limited stock plugin AND a non-mobile use for those button graphics?! Bless you!
     
    #2
    BurningOrca likes this.
  3. BurningOrca

    BurningOrca Veteran Veteran

    Messages:
    49
    Likes Received:
    33
    First Language:
    German
    Primarily Uses:
    RMMV
    @JtheDuelist Thank you, but the buttons are not my work.
     
    #3
    JtheDuelist likes this.
  4. JtheDuelist

    JtheDuelist Just a dev who actually got a game finished Veteran

    Messages:
    1,127
    Likes Received:
    1,400
    Location:
    RMW Forums, Granvia, or Askr
    First Language:
    English
    Primarily Uses:
    RMMV
    @BurningOrca I know they are RTP- I am just glad someone created a use for them outside of launched RM mobile games.
     
    #4
    BurningOrca likes this.
  5. BurningOrca

    BurningOrca Veteran Veteran

    Messages:
    49
    Likes Received:
    33
    First Language:
    German
    Primarily Uses:
    RMMV
    @JtheDuelist But my plugin does not change anything in the ShopNumber Windows layout except adding the "Available Items" text.
    I deactivated every plugin except mine and buttons are still shown in this window, so they must be the default even in non mobile environments.
     
    #5
  6. ShadowDragon

    ShadowDragon Veteran Veteran

    Messages:
    373
    Likes Received:
    112
    Location:
    Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    @BurningOrca This shop Idea might work nicely, but i got 2 questions.
    1) if the stock is out of order, will it say "Out of Stock" or "Sold Out"? (or costumize it)
    2) is it possible to make only the buy option that only sells "key items" (not weapons, Armor, Items)
    if the possibility is there?

    remove the buttons can easely be done by editing the system window if not giving an error.
     
    #6
    BurningOrca likes this.
  7. BurningOrca

    BurningOrca Veteran Veteran

    Messages:
    49
    Likes Received:
    33
    First Language:
    German
    Primarily Uses:
    RMMV
    @ShowDragon
    1) Currently not, it just disables the command slots for the sold out items.
    2) Just add only the key items you want to buy from the shop in the plugin parameters. Then change it to a buy only shop.

    Definition of Key Item Shop (Buy Only):
    Key Item.PNG

    Plugin Command:
    Plugin Command.PNG

    Actual shop layout with no other plugin installed:
    Key Item Shop.PNG

    Question back:
    Where should I put the "Sold out" if I would implement it?

    Also while I was testing this I realized, that my shop names cannot have white space in them, because that doesn't work with the plugin command. I need to change this somehow.
     
    Last edited: May 11, 2019
    #7
  8. ShadowDragon

    ShadowDragon Veteran Veteran

    Messages:
    373
    Likes Received:
    112
    Location:
    Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    @BurningOrca is it possible to implement out of stock instead grey out or remove from stock when item = 0?

    The stock out can be on the spot where the price is normally displayed
    so for example:
    Key Item 1 - 500
    Key Item 2 - Sold Out

    or a other way like "Sold" or other name, not more than 8 characters.

    EDIT: the shop plugin of mjshi "found here" and this one, can give it a bust image as
    well. and this is exacly very nice. specially because that one dont have a stock amount
    included, so combined is 1 heck of a shop setup.

    Now I dont know if this is even possible for multiple layouts. but the good thing
    is, I only need 1 ^^ and its working smoothly.

    Keep up the good work ^^ Probably the best shop plugin out there atm.
     
    Last edited: May 11, 2019
    #8
  9. BurningOrca

    BurningOrca Veteran Veteran

    Messages:
    49
    Likes Received:
    33
    First Language:
    German
    Primarily Uses:
    RMMV
    @ShowDragon:
    I could implement the following compromise solution with 2 new plugin parameters:
    As long as the shop is kept open the fields are only grayed out. The text (Sold Out: customizable via plugin parameter) will be added to the help window text when the whole stock is empty:
    Key Item Shop.PNG
    Then if the other new plugin parameter is set, the next time the shop is opened, it is completely empty:
    Key Item Shop Sold Out.PNG

    I hope this compromise will be enough.

    Edit: Instead of the price is good idea. I will add this.
    Edit 2: I now implemented your suggestion to replace the price with sold out.
    I do not know if can limit this to only 8 characters, so I'll let it as it is for the time being.
     
    Last edited: May 11, 2019
    #9
  10. ShadowDragon

    ShadowDragon Veteran Veteran

    Messages:
    373
    Likes Received:
    112
    Location:
    Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    @BurningOrca 1, its not ShowDragon but ShadowDragon =)
    I tested it, but there is probably 1 error somewhere, in your parameter, you can showsold out text
    to true or false, but either one is the same and keep showing "Sold Out" even when false, but other
    than that, Test (Sold Out) is only visible if no description is given. but sold out where the 0 is, works perfectly.

    Thank you for this nice quick edit. Im very Happy of the outcome. Keep it up.

    (dont forget to change version number) its 1.0 and its still 1.0 (so make it 1.0.1 or whatever you like, so the
    peoples knows that its been edited (bug fixed, addings etc)
     
    #10
    BurningOrca likes this.
  11. BurningOrca

    BurningOrca Veteran Veteran

    Messages:
    49
    Likes Received:
    33
    First Language:
    German
    Primarily Uses:
    RMMV
    @ShadowDragon Sorry for the typing errors, I really didn't mean to call you ShowDragon.
    The text will always be shown. The Parameter set to 'No' will remove the items completely from the list, the next time you visit the shop.
    I will change the version number and add the history before I request to move this to the released plugins forum.

    Edit:
    I am not good with user interface layout. So I decided to use the help window for the shop name instead of creating an own window. The drawback is as you mentioned, that the item descriptions will overrule the shop name.
     
    #11
  12. BurningOrca

    BurningOrca Veteran Veteran

    Messages:
    49
    Likes Received:
    33
    First Language:
    German
    Primarily Uses:
    RMMV
    Sorry for posting under myself, but everyone who already downloaded this, please get the new version!!!
    I had a very serious bug, that I just found today.
    This plugin didn't pass the plugin command and it's parameters to other plugins, so all other plugin commands didn't work.
     
    #12
  13. ShadowDragon

    ShadowDragon Veteran Veteran

    Messages:
    373
    Likes Received:
    112
    Location:
    Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    I didn't notice that one, good job finding it, also, you can only post under yourself if its longer than 72 hours :)
    but im going to download the new version. ^^.
     
    #13
    BurningOrca likes this.
  14. ShadowDragon

    ShadowDragon Veteran Veteran

    Messages:
    373
    Likes Received:
    112
    Location:
    Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    i got a weird syntax error of unexpected token u in JSON at position 0

    SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at Data_Shop.initialize (BO_Shops.js:486)
    at new Data_Shop (BO_Shops.js:438)
    at Data_Shops.initialize (BO_Shops.js:428)
    at new Data_Shops (BO_Shops.js:412)
    at Function.DataManager.isDatabaseLoaded (BO_Shops.js:375)
    at Function.DataManager.isDatabaseLoaded (SRD_MapSlipDamage.js:260)
    at Scene_Boot.isReady (rpg_scenes.js:374)
    at Function.SceneManager.updateScene (rpg_managers.js:2018)
    at Function.SceneManager.updateMain (rpg_managers.js:1983)

    I have no clue why its happening though
     
    #14
  15. BurningOrca

    BurningOrca Veteran Veteran

    Messages:
    49
    Likes Received:
    33
    First Language:
    German
    Primarily Uses:
    RMMV
    Sorry for the late answer:
    Could you make screenshots of the plugin parameters, or post the text form of one shop, please?
    Maybe this is due the discounts I added to the plugin parameters in a later version.
    If so please try to click once at each shops discount option and press okay afterwards.
    If this doesn't help and you do not have many shops, maybe redefining all the shops may help.
     
    #15
  16. ShadowDragon

    ShadowDragon Veteran Veteran

    Messages:
    373
    Likes Received:
    112
    Location:
    Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    it happend when i aded a new plugin and when it has 1 item on it, when I added 2 more items, it seems to
    solved, but when i go down to 1 item, it get the error again, idk why though, when i turn off the new plugin and retest it,
    it gives the same error with only 1 item in stock, But i can make a screenshot later the day.
     
    #16
  17. kako05

    kako05 Veteran Veteran

    Messages:
    68
    Likes Received:
    3
    First Language:
    Australian
    Primarily Uses:
    RMMV
    Can you define which items shop buys and it's price? for ex. can I sell quest items for a higher prices compared to other shops?
     
    #17
  18. BurningOrca

    BurningOrca Veteran Veteran

    Messages:
    49
    Likes Received:
    33
    First Language:
    German
    Primarily Uses:
    RMMV
    @ShadowDragon That is strange. I use it too, with a shop that only has 1 item and it works just fine.
    Could you maybe also test if it works in a new project or if the same error will happen?
    Edit:
    I had a look at line 486 and that really is the discound like I tought.

    Please try the following:
    1. Go to the plugin parameters.
    2. Open each Shop.
    3. Switch to the text form
    4. Check if the following text appears right infront of the last closing } bracket:
    ,"Discounts":""
    5. If not add it.

    @kako05: Sorry, not 100% like you want it to:
    - You can add items which you can buy from the shop and change their price
    - You can set a shop to Sell Only so you cannot buy items from it, but sell items to it
    - You can set the shop to only buy items from you which it also sells to you.
    So if you have a SellOnly shop with all this criteria you can basically set up a shop that only accept certain items, but the custom buying price is currently not taken over to the selling price. This is the same as with normal shops and custom buying prices. Sorry I didn't know that.
    If wished I can make it that somehow half of the custom buying price is set as selling price or add a new plugin parameter selling price to each item/weapon/armor.
    If wished I could also change it to using the item/weapons/armors defined in the plugin parameters to be used as the items for sell only shops.

    Edit:
    I uploaded a new version that supports custom selling prices, but I kept it the way, that the shop accepts every single item from you if you do not set the appropriate plugin parameter, even the shop is set to sell only.
    I changed the default of the discounts plugin parameter.
    Hopefully this fixes the bug with the discounts and does not introduce new problems.
     
    Last edited: May 30, 2019
    #18
  19. kako05

    kako05 Veteran Veteran

    Messages:
    68
    Likes Received:
    3
    First Language:
    Australian
    Primarily Uses:
    RMMV
    Awesome! Great :)
     
    #19
  20. ShadowDragon

    ShadowDragon Veteran Veteran

    Messages:
    373
    Likes Received:
    112
    Location:
    Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    it was there, but placing the new updated version and it was gone. but i will keep that in mind, but im not sure what
    the token u of position 0 means though. otherwise, good job of the new plugin param, can be of good use. =)
     
    #20

Share This Page