Coin Masters New Features

Veracity

Developer
Staff member
I've just spent a considerable amount of effort refactoring this subsystem to make it easy to add new instances. I tested it by adding Mr. Store and the Traveling Trader and (although the latter is obviously untested), it was about as easy as I'd hoped.

I'm going to take a break from this - possibly for quite a while - but I'd like to put out two future projects associated with this that I think would be good - maybe even for somebody else to do. ;) - with an eye towards turning them both into Feature Requests after we've discussed them enough to work out the requirements/specification.

1) What about an API - a way to trade tokens for items via the various Coin Masters in CLI and/or ASH scripts without having to hardcode visit_url() calls. I'm pretty sure this has been mentioned elsewhere, but my cursory search did not find it.

- We need a way to visit specific stores
- We need a way to trade - buy or sell - specific items.
- Do we care about specifying which store to get specific items from? They are unambiguous, so far.
- How about "acquire" or "retrieve_item()" integration?

2) Integration with the rest of Item acquisition. Much as we have autoSatisfyWithNPCs and autoSatisfyWithMall, we could have autoSatisfyWithCoinmasters. We have something in this direction already for a specific set of items: coffee pixie sticks, game shoppe items, and the new Lunar Lunch-o-Mat items are all hard-coded into the ConcoctionDatabase and the InventoryManager's "retrieve item" functionality.

I'm thinking those - and all other Coinmaster items - could be done more like NPC items as being marked "creatable" and having a "price". Just like the Food panel has "fortune cookie (40 Meat, 0 current)", a Coinmaster food/booze for which you have the appropriate token in inventory could show up as "bowl of Bounty-Os (1 filthy lucre, 0 current)" or "Saison du Lune (10 lunar isotopes, 0 current)" - IF you have enough tokens of the appropriate sort on hand.

What about Purchases? Right now, we have MallPurchaseRequest which goes either to the Mall or the NPC stores. We should have PurchaseRequest subclassed into MallPurchaseRequest, NPCPurchaseRequest, and CoinMasterPurchaseRequest. If you search for "dolphin whistle", why not show the mall results, as now, but also show "Big Brother (unlimited @ 1 sand dollar)", just like "wad of dough" shows "Degrassi Knoll Bakery (unlimited @50)".

We have all the knowledge about which NPC stores are accessible - zodiac signs, outfits, what have you - built into the NPC Store Database. Currently, all of that for Coin Masters is encapsulated in the Coin Masters Frame - the GUI. It would have to move into the Coin Masters Database (or Request) so that non-GUI uses - Item Manager, Purchases, CLI and ASH scripts - could use it automatically, just like NPC stores.

Given all that, do we want "buy" to go to Coin Masters? I think not; I think that should continue to be Meat-only. So, we'd have "trade" to do the equivalent.

---

Anyway, I throw this open for YOUR thoughts. What do YOU need in an API? How else would YOU like Coin Masters to be integrated with the rest of the system? And, especially, how do you see the new functionality integrating with existing functionality, like "buy", "acquire", "eat", and so on?
 

fronobulax

Developer
Staff member
Not ignoring this, just have no substantive comments. I like the idea that buy, acquire and similar functions could all obtain an item from somewhere without me having to know where that somewhere is, or which currency is used, so integrating CoinMasters support would be good. But I am not likely to be scripting in such a way that I "push the envelope" on this.
 

StDoodle

Minion
Just wanted to mention I'm also in frono's boat; nothing substantial to add, but this does look very nifty. :)
 

Veracity

Developer
Staff member
I just found GValko's inquiry about Invoking Coinmasters from ASH thread. You wanted it, GValko. What, exactly, do you want? :) From your thread, you want to sell items.

Bale's Store Credit script also wants to sell. What would make your life easier, Bale? Simply trading in items for store credits? Do you want a way to query details of a Coin Master (do we need a data type?) like the items it will buy or sell, the token, whatever?
 

Bale

Minion
Trading in items for store credit would obviously need a different command than acquire, or retrieve_item(). I'm not sure what sort of command would be used for that, perhaps tradein(item)?

It would be good to be able to query token types so that I could check to see if I have enough of them to acquire an item. It might be best if the token type returned was a string so it could be "store credit" or "meat".

string purchase_type(item)
 

StDoodle

Minion
Upon further review, the original outline for a "how-to" seems like a great idea. I also think one more thing that would be neat to move into CoinMasters would be pixels, perhaps.
 

Veracity

Developer
Staff member
All the "hard" stuff is done - the integration with other ways to acquire items. All that remains is the CLI/ASH api.
I disagree with pixels. Those are a Create method, and you can trade them in handily that way already.
 
As far as integration goes, how would, say, acquire() determine the value of meat vs. tradeable items? Like with the dolphin whistle example, I have sand dollars, or the mall. Would "trade" simply go above or below mall in the acquire order of operations? Or would I be able to rank my items by value (Preferences->Sand Dollar: [750] meat)?

I haven't looked too extensively into the new coinmaster ASH functions yet, but aside from this, everything else looks good, and should make coding retrieval of said items much much easier.

Also, is there a proxy record for items that can be coinmastered detailing which master holds them?
 
Last edited:

Veracity

Developer
Staff member
That is a very interesting question. I wondered how to compare buying completed item in mall vs. using available tokens only vs. buy enough missing tokens enough to purchase with tokens. There is already a mechanism to compare buying completed items vs. buying ingredients and crafting.

In some sense, trading tokens to a Coin Master is like creating an item from ingredients.
It is also like trading meat for items at an NPC store.

Currently, the latter similarity is fully exploited, but the former similarity is only slightly used - enough for Coinmaster purchases to show up on the Item Manager as "creatable".

I suspect that in order for Coinmaster purchases to fit "correctly" into "acquire", they need to be thought of as "creation" of concoctions.

As currently coded, it is very simple:

Item acquisition via acquireUsingCoinmasters is checked before item creation from on-hand ingredients, mall purchase, item creation via purchase of some of the ingredients, user buy scripts, and the whole cheaperToBuy, priceToMake & priceToAcquire stuff that is already there.

If you want to use coin masters, it will try to "acquire" enough tokens - using existing ones or purchasing enough, if you say to use mall, stash, whatever - with no regard for whether it is cheaper to buy the final item or the various tokens.

I have put off merging coinmaster purchasing into creation. Perhaps it is time.

Regarding the proxy field, that is a good idea and should be easy to code - for now, when there is a single coinmaster which sells a particular item. We also probably need two: one for the buyer and one for the seller.
 

Veracity

Developer
Staff member
I suspect that in order for Coinmaster purchases to fit "correctly" into "acquire", they need to be thought of as "creation" of concoctions. I have put off merging coinmaster purchasing into creation. Perhaps it is time.
Revision 9568 does this. Items that are acquirable via coinmaster purchase are now internally marked with the COINMASTER creation method, which is permitted only if you have autoSatisfyWithCoinmasters set. If you use the creation queue, you will notice that queuing an item that costs lunar isotopes, for example, will decrease the number available of all items that cost lunar isotopes.
 

Zheel

New member
Excuse me if this is an inappropriate place to ask this, but I can't seem to figure it out myself. Is there any way to determine in an ash script the coinmaster-sell-value of an item? That is is there a way of asking mafia "what can I receive from a coinmaster for a blue class ring?" and being told "3 dimes"?
 

Bale

Minion
More generically:

PHP:
void price_check(item it) {

   coinmaster master = to_coinmaster(it.buyer);
   int price = buy_price(master, it);

   print("1 "+ it
      +" can be sold at the "+ it.buyer
      +" for "+ price +" "+ master.token );

}
 
Top