tModLoader Vending Machines

There is conflict between this mod and the Shop Expander mod, which causes the vending machines to be rendered non-functional unless you first open and close a normal shop after loading a game.
Strange... I use Shop Extender myself, and my version seems to work just fine (at least with most vanilla-like NPCs). Just in case, I'll try to upload the version I'm using to see if it fixes the problem.

May it be a conflict with another, third mod? Can you send a modlist so I can pinpoint the issue?

Edit: V1.2.0.4 released, the version I have that's working for me. May be changed if I can pinpoint this new bug
 
Last edited:
Strange... I use Shop Extender myself, and my version seems to work just fine (at least with most vanilla-like NPCs). Just in case, I'll try to upload the version I'm using to see if it fixes the problem.

May it be a conflict with another, third mod? Can you send a modlist so I can pinpoint the issue?

Edit: V1.2.0.4 released, the version I have that's working for me. May be changed if I can pinpoint this new bug

Here's a copy of my enabled.json file:
Code:
[
  "chadsfurni",
  "AutoTrash",
  "BossChecklist",
  "HEROsMod",
  "Infinity",
  "MagicStorage",
  "MoreAccessories",
  "VendingMachines",
  "WingSlot",
  "Wireless",
  "WMITF",
  "SpiritMod",
  "MultiLure",
  "Fishing3",
  "MoreChestLoot",
  "ShorterRespawn",
  "MinionCrits",
  "CalamityAddon",
  "InstantRespawn",
  "WorldGenPreviewer",
  "EnemyAccessories",
  "FishingRewardRecipes",
  "BuilderPlus",
  "ThoriumMod",
  "VeinMiner",
  "TheOneLibrary",
  "MoreBiomeFishingCrates",
  "NoFishTimer",
  "NoMoreTombs",
  "StopDying",
  "AnglerQuestAnnouncement",
  "fairsouldrops",
  "MaxStackPlus",
  "DNIWpnUpgr",
  "ReducedGrinding",
  "YoyoAttackSpeedWorkaround",
  "HamstarHelpers",
  "Redemption",
  "ItemMagnetPlus",
  "TerrariaHooks",
  "FlyingMinionsIgnoreTerrain",
  "BannerBonanza",
  "pinkymod",
  "MonsterExpert",
  "Antisocial",
  "CalamityMod",
  "FargowiltasSouls",
  "Fargowiltas",
  "CheatSheet",
  "ReforgeArmor",
  "SummonersAssociation",
  "WerewolfMod",
  "FishingCrateAdditions",
  "LootBags",
  "imkSushisMod",
  "imkSushisModOldRecipesEnabler",
  "MinibossExpansion",
  "BossAssist",
  "AssortedCrazyThings",
  "AlchemistNPCLite",
  "niceblocks",
  "CosmeticVariety",
  "LearnByDoing"
]
 
Strange... I use Shop Extender myself, and my version seems to work just fine (at least with most vanilla-like NPCs). Just in case, I'll try to upload the version I'm using to see if it fixes the problem.

May it be a conflict with another, third mod? Can you send a modlist so I can pinpoint the issue?

Edit: V1.2.0.4 released, the version I have that's working for me. May be changed if I can pinpoint this new bug
To be more precise, the issue happens with vending machines that use VendingMachineItem.SetupShop to add items to a shop and manually open the shop menu. For instance the Easy Vending Machine.
MechTransfer has a hook on Chest.AddShop to override the item sell behaviour. DRKV333/ShopExpander This refences the currently active ExpandedShop, but since the Easy Vending Machine never called Chest.SetupShop, the current ExpabdedShop could be null.
To fix this on my end, I could just make sure to properly track when a valid ExpandedShop is open, and fall back to the default AddItem code if there isn't one.
Right now Shop Expander's mod.call can't manually create ExpandedShops, but I'll look into allowing that as well. That way mods like this, that create shops manually could still take advantage of Shop Expander.

EDIT: Sorry, by ExpandedShop, I meant ShoppingList. It's been a while since I had time to look at my own code. :p
 
Last edited:
To be more precise, the issue happens with vending machines that use VendingMachineItem.SetupShop to add items to a shop and manually open the shop menu. For instance the Easy Vending Machine.
MechTransfer has a hook on Chest.AddShop to override the item sell behaviour. DRKV333/ShopExpander This refences the currently active ExpandedShop, but since the Easy Vending Machine never called Chest.SetupShop, the current ExpabdedShop could be null.
To fix this on my end, I could just make sure to properly track when a valid ExpandedShop is open, and fall back to the default AddItem code if there isn't one.
Right now Shop Expander's mod.call can't manually create ExpandedShops, but I'll look into allowing that as well. That way mods like this, that create shops manually could still take advantage of Shop Expander.

EDIT: Sorry, by ExpandedShop, I meant ShoppingList. It's been a while since I had time to look at my own code. :p

Thanks for the head's up. I was able to fix the error (for real this time) by making the custom vending machines load the shops through the InvisibleShopNPC. It also (theoretically) can now load shops with more than a chest worth of content, if the Main shop allows it. It should never IndexOutOfRange, but without some way to see the extra slots, they will simply not show.

Version 1.2.1
- Changed the way custom vending machines are implemented: they are now fully compatible with Shop Expander.
- Vending Machines' SetupShop now takes a Chest instead of an Item[], allowing for expanding the chest.item size. Items over the limit will not be displayed unless your have a mod that allows it.
- Added Icon
 
OK, I made a tentative update to tmod v0.11.6.1 right now, but due to the hacky nature of this mod, I won't know if everything is working before I test it fully. For now, it seems to run.
 
Back
Top Bottom