Unrecognized list type when setting up shop?

Hi, I've had a text game going for several months but have the past few ones been totally stumped by this issue. What I have is a shop and a stock, and two of the four items in the stock can't be bought. I can't see any difference between the items except that the buyable ones are both food items (edible and gives health), while the other two are a lantern (lights up, switchable, and wearable) and a shirt (wearable and adds a charisma stat). I followed the guide on setting up shop exactly as is said here and have gone over each step several times to try to solve this on my own, and the specific error I get simply reads Error running script: Unrecognised list type. Nothing I can come up with myself seems to help.
If anyone can guide me on what information exactly is needed to help, I'll happily provide it as long as there's some sort of fix for this, because it's been really bothering me.

Thanks in advance!

Hey there,

I've run into some issues when I start a new game (or go back to an old one) with ShopLib too. I think it's usually not because of the "setup" but sometimes required attributes what aren't filled-in/added to the objects.

Your issue is probably in this part of the code:

  <function name="DoBuy" parameters="obj">
      if (not HasInt (obj, "price")) {
        msg (DynamicTemplate("NotForSale", obj))
      else {
        buyingprice = BuyingPrice(obj)
        if (buyingprice > game.pov.money) {
          msg (DynamicTemplate("CannotAfford", obj))
        else {
          if (GetBoolean(obj, "cloneonpurchase")) {
            CloneObjectAndMove(obj, game.pov)
          else {
            obj.parent = game.pov
          game.pov.money = game.pov.money - buyingprice
          P (DynamicTemplate("BuySuccessful", obj))

For example, your food items are most likely set to be in the "clone on purchase" section of the script and are handled that way. The other two objects are probably handled by a different part of the script.

Does it give any indication which part of the script the error occurs in? Often an error message will include the expression which generates the error.

Log in to post a reply.