Citizens NPC trader discussion

Discussion in 'Bukkit Help' started by fullwall, Mar 8, 2011.

Thread Status:
Not open for further replies.
  1. Offline


    This is a thread for my Citizens NPC plugin (check my sig for the link) to discuss how NPC traders should be implemented. Basically, there are any number of ways to do this, so I need some input on how you guys think it should work!

    Also - databases. Y/N?

    My rough draft plan is as follows. Have an item ID set to be a 'selection' tool. Players can create a set number of NPC traders that are personal to them. Using the selection tool, select an NPC. If you are its owner, you can then use /trader stock [item ID]:[amount] to add items from your inventory into its inventory. Use /trader buying [item ID]:[amount]:[price] to set what it is buying, /trader selling [item ID]:[amount]:[price] to set selling. /trader retrieve [item ID]:[amount] to get back given items.

    This idea was contributed by fugue2005 and seems the most natural - users interact with the shop by rightclicking the NPC. They can then drag items into the NPC's inventory to sell, and drag from to buy. Of course, only items specified being bought/sold can be used. I may make the user quit out of the dialog at this point and then have a confirmation section so they know the price. The user can use /trader list [name] buy /sell for a full price list.

    Feel free to submit your own plans/add to mine.
  2. Offline


    real shop does trading via chests, you open a chest to see what's available and you buy whatever you take out.
    i would love to see it implemented where you can tap the npc and it opens a chest gui.

    you already have the code for the npc to interact with you when you enter a certain distance, you could have it respond to "list 1" "list 2" to get pricelists
  3. Offline


    Sounds like a good idea.
  4. Offline


    If you decide to implement the chest shop idea above (Hopefully with iConomy), I think it would be awesome if you also did the same with the questing idea. Maybe have different quests, like say, gather 5 diamonds, then when the user has the 5 diamonds, he comes back to the npc and does /quest or something, the quest chest opens up and he can put the diamonds in to complete the quest to get a reward(s)? Idk, just a thought. Great work so far though!
  5. Offline


    Yep, that solution seems the most 'natural' way of doing it.
  6. Offline


    mysql for the database Please keeps disc access low and any competent server admin is using it anyway.
    please allow users to set there own prices on things, dynamic markets are all very fancy but remove from the player the real supply and demand factor of "im the only one selling it i will charge high" and "hmmm thats a bit pricy i can sell that lower "
    love the chest gui idea if possible, the price display as a tooltip?
  7. Offline


    Will you make iConomy support for this? please make it ;)
  8. Offline


    Tooltips - most likely not :S. Minecraft editing probably doesn't extend that far. But yes, users will be able to set their own price (that's what the individual traders are for.).
  9. Offline


    tool tips ...shame but understandable
    own prices ...Cool

    also iconomy support would be nice as much as i dislike iconomy (it has a habbit of ruining my day) its mysql compatable and well used
  10. Offline


    Hey man, really dig the npc plugin.
    How's this; kinda along the same lines as other suggestions. (fingers crossed iConomy support)
    Option for server based trader (infinite items or not) or player made traders. For private shops.
    To make an npc trader you create a npc and link it to a chest. You set they buy and sell items list on the npc.
    something like; /npc steve buy [id][amount][price] or /npc steve sell [id][amount][price]
    You then go and open the chest, buy or sell whatever. Npc then lists transaction, maybe moves to the chest and back from its current position. Npc should be able to list how much stock its still buying or selling without looking in the chest. Or some other non-command based interaction method.
    Just my 2-cents, keep up the good work bud.
  11. Offline


    I don't like linking to chests. I think it'd be cooler anyway to directly interface with the NPC's inventory.
    Iconomy support is definitely being added btw.
  12. Offline


    Databases are great for those who want it, but I feel you should always have an option for flatfiles as well.
  13. Offline


    Yes. I plan to start off with flatfiles, then move to databases.
  14. Offline


    Here is some of my ideas :)

    - I like the idea of customers using GUI to buy, is it possible to let the owners restock the NPC drag-n-drop style aswell?

    - Serveradmin should be able to:
    *Restrict how many NPC's each user/group are allowed to create.
    *Set max limit for how many different items each NPC are allowed to sell/buy (but still allow to
    fill up the entire NPC inventory with several stacks of whatever items they choose)
    *Blacklist spesific items from being traded

    - Two different inventory per NPC possible? One for sell, and one for buy, that would be sweet ;)

    - Possible to let the NPC sell other stuff, like land lots?
    Imagine having a skyscraper apartment building, with an NPC in the lobby selling/renting out the rooms.
    Or having a NPC in the Town Hall selling predefined lots around the city

    - What are the max character limit in NPC names?
    It would be nice being able to extend NPC names to lets say 2 lines, 20 char each. That way the names could be really descriptive of what the NPC is selling.
    Imagine a large shopping mall with several stories of small NPC shops. Customers could then just read the NPC names from distance, knowing exactly what shop to go to. The names could be like:

    "Diamond, iron, stone
    cake, bread, coal"


    "Johnny's Food, tool
    and armor shop"

    - Instead of making the customers type a command to get the pricelist, would it be possible click the NPC with a specific item instead?
    For instance, clicking with empty hand = access to buy inventory,
    click with any tool = access to sell inventory,
    click with any block = get pricelist.
    Or something like that
  15. Offline


    Interesting. I will mull over your ideas before sleep. Different inventories... definitely possible. I'm not sure of the NPC name limit. Perhaps you want to test for yourself? Restocking drag/drop style sounds good. The one thing with item = pricelist - how do you handle different pages? Blacklisting item types is possible, as is max different buy/sell types.
  16. Offline


    My ideal NPC would announce that he sells stuff when you get in range. Upon right-clicking bring up a table with items to buy/sell. Then use a simple command like /npc buy cobble 10. That would require selecting which npc you are buying from by clicking it. Also, infinite inventories is a must for town/server shops. Thanks again for the plugin
  17. Offline


    These features are being added. Perhaps even more simply than you imagine :).
  18. Offline


    I can test to find max name limit. Do you think its possible to add an second line?

    Don't know how to handle multiple pages. An alternative is to differentiate between right and left click, to show page 1 and 2. And mabye use another item to get page 3 and 4.
    But this is not an optimal solution.
    If the NPC remember the last click, you could do a second click to get page 2, third time it will show you page 3, and so on. But this might introduce unneccessary disk access/server load?

    What about using NPC to sell lots? I guess it would need to be compatible or integrated with WorldEdit/WorldGuard or some other zone plugin somehow.
  19. Offline


    \n might make a new line. Remembering the page number means that the NPC has to remember which page number each player is up to or use a shared page number (in which case multiple players looking at same NPC would be hard to handle). Yeah it would probably have to be integrated with another zone plugin. That's most likely an end plugin.
  20. Offline


    What do you mean by an end plugin?

    As a compromise you could use the right click for pricelist method, and then type /nextpage or something.

    At least it would be easier then typing /trader list [LongTwoLineName] buy /sell
  21. Offline


    A suggestion that I saw on the NPCTrader thread; Make it possible for an NPC to sell 'healing' so you can have a chapel or somesuch, with a healer that could heal you for a fee.
  22. Offline


    i dont know if its been brought up, but unfortunate to the iconomycheststore they can only have 1 item on sale per chest. i'd like to see an npc have multiple items for sale. also the comment in regards to him announcing what he's purchasing and selling is nice.
  23. On my server, we have a bank set up where people trade iron, gold, and diamond for sponge (the server's official currency). This system has worked very well, but we aren't always there to trade for sponge when the players want to.

    Would it be possible to trade for sponge from multiple items at different exchange rates? (ex:1 Iron is 1 sponge, 1 Gold is 2 Sponge, or 1 Diamond is 20 Sponge).

    And even better: Give NPCs the ability to reach into any chest inside of a given zone, or by putting a sign above a chest with the NPC's name on it. This way, Players could just put items into the chests around the NPCs as if actually setting up a shop.
  24. Offline


    What I would really like to see implemented is for admins to be able to make non-player shops, as to be able to create npc towns, no money to or from the creater, just a neutral shop.

    As for the general feel of the traders, a chest GUI would be preferable, as stated before in this thread, if at all possible having you add items via drag and drop as well, however setting prices this way would be difficult to say the least, my main concern with text based shopping is the item ID's and long commands, so how bout, you fill your "chest" (npc) with items, then, /npc slot 1 200 (where 200 is amount of coins) this is the only way I can see a drag and drop being put in, then again, I'm not a coder.

    Thank you for the work you're doing, and happy coding!
  25. Offline


    I did a test, seems the max char name limit is 88 (!)

    However, it won't accept spaces. So "John Doe" gets cut down to just "John".
    I also noticed that it will accept all type of symbols, and at one point when I wanted to delete all with /npc remove all, one NPC was left standing. Deleting him manually with /npc remove [name] didn't work either, saying no NPC with that name was recognized. Maybe due to some symbol in the name messing up the config files?

    So, if it doesnt introduce any problems, allowing space in the name would be nice. Also escaping or converting any symbols that may cause problems.

    \n directly into the name did not make a new line btw.
  26. Offline


    Hey fullwall,
    first, thank you for programming this difficult kind of plugin.
    Im sure you know this plugin: NPC-Trader
    What I found out is, that many players on my server thought it is too complicated. Many Mincraft players just want simple functions for trading stuff. For example you should have a look on this one: RealShop
    A combination of both would be very nice. Like this:
    I create a NPC with "/npc create <Name> trader"
    The Trader-NPC has a inventory like a chest where i can buy and sell stuff. With simple chat-commands like /npc shop <ItemID> <BuyPrice> <SellPrice> i am able to setup what kind of items the NPC will buy or sell.
    That would be very nice.^^

    I have two kinds of trading options on my server. A global shop (SimpleShop) where players can sell gold to earn money and buy rare things like leaves or glowstone, and the RealShop plugin, so that players can easy sell their stuff in chests.
    So, another cool thing would be that admins can make traders without bindings to a player, where a player can sell and buy to the "world". With that, i could disclaim the SimpleShop and use your NPCs only.^^

    Hope i was able to explain what i mean. My english is not the best and english-teachers in germany are just idiots...^^
  27. Offline


    This! I also use RealShop but would love to have a simple trade item for item option as well.

    I would also love to not have to use item ids anymore. FWIW, I implemented item selection by name and anyone working on plugins that require users to select items by id are more than welcome to the code: . Look at src/main/java/com/iminurnetz/bukkit/util/ and src/main/java/com/iminurnetz/util/ to get you started.
  28. Offline


    I would love an option to have a server owned shop, I'm using DynamicMarket and its great for letting my users buy nether items or diamonds and I know most of them would hoard their items rather than sell them lol
  29. Offline


    I know how to use Item IDs and names as well instead of item IDs. I will use some of your suggestions :). Keep 'em coming!
  30. Offline


    Would it be possible for money to be automatically deducted and added as you carried out a transaction?

    So if you moved 64 cobble into your inventory from the shopkeepers inventory it would deduct the price directly from you but if you diddnt have the money the cobblestone would dissapear and return to the shop.

    That way looking at the price list via a command wouldnt be necesarry unless you wanted to check if it was cheaper elsewhere.
Thread Status:
Not open for further replies.

Share This Page