[INACTIVE][ECON] DynamicMarket v. - Versatile Shop Plugin [440-480+?]

Discussion in 'Inactive/Unsupported Plugins' started by HaloInverse, Feb 2, 2011.

  1. Offline


    DynamicMarket - Dynamic Global Shop Plugin

    Version: 0.4.8
    Built against: Bukkit 0.0.1 build #412
    Works with: CraftBukkit 0.0.1 builds #440-480 or thereabouts.

    • Permissions 2.5
      • Very recommended, but now optional! See "DynamicMarket.settings" below.
    • iConomy 4.1
    • Either of:
      • SQLite (easiest to set up, reccomended)
      • MySQL (more troublesome, more powerful)
    Buy items, sell items, admins set prices, et cetera. However, there's a lot going on under the hood...

    Seriously. (open)

    This plugin has a great deal of flexibility, but the price of more flexibility is more command options to control that flexibility. Computers just aren't very psychic.

    While in-game help exists for commands, the output from /shop help (<topic>) is intended to be a quick reference, not exhaustive documentation. Full instructions simply won't fit on the MineCraft client's tiny text display.

    You should read and understand the following sections before installing this plugin and setting up your shop. If not, you should at least read and understand the following sections while you are setting up your shop items.

    The big feature: Dynamic pricing. Items can be set to increase in price as they are purchased from the shop, and decrease in price as they are sold back, simulating open market conditions. The initial prices of items are just considered a starting point - user transactions will eventually adjust an item's price to a near-ideal level, based on actual value vs. rarity.

    However, as of 0.4.5, the configuration fields are now flexible enough to allow a range of behaviours, from fixed pricing with no stock limits, to fully-dynamic pricing with finite stock levels.

    This is by no means "complete" in the sense of "finished adding features", but it is complete enough to be functional and usable.

    Current Features (open)

    New & Current Features:
    • Buying and selling of items:
      • Item prices can be set to dynamically adjust according to supply and demand. This is highly adjustable, including the rate of price increase/decrease per transaction, optional hard overstock/understock limits, price ceilings/floors, etc. Leaving all the extra features turned off makes an item's price fixed and always-in-stock, like a basic "flat rate" shop.
      • Subtypes of items are fully supported.
      • List of items in the shop is broken into pages, accessible by number.
        • Partial-name searching! "/shop list wood" shows everything with "wood" in the name.
      • Item names for buy/sell/info also use partial substring matches.
      • A dynamically-priced item might cost more for 10 items than the cost of 1 item multiplied by 10, due to stock depletion. So, the "/shop <id>" command now takes an optional ":<count>" parameter, so you can get a quote for the actual buy/sell price of larger numbers of items.
    • Administration:
      • Shop items are edited via a "tag" system, so you don't have to re-enter every field for each small change. Plus there's a few utility tags which do other things to an item's record...
      • Item names are now editable, and will persist (independent of items.db) until the item's record is deleted.
        • This also makes items.db a convenience instead of a necessity, since items can be added by ID and then immediately renamed.
      • A "Default" item exists in the shop, which cannot be bought or sold, but serves as the base data for any new items you add to the shop. Any tags not supplied when you add an item will be copied from whatever you put into "Default".
      • Basic sanity-checking on input data has been added. Also, adjusting an item's bundle-size will rescale its price automatically.
      • Items can be set to be purchasable but not sellable, or vice versa. (Set either price to -1 to disable that transaction type for that item.)
        • Tags like "canbuy:n" and "nosell" can now be used.
      • An extended in-game help system. "/shop help" lists available commands and help topics. "/shop help <topic>" gives help on a shop command or other shop-related topic listed in the main help.
      • The list of commands displayed is filtered by the user's current permission level.
      • Shortcuts for all commands (except for database reset).
      • All commands except for "/shop buy" and "/shop sell" can be accessed through the Bukkit console. No need to log in to add or update items!
      • Access to the entire shop is now restrictable by permission.
      • Highly informative error messages, to help reveal why your database exploded. (Which really shouldn't happen, but you never know...)
      • The shop DB can now be exported to a .csv file, edited in your favorite spreadsheet, and re-imported back into the database, making large-scale changes easier.
      • NEW: The revenue/cost of transactions can now be transferred to another account. With the basic plugin, this can be an admin's iConomy account, or a dummy "GovernmentBank" account. (Don't use that name, or some bright spark will register that username and exploit you.) With a wrapper plugin, this can be set to link a shop's funds directly to an owning player's iConomy balance.
      • NEW: Transaction logging to a comma-delimited file, ready to import into a spreadsheet for nefarious financial analysis!

    Market Mechanics (open)

    Quick Market Mechanics Description:
    • Instead of a "buy price" and a "sell price", items now have a "base price" and a "sales tax". The "buy price" is based on the base price (adjusted by stock, if set to do so), and the "sell price" is based on (<buy price> - <sales tax%>). So if the sales tax is set to 25, then an item's selling price will be 75% of its purchase price. (The sales tax is entered as a number from 0 to 100, representing 0% to 100% tax.)
      • Using the old "/shop add <id> <buyprice> <sellprice>" format still works - the plugin just calculates the base price and sales tax, so that the buying and selling prices come out right.
    • Shop items have a "stock level", which is not necessarily a literal count of items in stock. By default, the stock level is considered an offset from baseline, rather than an absolute count.
      • Items with stock near zero are considered to be in "average" supply, and will be priced at their base price.
      • Items with a positive stock are considered "in surplus", and will be priced below their base price.
      • Items with a negative stock are considered "understocked", and will be priced above their base price.
      • This interpretation of stock levels can be made to behave like literal counted stock, by setting an item's StockFloor to zero, which prohibits negative stock.
    • Items have a "volatility", which indicates how quickly the price changes based on changes in stock level. It represents the percent increase in an item's price per item purchased, multiplied by 10000. V=1 (the lowest level) means that 100 items would have to be purchased to raise the price by 1%. V=10000 (the highest level) means that 1 item purchased would raise the price by 100% (doubling the price). (More examples in tags.txt)
      • There is also "inverse volatility", which represents the number of items needed to be bought in order to double the buying price (or halve it, if selling). This is more convenient for some people's mindsets, and is converted into volatility when entered.
    • The "sell price" is actually calculated from the buy price at the current stock level + 1, rather than the current stock level. This is to prevent gaining endless money by buying an item (driving the price up) then immediately selling it back (dropping the price) - if <sales tax> = 0, then buying-then-selling like this produces zero net gain/loss (as it should).
    • The tag presets "fixed", "float", "finite", and "flat" allow you to quickly set up common options. If used with the "Default" item before adding items to your shop, this will allow you to set the overall behaviour of the shop easily. See Tag Reference for further details.

    Commands (open)


    <Angle Brackets> denote parameters.
    (Round Brackets) denote optional sections.
    The brackets themselves are not part of the command; they are just used to describe syntax. Brackets should not be typed.
    If executing shop commands through the Bukkit console, leave off the initial slash.

    /shop - Shows the main help page. Lists commands and shortcuts.
    /shop help - Ditto.
    /shop help <topic> - Shows help on the given command or subject.
    /shop help tag <tagName> - Shows help on the given item tag.
    /shop <id>( :<count>) - Shows current buy/sell information on the given item.
    <id> can be an item name or a type number with an optional subtype:
    <id> = <itemName> | <itemID> | <itemID>,<subtypeID> | Default
    If <count> is used, shows the total price for the given number of items/bundles.
    /shop list (<partname>) (<pageNum>) - Lists a page of items in the shop. Default page = 1.
    If <partname> is used, lists only items with <partname> as part of their name.
    /shop buy <id>( :<quantity>) - Purchases an item. Default quantity is 1 bundle.
    /shop sell <id>( :<quantity>) - Sells an item. Default quantity is 1 bundle.
    /shop add <id>( :<bundleSize>) (<buyPrice> (<sellPrice>)) <tagList> - Adds an item to the shop list.
    <buyPrice> and <sellPrice> are accepted for convenience, and are internally converted to BasePrice and SalesTax.
    Unused tags will have their data copied from the Default item.
    Transactions will be in multiples of <bundleSize>. Default quantity is 1 item per bundle (unless overriden with the Default record)
    /shop info <id> - Shows much more detailed information about an item in the shop, such as stock level, volatility, etc.
    /shop update <id>( :<bundleSize>) (<buyPrice> (<sellPrice>)) <tagList> - Edits an item's shop data record.
    Data is first copied from the old record, then tags are applied in order of entry.
    NEW! <id> can be "all", applying changes to all items in the shop list.
    /shop remove <id>- Removes an item from the shop list.
    /shop reload - Reboots the plugin, reloading the configuration file and items.db.
    /shop reset - Deletes and recreates the shop database from scratch. Asks for an extra confirmation before doing so.
    /shop exportdb - Exports the shop database to a .csv file. The name and location are configured in SimpleMarket.settings. (Default: Plugins/DynamicMarket/shopDB.csv)
    /shop importdb - Imports a .csv file into the shop database. Same file location as used by the exportdb command. Note that the previous contents of the database are NOT cleared out before importing, so you may want to do a "/shop reset" before importing. The file's format MUST match the format of the exported file (except for quote marks, which are stripped out on import).

    Tag Reference
    Tag Usage Examples
    Permissions (open)


    'dynamicmarket.access' : Grants basic access to the root /shop command.
    'dynamicmarket.buy' : Grants purchase rights.
    'dynamicmarket.sell' : Grants selling rights.
    'dynamicmarket.items.add' : Grants the ability to add new items to the shop.
    'dynamicmarket.items.update' : Grants the ability to edit items in the shop.
    'dynamicmarket.items.remove' : Grants the ability to remove items from the shop.
    'dynamicmarket.admin' : Grants the ability to delete-and-rebuild the shop database, and to reboot the plugin.

    Installation/Setup (open)

    • If you haven't already done so, install Permissions and iConomy, and ensure they work.
    • Copy DynamicMarket.jar into your Plugins/ folder.
    • NEW: Copy items.db into Plugins/DynamicMarket/ (or whichever directory you specify in DynamicMarket.settings) (DynamicMarket will work with other plugins' items.db files, but not all plugins will handle the extra subtype data in the items.db linked below.)
    • NEW: Copy either the SQLite connector or the MySQL connector into your main MineServer/Bukkit folder.
      • Or, if you have a MySQL server running, edit DynamicMarket.settings to specify the MySQL server, login, and password.
    • Edit plugins/Permissions/config.yml, and give everybody the appropriate permissions.
      • Most users would get 'dynamicmarket.access', 'dynamicmarket.buy', and 'dynamicmarket.sell', unless you want to restrict such commands to registered/VIP users.
      • Mods would probably get 'dynamicmarket.items.*'
      • Admins should get 'dynamicmarket.admin', if they don't already have '*'.
    • (Re)Start your MineCraft server. Errors may be thrown to the console, but the file Plugins/DynamicMarket/DynamicMarket.settings should be created.
    • Edit DynamicMarket.settings. Particularly, the setting "database-type".
      • "database-type=sqlite" : Use the SQLite connector. This is the simpler option. No further database access configuration should be needed.
      • "database-type=mysql" : Use the MySQL connector. You will need to set the options "mysql-user", "mysql-pass", and "mysql-db", as well as having a working MySQL server installation set up already.
    • NEW: Log in to MineCraft as someone with 'simpleMarket.admin' permission, or use the Bukkit console. Use "/shop reload" to load the edited config file.
    • Use /shop add to fill the market with tasty blocks at scandalous prices.
      • You WILL want to use "/shop update default" to set up some sensible default values for the items you will be adding, so you don't have to do so much typing for every item. (Or at least inspect the Default entry, to be sure you agree with it.)
      • If you want to make all of the items in the shop use dynamic pricing, set up the parameters in the Default item FIRST, so you don't have to go back and modify 100+ items to support variable pricing.

    DynamicMarket.settings Reference

    • DynamicMarket (.jar) (.7z) (iConomy 4.1, Permissions 2.5)
    • DynamicMarket 0.4.8 (.jar) (.7z) (iConomy 3.0, Permissions 2.1)
    • DynamicMarket (.jar) (.7z) (iConomy 2.1 / Cookies+iConomy Wrapper)
    • DynamicMarket Source on GitHub
    • items.db <-- Contains subtypes. Put this in /Plugins/DynamicMarket/.
    • SQLite Connector (reccomended) Put this in your MineCraft server/Bukkit root.
    • MySQL Installation Guide (not so easy, probably not recommended for SQL server beginners)
    • Sample shopDB.csv Many (but not all) items, set up for floating-stock+floating-prices. Edit it if you like, then put this in your Plugins/DynamicMarket folder and use /shop importdb to load the items into your shop.
    DynamicMarket Wrapper Plugins:
    • DMWrapper: Restricts shop access to specific regions. Outdated.
    Want to integrate DynamicMarket's shop functions into your own plugin? Read this!
    To Do List(s) (open)

    To Do for v.0.5:
    • Logging of transactions. Done.
      • Global messages to alert to price changes.
    • Item classes: Use Permissions to control access to certain types of items, i.e. make safe items (gravel, stone, iron) available to anyone, but limit traffic in dangerous items (TNT, lava buckets, monster spawners) to VIPs. (For example.)
    • Customizable interface/highlight colours. Done.
    • Clean up the d*** out-of-date comments in the code. (Working on it.)
    To Do before 1.0:
    • Optional auto-transactions triggered by price disparities in raw/processed materials.
    • Possible migration of the new help system to a separate plugin, unless the expanded features needed become available in MCDocs or Bukkit.
    • Migrate config file handler to Yaml.
    • Random fluctuations of stock levels (would make the market more lively on a low-population server)
    • Stock levels drift back to rolling averages (smoothes out short-term price spikes, allows for long-term price drifting)

    Recent Changes:
    • Migrated to Permissions 2.5, iConomy 4.1.
    • shopLabel moved from a table name suffix to a table field.
    • Using "all" as the item name now applies the given tags to all items with the current shopLabel.
    • Altering an item's bundleSize now changes its stock level, as well as its basePrice.
      • New stock level is rounded down, to stave off future item duplication issues.
    • Sanity-check behaviour changed to make database queries more efficient and fend off future exploits:
      • stockHighest/stockLowest set to stock if lower/higher than stock.
      • stockCeil/stockFloor is set to stockFloor if lower/higher than stock.
      • priceCeil is raised to priceFloor if priceCeil<priceFloor.
        • Previous behaviours: Swap if order wrong, range-crop stock if outside highest/lowest/floor/ceil.
    • Fixed bug: Adding items without specifying count did not import count from default record.
    • Upgraded to iConomy 3.0.
    • Rolled back iConomy calls to 2.x style, to be compatible with Cookies' iConomy wrapper.
    • Support for transaction funds to be backed by an iConomy account.
      • Account link parameters added to wrapper-call messages.
    • Wrapper calls streamlined.
    • Added basic transaction logging.
    • Volatility can now go as low as 0.
      • In this way, stock can still be counted without affecting price.
    • CSV import/export now uses +INF / -INF as shorthand for min/max values in applicable fields.
    • Message colours now customizable in DynamicMarket.settings.
    • Expanded help on tags/presets.
    • Changed "fixed" tag, splitting its function with "flat".
    • Added tag presets "flat" and "finite".
    • Updated tag "renorm" to accept an optional new stock level other than 0.
    Full Changelog

    • Nijikokun: SimpleShop v.1.1, on which this was based. (And for Permissions and iConomy, on which this relies.)
    • AtomicAcidBath: Assistance with tracking down a hard-to-see MySQL syntax error.
    SoapFlakes and Mahngiel like this.
  2. Offline

    Nathan C


    /shop reset
    --- merged: Feb 16, 2011 9:10 PM ---
    Read my post above, you have to add some things to your CraftBukkit Manifest file.
  3. Offline


    0.4a r4 is up.
    • "/shop add" and "/shop update" should no longer cause NullPointerExceptions if you enter a malformed tag string.
    • The convenience tag "float" has been added, to undo the fixed-price setting of "fixed". (It just sets StockFloor/StockCeiling to -inf/+inf, and PriceFloor/PriceCeiling to 0/+inf.)
      • If you've set up an item and its price does not change when items are bought/sold, try "/shop update <id/name> float".
    Also, the tag reference file has been updated, to describe the tag input format more precisely.
  4. Offline


    What was strange is, when Craftbukkit first came out and I had some other plugin (I can't remember, was in builds #50 and lower) sqlite was supposed to be in the lib folder, and ever since up to this issue I had with a market plugin, it would work fine.

    Persistence had an issue first, telling me failing sqlite was occuring and not being found. However using NetherGate, the system still worked okay so I thought the error was a mistake or just a small error, yet I was curious why it would still give out an error when the other plugin ran sqlite fine.

    Once I downloaded this, as our server is going RPG style, it broke everything using SQLite but Persistence stayed fine with NetherGate, but the plugin that once used it in the /lib folder had broken. After a night sleep I added the Achievements and Stats (both plugins), and Stats (not achievements) downloaded 3 files - and said it fixed SQLite.
    Currently, my SQLite is STILL in the /lib folder and everything is working. The Market, the other plugin, and now Persistence is fixed.

    TL;DR - Stats plugin does something to SQLite but I just don't know what, but I'm glad all the issues with it are fixed. Everything runs great.
  5. Offline


    I extracted the Manifest file and modified it with a new classpath to the sqlite and MySQL jars, and put that back in the jar, and I still get the same error....

    I tried adding those classpath's to the compiler's classpath when compiling SimpleMarket, and same thing.

    Are you saying I need to recompile bukkit or craftbukkit with those jars in the classpath?

    I can't seem to figure out how to get this to work....
  6. Alternative connector driver fix without having to modify the craftbukkit jar - Start your server with:

    java OPTIONS -cp JDBC_DRIVER_FILENAME.jar:craftbukkit-0.0.1-SNAPSHOT.jar org.bukkit.craftbukkit.Main
  7. Offline


    No rush. I just poked around the source code and got what I wanted. Our solution was to set the maximum sell price no less than the minimum buy price. I like how this adjusts the price of batch buying and selling to be the same as if you bought or sold one at a time.

    Now, I might be mistaken, but I think this is wrong:
    In the comments:
         *  ivol = ln(2) / ln(1+(vol/intScale))
         *  vol  = (2^(1/iVol)-1) / intScale
    should be:
         *  ivol = ln(2) / ln(1+(vol/intScale))
         *  vol  = (2^(1/iVol)-1) * intScale
    This same mistake is made in setInverseVolatility.
  8. Offline


    hrm.... modified the classpath in both SimpleMarket.jar's MANIFEST and craftbukkit.jar's manifest, and finally got the driver loaded

    but now I get this:
    2011-02-16 18:04:58 [INFO] [SimpleMarket] Creating database.
    2011-02-16 18:04:58 [SEVERE] [SimpleMarket]: Error executing statement [CREATE TABLE `Market` ( `id` INT( 255 ) NOT NULL AUTO_INCREMENT, 'item' INT NOT NULL, 'subtype' INT NOT NULL, 'name' CHAR(20) NOT NULL, 'count' INT NOT NULL, `baseprice` INT NOT NULL, 'stock' INT NOT NULL,'canbuy' INT NOT NULL,'cansell' INT NOT NULL,'volatility' INT NOT NULL,'salestax' INT NOT NULL,'stocklowest' INT NOT NULL,'stockhighest' INT NOT NULL,'stockfloor' INT NOT NULL,'stockceil' INT NOT NULL,'pricefloor' INT NOT NULL,'priceceil' INT NOT NULL,'jitterperc' INT NOT NULL, 'driftout' INT NOT NULL, 'driftin' INT NOT NULL, 'avgstock' INT NOT NULL, 'class' INT NOT NULL PRIMARY KEY ( `id` ), INDEX ( `item`, `subtype`, 'name' )) ENGINE = MYISAM;] with mysql: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; che
    ck the manual that corresponds to your MySQL server version for the right syntax to use near ''item' INT NOT NULL, 'subtype' INT NOT NULL, 'name' CHAR(20) NOT NULL, 'count' I' at line 1
    2011-02-16 18:04:58 [SEVERE] [SimpleMarket] Database creation *failed*.
    looks like single quotes and back ticks are mixed there, also the PRIMARY KEY definition seems wrong for my MySQL, I got it to create the table manually using this query statement:
    CREATE TABLE `Market` ( `id` INT( 255 ) NOT NULL AUTO_INCREMENT PRIMARY KEY, `item` INT NOT NULL, `subtype` INT NOT NULL, `name` CHAR(20) NOT NULL, `count` INT NOT NULL, `baseprice` INT NOT NULL, `stock` INT NOT NULL,`canbuy` INT NOT NULL,`cansell` INT NOT NULL,`volatility` INT NOT NULL,`salestax` INT NOT NULL,`stocklowest` INT NOT NULL,`stockhighest` INT NOT NULL,`stockfloor` INT NOT NULL,`stockceil` INT NOT NULL,`pricefloor` INT NOT NULL,`priceceil` INT NOT NULL,`jitterperc` INT NOT NULL, `driftout` INT NOT NULL, `driftin` INT NOT NULL, `avgstock` INT NOT NULL, `class` INT NOT NULL, INDEX ( `item`, `subtype`, `name` )) ENGINE = MYISAM;
  9. Offline


    when you go ingame do /shop reset and it should fix it
  10. Offline


    and then I get this:

    2011-02-16 18:18:57 [SEVERE] [SimpleMarket]: Error executing statement [DROP TABLE 'Market';] with mysql: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Market'' at line 1
    2011-02-16 18:18:57 [SEVERE] [SimpleMarket] Database table could not be deleted.
    again with the single quotes.....

    looking at the source code, it appears as if all the SQL statements are using single quotes instead of backticks....
    --- merged: Feb 16, 2011 11:24 PM ---
    ok... it looks liek when he updated r4, the source zip file wasn't updated =( I thought I was compiling the newest version, but I guess not... I re-downloaded the new r4 jar and it seems to be working so far.... I'll report any issues
    --- merged: Feb 16, 2011 11:27 PM ---
    ok, so it created the table correctly this time, I tried /shop reset for shits and giggles, the drop table still has single quote for the MySQL statement.

    Also, /shop help remove crashes the client ( I think this happens when the line sent to the client is too long )
  11. Offline


    is there a way to just sell something and not be able to buy something -vise a versa-.
    --- merged: Feb 17, 2011 1:15 AM ---
    also no matter what I do it keeps saying unknown instead of the actual name
    --- merged: Feb 17, 2011 1:18 AM ---
    nevermind I fixed the 2nd issue but i'm curious on the not being able to buy but sell something.
  12. Offline


    hi im still getting the DB connector could not be found. im running CB 326 and mysql server

    thanks in advanced
  13. Offline


    No, that's not normal at all. (Not that it's uncommon, I'm afraid, just that it shouldn't be happening.) What errors come up in your Bukkit console/log?

    Exactly the sort of thing I was suggesting a few posts back... Thank you for supplying the fixed command-line. (Still working on making SimpleMarket not need that sort of hack at all...) Fixed in r5 (I hope). SimpleMarket now has the database connector classpaths listed in its own MANIFEST.MF, so with any luck, this problem should go away for good now.

    Yes, I believe you're correct, the comments are wrong. :) I did the early formula work with OpenOffice Spreadsheet, derived the formulas needed, copied them (incorrectly) into comments for easy reference, then set about writing the code. The code failed for several reasons, due to silly things like "+" instead of "-", forgetting to use intScale, and so forth. By the time I got around fixing the code, it was Very Late Indeed and I clearly didn't back-port all the corrections I had made to the java code into the comments.

    Still planning on doing a cleaned-up writeup about the calculations used. Some day, I might have to fix and/or rebuild this thing, and I don't want to repeat any more work than I have to. :)

    Ah. When I was fixing the SQL, I fixed the DatabaseMarket class, but not the DatabaseCore class (which it inherited the table deletion method from). Fixed.
    That's...bizarre. "/shop help remove" has a very short help text. There's no reason it should crash the cliOH CRAP IT DOES WTF.
    Oh wow, there was a nasty bug in the routine that generates the header line. Fixed in r5.

    Absolutely. You can use the tags "canbuy:n", "!buyok", or "nobuy" to turn off an item's buyability, and use "canbuy:y", "buyok", or "!nobuy" to turn it back on. (The exclamation point prefix is an abbreviation for "not".)
    Similarly, you can use "cansell:n", "nosell", etc., etc. to turn selling of an item on/off.
    The SimpleShop-style usage of setting either the buy price or the sell price to "-1" also works, but it's a bit more of a hack.
  14. Offline


    great plugin so far man, thanks for all the great work, I had just tracking down that headerify message myself when I thought to check here, and low and behold, you seem to have tracked it down before me already ;)

    It was affecting other /help commands to, but I was spending some time figuring out the bit of wrapping you've done on all your help output stuff. That and figuring out the quirks of the eclipse debugger. I'm just starting to use eclipse, so I'm getting my feet wet trying to do some live debugging of the minecraft/craftbukkit server running out of the debugger. I'm more used to Visual Studio's debugging, and just even the re-mapped debug stepping keys throws me completely off. I couldn't for the life of me figure out how to get the last functions return value either ( for debugging those lines with multiple function calls ).

    Would be nice to have this on github too ;) I could just git pull instead of downloading ur 7zip, then unpacking the source files over my src dir...

    Again, thanks for the great work so far!
  15. Offline


    Well, on our server we are trying to get it to do things in the dynamic fashion stated in the the first post. We have items updated and everything works *but* the dynamic bit. How can i mass change the items in the shop to be dynamic?
  16. Offline


    If its somewhere, let me know - Otherwise - Is there any way you can explain on the Tags and what they do?
    I see you have examples of them - but not all. /shop help tags does give an example, but some of the examples go away when i run commands/chat. Anyway you can place them here? Would be much appreciated.

    If you do have explainations on all of them point me to them >.> (not the examples on the OP section)
  17. Offline


    Never used github before, but it seems popular. I'll look into it.

    There's a few ways you can do this.
    (1) Go back in time to just before you added all those items. Update the Default item with the appropriate values for dynamic pricing (i.e. Volatility, StockFloor/StockCeiling, etc., depending on how wildly you want the prices to vary and if you want any limits placed on price increase/decrease - but definitely make StockFloor not equal to StockCeiling, or Stock will be fixed at one point.) Return to the present, and let your past self enter all of the shop items, which will copy most of their data from the Default item, thus making them all dynamically-priced. (Be careful not to observe the results before you have left for the past, or you may cause an unstable time loop and be erased from existence, corrupting the database in the process.)
    (2) Use "/shop -u <id> float" one at a time on all of your shop items. This may not be the sort of "mass change" you were looking for, and will give you very little control over the speed of price fluctuation vs. transactions (unless you also use the v: tag on each item to set volatility), but it's simple and effective.
    (3) Wait until I've finished the 0.5 4.1 update, at which point, you will be able to use "/shop export" and "/shop import" to dump the shop database to a spreadsheet file, replace the desired values using whatever your spreadsheet program's column-fill-downwards command (usually but not always Ctrl-D), and re-import the spreadsheet into the shop database. It should be ready in the next day or two. (EDIT: Guess what just got posted? :) )

    If you do go with option (1), you should probably message past-me and tell me to make the proper use of the Default item much more obvious, because lots of people seem to be missing how to use it, and then wondering why the shop's prices remain fixed. Clearly, I've been getting a little too much into Homestuck, if this seemed like logic.

    In the OP, the blue text marked "Tag Reference" - that's a link to a file which describes all of the tags in full.
  18. Offline


    Found it! Was being sneaky... haha.
    Currently having an issue though. When I set the default stock to start off at 64 (bundle size is 1) with all items the stock starts at 0 (unable to buy when at 0) and when I go to sell the items - the stock isn't updated. I'm checking with the tags but I'm not sure what I might be doing wrong...
  19. Offline


  20. Offline


    Let me guess - you haven't changed StockFloor or StockCeiling from 0, have you?

    Now that's a nice way to report errors. :)
    Your command is mangled. It looks like you're trying to add arrows in batches of 1 to be bought for 25 and sold for 50. If that's what you really wanted, the format would be: "/shop add 262:1 25 50".
    Although SimpleMarket will sanity-check that, and reset the sell price to 25 (minimum SalesTax = 0), so no, you can't let your users turn your shop into an infinite money-fountain.
    If you meant it the sane way, use: "/shop add 262:1 50 25".
  21. Offline


    thanks that worked maby you should be more clear with the ingame help :D
  22. Offline


    Dynamic pricing are really cool 8)
    So how about add some physic interactions for sell/buy actions like signs, chests or npc? It will send this plugin to unreachable hight ^^
  23. Offline


    this is greatness it works very well, any way to store the actual buy/sell prices on the DB?
  24. Offline


    I guess not >.>
    Never used a dynamic market before so it is rather new, used to always just have fixed prices. Thanks for the help, hopefully I won't have much more problems, if any.
  25. Offline


    yeah I just used the -1 and it works fine thank you and I hope you continuw qith this plugin I love it and it works perfect, btw if it helps anyone who wants to use this i'm running craftbukkit 328 with about 20-25 plugins so go for it.
  26. Offline


    It says you've released .4.1 but in the console it's still reporting .4a and the /shop export or /shop exportdb commands don't work.
  27. Offline


    To recap the in-game help:
    /shop help:
    -- SimpleMarket (Caribou) ---------
    [] Required, () Optional, <> Parameter
    (snip: command list)
    /shop help add:
    /shop add <id>( :<bundle>) (<buyPrice> (<sellPrice>)) <tags>
    Adds item <id> to the shop.
    Transactions will be in <bundle> units (default 1).
    <buyPrice> and <sellPrice> will be converted, if used.
    Prices are per-bundle.
    See also: /shop help tags
    /shop help tags:
    Tag format: <tagName>( :<value>) (<tagName>( :<value>))...
    n:|name: - Name/rename item
    bp: - Base purchase price @ (stock=0)
    s: - Current stock level. (Can be negative)
    (etc, etc...)

    Now, I might just be cranky because I haven't had my second coffee yet, but...

    :mad: The in-game Minecraft text display is not well-suited to huge dumps of information, being limited to about 50 columns (depending on the proportional-width font rendering, there being no currently easy way to determine the true line-wrap point from code) and about 7 rows that don't instantly disappear. As such, I presented the command format in-game in condensed form, describing the input format and the input-format-format (the line describing which brackets mean what, right at the top of the help root.) It's even colour-highlighted, for goodness sake. Cramming more descriptive text in would make the result more unclear; stripping out text would make it less informative. If you can't follow brackets and colour-coded highlights, read the OP in this thread instead, where there is room for paragraph-long explicit instructions plus examples. The MineCraft client is not a PDF reader, and Bukkit currently does not have the API to turn it into one from server-side. :mad:

    I talked about plans for this earlier in this thread, but I'll summarize: I plan on eventually giving this plugin the ability to be "hooked" by other plugins, which would then allow for shop access to be controlled programmatically. That way, other plugins could implement shopkeeper NPCs, sign shops, shop regions, etc., etc., and call SimpleMarket whenever appropriate. You know, modular design. :)

    I'm not sure I understand... you want the plugin to store fixed buy/sell prices internally, instead of having them as dynamically-calculated fields? You may wish to use SimpleShop instead, as it already does that.
    The default mode of this plugin supports fixed buy/sell prices, which can be entered and used as such, even if their internal representation is BasePrice(@stock=0) and (BasePrice(@stock=0) * (1-SalesTax/100)). Storing the buy/sell prices as fixed values would break the ability to have them dynamically recalculated. :(

    WTH... Link didn't update. Fixed now, my apologies.
  28. Offline


    Console still printing .4a and /shop export or /shop exportdb aren't recognized.
  29. Offline


    Did you reload the page before clicking the download link?
  30. Offline


    I mean, came back to this thread only after you replied to my message.
    --- merged: Feb 17, 2011 9:46 PM ---
    Sorry, I'm just an idiot... All this time, I'd copy the plugins into the plugin directory while the server was running and just reload the server... Did not realize this was not working =/
  31. Offline


    No worries... Yeah, /shop reload just reloads the configuration files for the plugin - it doesn't actually reload the .jar. There are plugins which can handle unloading/reloading of other plugins, but I don't believe a plugin can signal to Bukkit to completely reload itself from the .jar. (If I'm wrong about this, somebody please correct me, as that would be a very handy feature.)

Share This Page