Page 1 of 1

Improved market customisation via set_market_item

Posted: Sat Dec 22, 2018 4:03 pm
by Anyone
When you use custom event-like stuff for markets, you get a big red plus sign in the market, would be really nice to be able to add a (custom) sprite here.

When adding an item to the market, you can't set a custom label with the non-"give-item" type. Listening to the market event means you have to get the market item from the market and check the name, which you don't want to "Buff biter damage", but usually some name where typos are less obvious. In case of mods, perhaps even a localized string. It would be nice to have this available as option.

Additionally there's a small issue when buying more than you can carry. It will spill the loot on the floor. I actually thought I bugged the market at some point because people were complaining it was bugged as their items weren't appearing. I was constantly wondering why there were all kinds of items laying around the market until I found out it was the spilled loot. I would prefer to see either a reduced amount in the purchase, or block it completely.

I'm not sure if it should be supported, but prices that cost lower than 1 (ceil when buying on sum) are not possible either. If I were to put a stone wall in the market for 1 coin, I'd have to add bricks for 0.2 (5 bricks is 1 wall), which is currently not possible.

Re: Improved market customisation via set_market_item

Posted: Wed Jan 09, 2019 9:13 pm
by Rseding91
I can implement something like this but I want to be sure before I make the changes and potentially break everything that uses market items.

Proposed additions:
  • name : string : optional : a simple ID (not enforced to be unique in a given market)
  • icon : sprite_path : optional : this is shown over the default icon
  • description : localised_string : optional : if this is given it's included in the tooltip for the market item (somehow, some tooltips already have descriptions?)
Proposed changes:
  • If you're about to buy something that can't fit *at all* in your inventory it rejects the purchase
As for the sub-1-cost items: that seems useless since you can just do the cost increase on the mod side before adding the offer (5 bricks for 1 coin instead of 1 brick for 0.2 coins). It gets the same result.

Re: Improved market customisation via set_market_item

Posted: Wed Jan 09, 2019 9:39 pm
by Bilka
Some more requests that I gathered:
  • Make it possible to disable offers
  • show missing price amount (similar to how recipes have missing ingredients highlighted in red)