RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Enhanced Shopping (v1.0d.01)

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 82
    Overture 1.0: A Different Kind of Shopping Experience
    aka Enhanced Shopping (v1.0d.01)
    Version: 1.0d.01
    Author: Logan Forrests
    Date: December 25, 2011

    Version History


    • <Version 1.0d.01> 2011.12.25 - Compatibility Fix: YERD Synthesis Shop (by request)
      - Updated Scripts: LF Shop Scene FF7 Base Script, OV ES Main Script
    • <Version 1.0d> 2011.12.23 - Fixed: An issue in which shops were not automatically restocking
      - Added: Shop stocks are now sorted into Items > Weapons > Armor by database ID
    • <Version 1.0c> 2011.12.17 - Fixed: An issue in which giving general stores properties would crash the game when accessed for the second time.
    • <Version 1.0b> 2011.11.26 - Fixed an issue in which general stores ended up adding to and sharing the same stock
    • <Version 1.0a> 2011.11.18 - Minor Pre-release Bug Fixing and first release

    Planned Future Versions

    • <Version 1.1>

    - Allow individual shop restock amounts
    - Provide additional callable functions to enhance shopping experience including the ability to remove items from shop stock
    - Introduction of Unique Items that can be bought only once to shops and never sold
    • <Unknown>
    - Create additional Plug 'n' Play shop scenes
    [/list]

    Description


    The default system involves buying from a predefined list of items on sale by the shop and selling any unwanted goods for a pretty penny (or in some cases peanuts).

    But what happens to all those items we sell? And how come the shops never really run out of items despite having only a small counter or a cloak from which our friendly shopkeeper makes his sales? Well, now we can answer those questions for our players.

    With this script, we can set up our shops to behave in various ways. From a shop who runs out of items to shops who will receive occassional shipments to replenish shops. We can even make shops sell us back the things we sold him
    (for a reduced price if we want too). Of course, we can't forget about the traveling merchant with only a cloak or a pack mule to hold his items - We can limit the amount of items a shop is able to hold altogether.

    Features

    • Create shops to be exhaustable, restockable, resellable and more.
    • Have the contents of shops be reflected in the game environment through clever use of shop interactivity
    • Introduce new items into a shop's goods list after key events in your story
    • Shop contents can be saved and loaded as they were left
    • Custom shop scene that includes: ATK, DEF, SPI and AGI values of equippable items, greyed out characters who cannot make use of the highlighted item and values reflecting the current stock amounts and capacity where required.

    An Example of Advanced Use:

    Taken from the In-Depth Guide provided with the script. It probably won't make much sense straight away, but the plan is to get you to take a further look into the script.

    Bob's Shop gets flattened

    We decide to make a shop for our pal, Bob. We anticipate he might need to make use of these special features so we give him a proper shop. We didn't set up any initial properties though (because they aren't necessary).

    Imagine, now, we come across a scenerio in which our heroes have released an unknown evil onto the world and this evil happened to decimate our village. A village where Bob's Shop, a shop which normallty sells us an infinite number of Potions and other healing goods was making good business. The problem now, though, is that Bob's Shop also got flattened. But he's not giving up. He'll still continue to sell items. However, he only has a small amount of space left and he really isn't interested in selling anything back if you change your mind later.

    Well, along with our village destruction event we can also add in the following script command:

    Code: [Select]
          s = "Bob's Shop"
          $game_shops.make_limited(s, 100)
          $game_shops.disallow_resell(s)

    And just like that, we have made Bob very unhappy but at least the game will now accurately reflect the new scenario. Maybe some day, when the Heroes vanquish the evil, his shop can be returned to glory. Or maybe, some donations to Bob might help his return along the way (that's another scenario you could implement with this script).


    Screenshots

    Just a few select screenshots. I actually took about 20, but figured I'd just put up some show off ones rather than all of them.

    Spoiler for:

    The Shop scene: A normal shop with all of the normal quirks.


    Our Shopkeep, Bob, has sold all of his goods at last. Now can go on that vacation he was always telling you about.


    Whilst the Player does have 99 in stock, he can only sell off 20 of them to our Shopkeep with limited space.


    Buying back your once-thought trash is as easy as. But shops might charge you more than he gave you for the item just because he can.


    Instructions

    This system currently comprises of 4 necessary scripts and 1 guide. All scripts are provided in the demo.

    Necessary
    - Enhanced Shopping: Configuration
    - Logan Forrests' FF7-style Shop Scene
    - Enhanced Shopping: FF7 Shop Scene Add-On
    - Enhanced Shopping: Overture
    - Modern Algebra's Bitmap Add-on
    Guide
    - Enhanced Shopping: How To

    All of these can be found in the Demo provided.

    Script


    Scripts can be found in the Demo at the end of this post.

    Please note that the RPG Maker VX RTP is required to be installed prior to loading the demo. This is to keep the filesize of the demo to a minimum.


    Credit


    • Logan Forrests
    • modern algebra (Bitmap Addons script)

    Thanks

    • rmrk.net - it's almost like a home now. Plus, the people are pretty great too.

    With thanks: Bug Finders
    • yuyubabe
    • Wendy the Witch

    Support


    Support for compatibility fixes, bug reports, errors or issues can (and should only) be made here.

    Known Compatibility Issues

    The Shop Scene script overwrites a lot of the original Shop Scene, so any script that requires the old one of those or modifies it probably won't be too happy to see this. Other than that, I can't imagine too many other compatibility issues popping up. If it does, though, make them known here.

    Demo


    One has been made, and the latest version can be downloaded from here:

    http://www.mediafire.com/?y9t0mqha24cm82r

    Latest versions of each script can also be downloaded via the attachments to this post (requires Log On).

    Author's Notes


    This was designed from scratch after a more botched version I quickly made, where I learned that RPG classes aren't saved making it almost useless to use for anything special. So, I began working on it again to make it useful. Then, along the way, I got some other funny ideas (that, sure, have been seen in other games) and figured I'd try to implement them too. And this is the result.


    Restrictions


    The series of Enhanced Shopping scripts by Logan Forrests are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
    « Last Edit: December 25, 2011, 01:57:56 AM by LoganForrests »
    (Why do I always feel like it's the end of the world and I'm the last man standing?)

    *
    Rep:
    Level 97
    2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
    Looks great Logan! I'll take a look at the actual code when I get the chance, but the idea is great - shopping in RM has always been terrible.

    And I'm glad you feel that rmrk is almost a home; I feel that way too.


    *****
    Rep:
    Level 84
    This text is way too personal.
    Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
    Very neat! It's so customizable and configurable too; really shows the effort you put into this LF!

    *****
    my name is Timothy what's yours
    Rep:
    Level 79
    Hello
    2014 Best IRC Quote2014 Zero to Hero2014 Most Missed Member2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
    This is gorgeous. That is all.
    it's like a metaphor or something i don't know

    ***
    Rep:
    Level 77
    RMRK Junior
    Don't think it will work with any of Yanfly's item scripts. Although the only thing I really need this for, if anything, is a joke item you can only buy once.

    *
    Rep:
    Level 82
    It's likely the code will go through rigorous revamping at some point in the future, especially in the conversion to VX Ace when that arrives in English and I have some spare money to buy a licence for it. So, it may not always be pretty code but as I start to learn more it will get better. Also, I'm very open to suggestions and ideas on improvements to code.

    It's not intended to be written with compatibility in mind, but if people do require such a thing I will look into them on an individual request basis.

    I'm not sure when I'll get to updating this script to feature unique items that can only be purchased once as I have a number of other important things to get out of the way first.

    You can emulate this already though if you use the add_new_item and only add 1 of those items to the shop. As long as the shop isn't "restockable" you won't be able to get more than 1 of them. Whilst this does limit you to having these items in non-restockable shops, for now it's an alternative.

    The problem now, though, is that you can sell this item. If you wanted to prevent this, you could make a check after the shop processing to 'swap' the item with an unsellable one - one that has a price of 0.

    ---

    I've updated the OP to include the randomly thought up scenario that makes use of some of the features of this script - namely the easy-access calls to obtain or amend key data during run-time.

    Glad you guys like it. It's very warming to hear others' thoughts on it, especially from those of you who I hold with quite high regards in my continuing education in programming. And feel free to offer some suggestions on what other things can be added to the shops. It doesn't matter how crazy or complex it might appear. I'll give it thought and possibly an attempt (though when is an unknown factor).
    « Last Edit: November 18, 2011, 09:39:05 AM by LoganForrests »
    (Why do I always feel like it's the end of the world and I'm the last man standing?)

    **
    Rep:
    Level 67
    Eternal Newbie
    Whoa, awesome! The feature I like most is the ability to update the shop items after certain events in the game. I was planning to do it with just events, but this is much better. Great script Logan

    *
    The Hero of Rhyme
    Rep:
    Level 83
    ( ͡° ͜ʖ ͡°)
    Project of the Year 20142014 Best RPG Maker User - Story2014 Queen of RMRK2011 Best Newbie2014 Best RPG Maker User - Creativity2014 Kindest Member2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best Yuyubabe Smiley2012 Best RPG Maker User (Creativity);o
    Oh my goodness! I was searching tirelessly for a shop script that displayed "ATK, AGI, SPI, DEF" rather then just ATK. But it seems this has even more cool features! Thank you so much for scripting this! I love it :)  +rep to you :)

    EDIT:

    I might have found a little bug... When on the Buyback screen, I tried to "buyback" nothing and got an error message that crashed the game. I'll attach an image file of it. Just a little bitty bug, unless it's caused by my other scripts somehow xD haha
    « Last Edit: November 25, 2011, 03:21:01 AM by yuyubabe »
    Spoiler for My Games and Art:
    ℒℴѵℯ❤


    My Artwork Thread

    The Lhuvia Tales [Current]

    Ambassador [Complete]

    The Postman [Complete]

    The Wyvern [Complete]

    Phoenix Wright: Haunted Turnabout [Complete]

    Major Arcana [Cancelled]


    *
    Rep:
    Level 82
    Thanks for the like.

    I'll take a look at that issue right now. I remember getting that in a previous version, and must have forgotten about it in the many rewrites I do.

    Edit:

    For a quick fix on that -

    In the script: OV ES FF7 Shop Scene Add-on

    change line 425:

    Code: [Select]
        return if state #prevents nil:NilClass error

    to

    Code: [Select]
        return true if state #prevents nil:NilClass error

    That will make it work properly. I've uploaded a new demo to fix that issue. Thanks for the find. I intend to rewrite that little method but I find that it gets a little messy trying to write conditionals that include many statements.

    Also added something to the features list:

    • Custom shop scene that includes: ATK, DEF, SPI and AGI values of equippable items, greyed out characters who cannot make use of the highlighted item and values reflecting the current stock amounts and capacity where required.

    This was already there, just not included. I figured it is actually a good feature.
    « Last Edit: November 25, 2011, 03:40:26 AM by LoganForrests »
    (Why do I always feel like it's the end of the world and I'm the last man standing?)

    *
    The Hero of Rhyme
    Rep:
    Level 83
    ( ͡° ͜ʖ ͡°)
    Project of the Year 20142014 Best RPG Maker User - Story2014 Queen of RMRK2011 Best Newbie2014 Best RPG Maker User - Creativity2014 Kindest Member2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best Yuyubabe Smiley2012 Best RPG Maker User (Creativity);o
    Perfect fix! That was fast, too! Thank you very much :)

    Yeah, I imagine conditionals would be a pain... :(

    And that's a wonderful feature. Beforehand, I was actually including those stats in the wep/armor description (which was tacky) and now I don't have to do that! Sweetness :)
    « Last Edit: November 25, 2011, 03:56:41 AM by yuyubabe »
    Spoiler for My Games and Art:
    ℒℴѵℯ❤


    My Artwork Thread

    The Lhuvia Tales [Current]

    Ambassador [Complete]

    The Postman [Complete]

    The Wyvern [Complete]

    Phoenix Wright: Haunted Turnabout [Complete]

    Major Arcana [Cancelled]


    *
    The Hero of Rhyme
    Rep:
    Level 83
    ( ͡° ͜ʖ ͡°)
    Project of the Year 20142014 Best RPG Maker User - Story2014 Queen of RMRK2011 Best Newbie2014 Best RPG Maker User - Creativity2014 Kindest Member2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best Yuyubabe Smiley2012 Best RPG Maker User (Creativity);o
    Sorry for the double-post, and I hate to be a jerk... but I think I found another bug :( (sorry...) it's just a little one, but I thought I should bring it to your attention.

    I made two (normal-style infinite item) shops on my game - one sells items and the other sells weapons/armor. I checked out the item shop, then visited the weapon one to see that all the items from the item shop were included on the buy list of the armor. I exited it, and re-entered the shop and it was fixed. Then I visited the item shop again and the weapon shop's items were included in that shop, as well. Exit, then visit again and it fixed. It seems that it wants to include whatever shop's items last visited on the next shop's list, too... but, upon visiting that shop twice in a row, it fixes. Kinda confusing haha...

    Anyways, sorry to have to bring up all these annoying bugs... I guess the bugs really like me. :-[
    Spoiler for My Games and Art:
    ℒℴѵℯ❤


    My Artwork Thread

    The Lhuvia Tales [Current]

    Ambassador [Complete]

    The Postman [Complete]

    The Wyvern [Complete]

    Phoenix Wright: Haunted Turnabout [Complete]

    Major Arcana [Cancelled]


    *
    Rep:
    Level 82
    I thought I'd got that one fixed when I found it originally. Seems like I didn't. It used to happen when going from any shop to a general/normal shop, but with only 1 general shop in the demo I'd overlooked the possibility of it affecting normal shops still.

    I know what the issue is, but I won't be able to fix it at least until tomorrow now. I'll get to it though, as soon as I can.

    Thanks for finding it again.
    (Why do I always feel like it's the end of the world and I'm the last man standing?)

    *
    The Hero of Rhyme
    Rep:
    Level 83
    ( ͡° ͜ʖ ͡°)
    Project of the Year 20142014 Best RPG Maker User - Story2014 Queen of RMRK2011 Best Newbie2014 Best RPG Maker User - Creativity2014 Kindest Member2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best Yuyubabe Smiley2012 Best RPG Maker User (Creativity);o
    Thanks again, LoganForrests :) I owe you more rep points for all this trouble!
    <----(is an obvious enjoyer of the rep system)
    Spoiler for My Games and Art:
    ℒℴѵℯ❤


    My Artwork Thread

    The Lhuvia Tales [Current]

    Ambassador [Complete]

    The Postman [Complete]

    The Wyvern [Complete]

    Phoenix Wright: Haunted Turnabout [Complete]

    Major Arcana [Cancelled]


    *
    Rep:
    Level 82
    Updated the demo with a quick fix to solve that problem. Issue was simply me forgetting that I needed to clear the dummy shop holder (I use for general stores) of its stock once the scene has terminated.
    (Why do I always feel like it's the end of the world and I'm the last man standing?)

    *
    The Hero of Rhyme
    Rep:
    Level 83
    ( ͡° ͜ʖ ͡°)
    Project of the Year 20142014 Best RPG Maker User - Story2014 Queen of RMRK2011 Best Newbie2014 Best RPG Maker User - Creativity2014 Kindest Member2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best Yuyubabe Smiley2012 Best RPG Maker User (Creativity);o
    It works perfectly! Thanks as always, LoganForrests! :)

    I love the bug finders list haha 8) thank you!
    Spoiler for My Games and Art:
    ℒℴѵℯ❤


    My Artwork Thread

    The Lhuvia Tales [Current]

    Ambassador [Complete]

    The Postman [Complete]

    The Wyvern [Complete]

    Phoenix Wright: Haunted Turnabout [Complete]

    Major Arcana [Cancelled]


    **
    Rep:
    Level 71
    RMRK Junior
    Just thought I'd pop on to offer my thanks.  This script is fantastic.  Little touches like the visible stock items on the shelves/counters are GREAT.  I'm fiddling with a game oriented around travel and trade, and this is EXACTLY what I was looking for.  The user guide is very well-done also.

    EDIT: I just set up a shop which restocks every seven in-game days, and which raises and lowers its sell price based on remaining supply.  IE, you can buy at the beginning of the week when his supply is high, to save money, or wait until the end of the week to sell him things, as he's getting low on product.  Pretty damn slick man ^^
    « Last Edit: December 01, 2011, 01:22:54 AM by teknoarcanist »

    *
    Rep: +0/-0Level 63
    RMRK Junior
    so i am new to this and all and its likely my own mistake, but i would really appreciate any help i can get with this lil problem im having.
    i keep getting this error.

    Script 'OV Enhanced Shopping' line 1104: NoMethodError occurred.
    undefined method 'new_shop_flag' for nil:NilClass

    i have attached the game without the rtp and there is money in the log to the right hand corner for use to test the shop.
    it only happens so far after i have boughten an item and return to the shop. i do have the shop set to 6 seconds before restock, but this happened even when at 30 min as well.

    Edit: also i tried seeing if i needed to add true to line 1104 like in line 425 for that other bug but to no avail.
    « Last Edit: December 17, 2011, 05:29:55 AM by mitsanaga »

    *
    Rep:
    Level 82
    Thanks for uploading the project. I'll take a good look at it and see what might be the problem.

    Edit:

    Ok, it does work as it should do.

    The problem is that shops which are made as general stores, like the one you have in the demo, should not be given the properties like make_restockable or make_exhaustable. Only shops with names given by a comment should be made to have these properties.

    A shop instance isn't actually created for general stores which is why the nil error comes up when you try to use these extra shop properties for them. Thus, to fix the problem you should either:

    a) Create a standard general shop (like the default shop scene) by removing script commands that give the shop properties such as make_restockable, or;

    b) Make the shop an enhanced shop by giving it a name in a comment and leaving the properties as they are.

    I did want this to only show up for play test mode but for some reason the $DEBUG flag is always false even in debug mode.

    I've also fixed it so that it doesn't crash the game when this scenario happens, so you can continue testing/playing regardless of this message.

    I have uploaded a version of your demo with the changes and two shop events so that you can see how general shops and enhanced shop differ. The new script can also be found in the opening post of this thread.

    Thanks for bringing this to my attention.

    The demo can be downloaded via the following link:

    http://www.mediafire.com/?rjyd4d8rym8p5y1
    « Last Edit: December 17, 2011, 07:02:49 AM by LoganForrests »
    (Why do I always feel like it's the end of the world and I'm the last man standing?)

    *
    Rep: +0/-0Level 63
    RMRK Junior
    Excellent, that helps a lot. thank you Logan.
    i especially like how you put up a warning for the shop that was setup incorrectly. helps a lot more than a nil error lol.
    i have some work to go do now and hopefully i dont run into any more problems with anymore scripts in general....

    ***
    Rep:
    Level 74
    I'm baaack!
    Thanks for the like.

    Here, have some more!


    A good shop script is always a nice feature to have in a game.



    You deserve a: nvm I don't feel like searching through all the emoticons....