tModLoader Enhanced Crafting Interface: Multicrafting and Recipe Search

Serity

Terrarian
Doesn't work anymore (TML 0.8.3.4) and I don't have the source files anymore and I don't plan on remaking it. If someone knows how to extract the source files and fix it, go right ahead. But otherwise, this mod is dead.

This has been sitting in my projects folder for a bit 'coz I kept telling myself I'd go back and clean it up a bit and add some filters and stuff. Got lazy. Maybe I'll add filters and stuff someday but for now I'm just gonna release this with a "probably not going to be updated" preface. This probably isn't gonna get updated again :) I'm not releasing this on the Mod Browser because I don't think it's polished enough to be a "finished product".

Please, no feature requests. Support for this will be limited-to-non-existent. Bug reports will likely not be fixed or addressed.

Enhanced Crafting Interface v0.9
https://www.dropbox.com/s/lxm95h7urjzoicm/EnhancedCraftingInterface.tmod?dl=0
Bind a key to EnhancedCraftingInterface: ECI Crafting in your hotkeys menu. It is not accessible otherwise.

To use, either (Mods menu, then "Open Mods Folder", then place file there) or (place in \Users\USERNAME\Documents\My Games\Terraria\ModLoader\Mods\) then enable it in-game. Make sure your hotkey is bound as stated above.

Screenshots
ambiguous_recipe.pngitemslot_search.pngpageination.pngstation_information.png
Ambiguous Recipes, Item Slot Searching, Pages, Crafting Station Info (offsite image links)

Features
  • Multi-crafting - specify a number and watch the game craft at increased speed! As a comparison, vanilla right-click crafting crafts 1000 wooden platforms in ~10 seconds. Multi-crafting fully automates it to ~3 seconds.
    • Craft as normal using left-click or right-click on the "Craft!" button. Pretty much same functionality as vanilla, left-click for one at a time, hold right-click for spam-crafting. Mousewheel spinning is also supported to craft "quickly but not too quickly".
    • Specify an exact number of times to craft the recipe, from 1 to 9999! (not "factorial 9999", sorry :p) If you specify more than you can make, it crafts until you run out of materials.
    • MAX CRAFT! Shorthand for "Craft 9999". You have to click twice to confirm to prevent accidental clicks, or three times if it's a single-stack item (such as a sword).
      • Additional crafts past what your mouse can hold will go into your inventory, or onto the ground if it's full. Careful when crafting 999 Swords!
      • The chat window will let you know if any items fell to the ground or if crafting was aborted prematurely due to lack of items, closing the crafting window, switching the item on the mouse, or other reasons.
    • Note that you cannot craft with an item in the item slot. Send it to your inventory with shift-click before crafting.
    • Works with a chest open as well.
    • Note: While multi-crafting you may have a reduced frame rate. Please do not multi-craft while fighting bosses on Hardcore. Thank you.
  • A full list of all recipes (including modded ones)! Beware of spoilers!
    • When there are too many results, for performance reasons, pages are broken down into 300 recipes each. Click the page counter to go forward, shift-click to go backwards.
    • Hovering over the page counter will tell you exactly which items start and end the current page.
  • Recipe Search
    • By Text: Type text in search box to filter to only include items containing that term. [X] button to clear search term.
      • "Era" finds "Emerald Gem Lock", .. "Mana Regeneration Band"..
      • "Bar" finds "Adamantite Bar", "Bar", "Bar Stool", and every other craftable Bar ingredient. Useful with a chest full of Ore!
    • By Item: Place an item in the green slot in order to use the item itself as a search term. Similar to Guide functionality! Shift-click to return item to inventory.
  • Results Mode or Ingredients Mode
    • Results Mode: Recipes are listed where the result item matches the search criteria (text search or item search).
    • Ingredients Mode: Recipes are listed where at least one ingredient item matches the search criteria (text search or item search). The Guide is now obsolete ;)
  • Tooltips - tooltips attempt to be as informative as possible.
    • All items have tooltips, whether it's in recipes view (left pane) or recipe ingredients view (right pane).
    • When you can click or shift-click for additional information, a tooltip will inform you.
  • Station Information - displays which stations you have to be near, along with if you need liquids
    • Displayed as icons (for example, a Crystal Ball icon and a Honey Bucket for a Honeyfall wall), except for Demon Altars :/
      • Modded Crafting Stations are displayed as text, unless we couldn't find a text description for the tile, in which case it just says "???". Sorry. I tried.
    • Hover over the stations to get text descriptions.
    • Attempts to be informative as possible; for example, Mana Regeneration Potion says "Bottle or Alchemy Table", watches say "Any Table and Any Chair".
  • Filter by Available-Only recipes (enabled by default, one-click button to toggle).
    • Any recipes that have red text you do not have enough ingredients to make or aren't at the right station. White text is A-OK for crafting.
    • When multiple recipes result in the same item ("ambiguous recipes"), each recipe also displays the ingredients used to make it next to the resulting item.. usually. :/
  • Click or shift-click items for additional functions
    • Shift-Click a recipe in the left pane to find recipes containing the resulting item. For example, shift-clicking an Avenger Emblem recipe will find recipes using Avenger Emblem.
    • Click an ingredient in the right pane to search for recipes resulting in or containing that item, depending on if you're in Results or Ingredients mode.
    • If an ingredient can be made with a recipe, shift-clicking the ingredient will automatically pull up the ingredient list for the first valid recipe to create that item.
      • For example, when browsing True Night's Edge's recipe, shift-clicking Night's Edge will automatically pull up the recipe for Night's Edge, and from there you can shift-click Fiery Greatsword to see how to craft it (and then shift-click Hellstone Bars..).
  • Draggable window, reposition wherever you like! Resets on game session close.
  • Should scale down OK to even the lowest resolutions, though it's not recommended that low.
  • Source code included, if you want to poke around with TModReader. Very very messy and awful code though ;)
  • Should work in multiplayer as long as the server also has the mod.
  • Works with auto-pause enabled!
  • Nothing is saved to your character or world.
