Item flags and shop vendors

Started by Carduus, March 14, 2003, 03:12:07 PM

I guess I'll get right to the point. Without revealing anything too vital, how exactly are vendors coded as to which items they accept?

From what I've seen, they seem to be divided by function of the item(tablet, archery supplies, instruments, etc). But many vendors have themes in which a specific material is featured (wood, clay, etc). But despite this theme, they often won't buy items that fit their theme. Is there, in fact, a material flag, and can it be used for shopkeepers?

The reason I ask this is because I have now come upon maybe half a dozen cases in which a vendor will accept or is currently selling an item of the exact same physical properties of the item I'm trying to sell them, but says they won't buy the item I try to sell them. Should I submit these as bugs, or just suck it up and decide the vendor is fickle?

Its really an OOC thing, if its anything like the building behind most muds, items have a 'type' flag, like -armor, weapon, pill (edible items like... cure poison), wand (probably not in armageddon), clothing, food, furniture, fountain, trash, jewelry, component, container, etc.

Now a shopkeeper is flagged like... Shop-type 1 armor, shop-type 2 weapon, etc... with a max of like 5. (at least in Rom)

So depending on how a shopkeeper is flagged, if they are- some are just sellers not buyers - they will or will or will not buy your item, which may be flagged differently then you think.

A tarantula fang maybe be a fang, but it might also be flagged usable as a  weapon... and thus sellable at weapon shops that actually buy (There are quite a few that just sell.) Same for things like claws or beaks maybe? Not really sure.

While other things... like an odd little knick knack might be a bit harder to find a place to sell it at. because of how it will be flagged.

Some shopkeepers won't buy items of the type they sell, many won't even buy back items you just bought from them.  Why would they want it, when they have plenty already?  You may notice some merchant will buy an item, and say they have too many if you try to sell more than 5, but the item never appears in their shop inventory; I assume these are items they are buying for personal use, and not as a clearing house.  Some merchants will buy raw materials but only sell finished goods.  Some buy food but don't sell it, I assume these NPCs are crafters but not hunters, so they use the profits from their crafting to buy food for their people.

Sometimes they buy a type of item, but won't buy yours because they consider it worthless.  Like you might find a shop that will buy 2 of the 3 types of branches you have to sell, but not the third type of branch.  You trek around the world with your unwanted branch, and eventually find a shop that will give you a coin or two for it.  I think this is affected by what % of the value they are willing to pay for an item, some shops are willing to pay 1/2 or even 2/3 or more of the value for some items, other shops will only pay like 1/6 of the actual value.  If the amount they are willing to pay drops below 1, they usually won't buy it, although occasionally you'll find a merchant willing to offer you 0 coins.   :?   This happens with many  foraged or found materials, and a few skinned items.

Other times the item has more than one property, and they won't buy it because of an undesirable property.  Many NPCs that buy clothing will not buy clothing that is also a container, even if they sell such clothing.  So green silk pants with pockets can be harder to unload than green silk pants without pockets.  Likewise you might find someone willing to buy most of your wood or stone creations, but not if you have shaped the material into a box or vase, because they don't buy containers.  You need to find a container shop, or just give these items away as gifts.  Style can come in here too, with some shops refusing to buy cheap items, and others refusing to buy fancy items.  You might find a shop that will buy most kinds of izdari pieces, but not plain sandstone ones.

Sometimes the reason is even more incomprehesible.  I've had items that I found could only be sold in one city, no shop in the other three major cities would take it.  But in the single location that buys it you might get 12 coins so it isn't a worthless item, just one that not many shops want.  I have no idea why.  

I know this is the Code Discussion board and I don't have anything useful to say about the code, I don't understand code issues, but I thought I'd chime in anyway.  My guess is that in many cases the ommisions are deliberate, so that you don't get 5 or 6 NPC shops in one city willing to buy a particular item, allowing a PC to get rich by glutting the market.  My only advice is that if you think something may be valuable, hold onto it and try to sell it to every NPC merchant you find, eventually you should find someone who wants it.  Or try to sell it to a PC, PCs will buy all sorts of strange things if you give them a good reason to buy it -- think like a sales person who works on commison.   :twisted:

AC
Treat the other man's faith gently; it is all he has to believe with."     Henry S. Haskins

Quote from: "Jenred"Its really an OOC thing, if its anything like the building behind most muds, items have a 'type' flag, like -armor, weapon, pill (edible items like... cure poison), wand (probably not in armageddon), clothing, food, furniture, fountain, trash, jewelry, component, container, etc.

Now a shopkeeper is flagged like... Shop-type 1 armor, shop-type 2 weapon, etc... with a max of like 5. (at least in Rom)

Yeah, I built for a while in Diku a few years back, and I understand the system in that aspect. I guess I was wondering whether Arm had implemented any additions or complexities. Guess it would have been smart to mention that. Sorry.


Quote from: "Angela Christine"Other times the item has more than one property, and they won't buy it because of an undesirable property. Many NPCs that buy clothing will not buy clothing that is also a container, even if they sell such clothing. So green silk pants with pockets can be harder to unload than green silk pants without pockets. Likewise you might find someone willing to buy most of your wood or stone creations, but not if you have shaped the material into a box or vase, because they don't buy containers. You need to find a container shop, or just give these items away as gifts. Style can come in here too, with some shops refusing to buy cheap items, and others refusing to buy fancy items. You might find a shop that will buy most kinds of izdari pieces, but not plain sandstone ones.

It might be nice if the shopkeeper mob itself understood these subtleties to the point of saying what about an object s/he doesn't like. "I don't buy (sandstone) here, try the Sera Khi, you son of a kank!" , or something of the like. If they have a weird quirk, I think it should be brought IC rather than force the PC to assume that shopkeepers are fickle.

It also gives them personalities as individuals rather than just as tools that you spam into their hut, test to see if you can sell them some of the items you have, and leave. I'd like to know what it is about my wooden cup that makes it different from the 2 wooden cups he's selling, and maybe I'll get a better idea of what he does want, and be able to cater to him specifically.

And in regards to things like items with pockets versus ones without, that's more of an example of roleplay made to fit around a fault in Diku code rather than having code that supports roleplay.

I cringe to suggest adding anything to the extensive item code, but maybe the ability to set multiple primary flags on an item (ala, container and clothing) might be a way around this problem so that these quirks you talk about can be intentional rather than side effects of code issues.


I really don't mean to be as cantankerous as I seem to be coming off, I swear.

Quote from: "Carduus"
I'd like to know what it is about my wooden cup that makes it different from the 2 wooden cups he's selling, and maybe I'll get a better idea of what he does want, and be able to cater to him specifically.

I'm not sure if this was a throw-away example or the item you are actually disgruntled by, but I've noticed cups and jugs are particularily tough to find NPC buyers for.  My guess is that this is a deliberate thing, to discourage people from scouring the taverns and "stealing" a tavern full of empty cups, flagons, and pitchers and then selling them.  Rather than giving this items an ownership flag that gets you arrested if you try to re-sell them, like militia gear does, you can't sell any cups at all.  Things may have changed since the last time I had a cup-crafting PC, but last time I tried (more than a year ago) I couldn't find any shop willing to buy my cups, flagons, mugs, or pitchers, so I stopped trying to make them.  

AC
Treat the other man's faith gently; it is all he has to believe with."     Henry S. Haskins