Can't sell items locked behind level/ not in shopkeeper's configuration

Not sure if this is tackled in a later lecture, but at least up to the “Replenish Stock By Level” lecture (In the Shops + Abilities Course) - where “selling” has been fixed; I found that you are only able to sell items that are “unlocked” as according to the shop-keepers level.

So for example, if you need level 3 for an item (Fireball) to appear in a shop-keeper’s inventory; but you have one that you’ve picked up that you’d want to sell → it doesn’t appear in the sell menu until you hit the level where it’s unlocked. More generally, the way it’s currently set up is such that you can’t sell items that the shop-keeper does not have in their stock configuration.

I haven’t tried to fix it myself at this stage, as it may come up in a later lecture and I’m planning to finish them first. Just leaving this as a question to see if it’s addressed later on/ as an FYI

1 Like

This is something that doesn’t get covered in the course.

What I do is gather all of the player’s inventory and create generic StockItemConfigs for selling. Once these configurations are gathered, I then check the shop’s stock configurations and apply any discounts to the generic StockItemConfigs. When buying, use the Shop’s configs. When selling, get the configs from inventory and use those.

1 Like

Privacy & Terms