Known Bugs
  • You cannot craft coins using ECI except for platinum. Sorry, but due to how coins are handled differently than other items, if you craft 100 copper coins using 1 silver, ECI will automatically stack the 100 copper into 1 silver. Problematic if you're using max crafting. ECI will inform you of this. Please use vanilla crafting for coins. Apologies for any inconvenience.
  • FPS Issues: You may experience lag while ECI is open. I've done the best I can to alleviate FPS problems but on computers weaker than mine, some may still exist. Try shift-clicking the [X] (clear search) button to toggle off icons in the recipes list and see if that helps at all. If you get hitches when turning pages, this should help.
    • When opening the interface for the first time each session, there will be some hitch as it initializes.
    • When multi-crafting (specifying a number or max craft), you will have reduced frame-rate. ECI uses vanilla's standard crafting system to ensure that your crafted items are properly placed into your inventory (or thrown on the ground if full inventory), to make sure they're stacked properly and to make sure items are consumed properly. The vanilla system doesn't have a way to craft multiple items at once, so we have to craft one recipe at a time. This can take quite a while -- if ECI just crafted everything in a row, your game could be totally frozen for several seconds. In order to craft at high speed, but still make sure the game operates, every frame we craft five times until everything has been crafted. This does lower the frame rate a bit while multi-crafting, but still crafts faster than vanilla.
  • Modded crafting stations that do not have text when you hover over it on the map are simply displayed as ???. I can't get text for tiles that don't have any.
  • There are often noticable seams in the UI panel graphics. Not sure what to do about this, but I don't really care either. Doesn't affect anything.
  • Funky stuff may happen if you try doing things while multi-crafting. I've tried to cover most of these, but still.. be careful. Hehe.
  • When using scroll wheel, it also scrolls the vanilla recipe view. Just ignore it.
  • Items must be removed from the item search slot before crafting. Using voodoo magic, we can search for valid/available recipes using that slot, but we can't make the game's crafting detect it as a valid inventory slot. Sorry!
  • Can't Move: This.. really shouldn't happen anymore, I think I fixed all cases of it, but.. you might not be able to move after typing. Or be able to pull open your menu. Or anything. This should be fixed and all gone. If this happens to you, if you're running Cheat Sheet you can click the cell phone icon in the Cheat Sheet menu and this mod adds an emergency save-and-quit button in there. This is a critical error and if you can 100% reproduce it, I'll probably try to fix it.
  • Just ignore the single item this mod adds. It's used for on-demand tooltip support and nothing else. No actual items were added in this mod.
  • "Floaty" item slot when moving the interface around. Item Slots aren't the same kind of interface as the rest of the UI so some hacks had to be done to get it to move at all. Cosmetic issue, just ignore it.
Shoutout to the TerraUI guys for the foundation of UIItemSlot (heavily altered ;)). Rest of the interface uses Terraria's UI code.
 
Last edited:
Would it be possible to sort item by stat effect? For example, displaying all items that increase magic damage? When running a lot of mods it's nearly impossible to keep track of all of your options.
 
Would it be possible to sort item by stat effect? For example, displaying all items that increase magic damage? When running a lot of mods it's nearly impossible to keep track of all of your options.
Possible? Probably.

"Increases magic damage" isn't an innate part of the items - what the game does is go "okay, it's time to update the player. Let's go through their accessories. If this accessory's .type field == ItemID.MageEmblem, magic damage + whatever. If this accessory's .type field == ItemID.AvengerEmblem, magic damage + whatever and melee damage + whatever and..". So going that route to check them is out, since the fact that it increases damage isn't stored directly on the item anywhere.

The other route, then, would be to check the tooltips of all the items in the game when it first initializes for each of the various filters. Not sure if the loading iterates through modded items or not (I only do that to connect Item graphics to Tiles for the station info, but modded tiles don't get connected properly), but base items, you can grab the tooltip through Lang.cs -> toolTip(type) and toolTip2(type) (maybe item.toolTip/item.toolTip2 is the same exact thing, not sure). Any items containing "magic damage" in one of the tooltips would get shoved into a magicItems array/list, any items containing "melee damage" would get shoved into a meleeItems array/list, etc. You will also have to catch items that simply say "increased damage" since that covers everything.

Then there'd be a "filter" variable that just stores which filter is currently being used (magic/melee/whatever). In UpdateRecipes() you would just do something like "if (filter == "magic") { recipefinder = recipefinder.Where(recipe => magicItems.Contains(recipe.createItem)); } (pseudo-code, I don't have VS fired up for intellisense). You could probably even just do recipefinder.Where(recipe => recipe.createItem.toolTip.Contains("magic damage") || recipe.createItem.toolTip.Contains("increased damage") || recipe.createItem.toolTip2.Contains("magic damage") || recipe.createItem.toolTip2.Contains("increased damage")) after the initial search, but that could be a little heavier on the search time.

If you don't want to screw around with UI, you could look into reading the chat (so "/eci magic" -> filter = "magic", "/eci none" -> remove filter) instead of adding buttons.

..and all of that assumes that the modded item properly set up their tooltips :p

Like the OP says, I was originally gonna add filters, but then I got lazy ('coz I'd probably add a lot). If you want to mod it using tModReader and VS, go ahead, the source code's included. You'll have to play around yourself to figure out how to take the mod apart and compile your own mod, I'm not gonna tutorial everything :p
 
Last edited:
Possible? Probably.

"Increases magic damage" isn't an innate part of the items - what the game does is go "okay, it's time to update the player. Let's go through their accessories. If this accessory's .type field == ItemID.MageEmblem, magic damage + whatever. If this accessory's .type field == ItemID.AvengerEmblem, magic damage + whatever and melee damage + whatever and..". So going that route to check them is out, since the fact that it increases damage isn't stored directly on the item anywhere.
Oh, right, I had forgotten that the stats aren't actually a part of the item, but rather applied when the game updates your equipped items. That definitely would make it harder. I already have my VS setup, can compile mods, and am more or less familiar with the syntax of C#, as I am Computer Science major at a university. I mainly just need to familiarize myself with the formatting that TML requires. I suppose implementing filters would be a fun, if challenging way to do that! Thanks for the tips on how I might go about that!:D

Edit: Hehe, looks like you left the sln file inside the .tmod, but removed the .csproj file. I'm guessing that your buildIgnore line didn't have *.sln.
 
Last edited:
Edit: Hehe, looks like you left the sln file inside the .tmod, but removed the .csproj file. I'm guessing that your buildIgnore line didn't have *.sln.
I'm sure I have NO idea what you are talking about, I checked the Dropbox link and it doesn't include the sln. At all. No sir. *cough cough cough*

I don't think it really matters though, they're just plaintext with nothing sensitive. I was flaking on if I should add the .csproj to make it easier to edit but figured it wouldn't work right if directory structures didn't match, so instead axed the .sln, the Properties folder and whatever the .suo file thing is, so all you get now is pure unadulterated source code. And some .DLLs I didn't want to bother figuring out if they were necessary to include or not so I left them in. :p

In ECI_UI Initialize() there's an item loop there that you can modify. I'm assuming "Main.maxItemTypes" catches tModLoader stuff but I have no idea (it'd be easy to figure out by printing a message with the count when it initializes, then unloading a mod with items and initializing it again and seeing if the numbers match). If maxItemTypes doesn't include tModLoader stuff, you'll have to figure out something else.
 
Will this mod be updated to TModloader 0.9.0.2?
I liked this mod more than Cheat Sheet and the Hero mod's recipe browser module. :)
 
Please, re-upload this mod, looks like you removed it from your DropBox and it can not be downloaded for now. Thanks.
 
Last edited:
Please, re-upload this mod, looks like you removed it from your DropBox and it can not be downloaded for now. Thanks.
Sorry for the late response, I don't know if you'll even get this. I didn't remove it but Dropbox changed their link format at some point >_< I'll update the OP with the new link.

https://www.dropbox.com/s/lxm95h7urjzoicm/EnhancedCraftingInterface.tmod?dl=0

I haven't played any Terraria for a long time so updates probably aren't happening :p
Edit: Doesn't work anymore and I don't have the source, it was on my old PC which is dead. Sorry.
 
Last edited:
Sorry for the late response, I don't know if you'll even get this. I didn't remove it but Dropbox changed their link format at some point >_< I'll update the OP with the new link.

https://www.dropbox.com/s/lxm95h7urjzoicm/EnhancedCraftingInterface.tmod?dl=0

I haven't played any Terraria for a long time so updates probably aren't happening :p
Edit: Doesn't work anymore and I don't have the source, it was on my old PC which is dead. Sorry.
Unless you hid source in build.txt, the mod can be unpacked.
Well, even if you hid it, a hacked reader can still unpack it. So if you really want the source you can get it
 
Back
Top Bottom