1. For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
    Dismiss Notice

tModLoader MechTransfer - Item translocation and more...

Discussion in 'Works-in-Progress' started by DRKV, Aug 1, 2017.

  1. DRKV

    DRKV Spazmatism

    MechTransfer is a small mod, that adds various wire controlled devices to interact with items and move them between containers.

    The mod contains the following features:
    - Transferring items from one chest to another
    - Dropping and picking up items
    - Item sorting and detection
    - Automatic crafting

    Latest version: v1.6.2 for TModLoader v0.10.1.5 and Terraria v1.3.5.2

    Below is a list of the added items and their functions.

    Pneumatic actuator [​IMG]
    Sold by the mechanic for 50 silver. It is used to craft all of the other devices.​
    Transfer extractor [​IMG] (1xPneumatic actuator + 1xGolden key @ Workbench)
    Extracts items from adjacent containers and sends them to a receiving device.
    Triggering it with a wire will extract a single item.​
    Stack extractor [​IMG] (1xTransfer extractor + 10xNanites @ Workbench)
    An upgraded version of the extractor, that can move a whole stack of items at a time.​
    Transfer injector [​IMG] (1xPneumatic actuator + 1xGolden key @ Workbench)
    Receives items and injects them into adjacent containers.
    Sends out a wire signal when it receives something.

    This picture illustrates how you can use an injector and an extractor to move items from one chest to another.
    You can also inject into and extract from a variety of different different kinds of containers.
    Standard chests from any other mod should also out of the box. If your mod has a custom item storage solution, you can use MechTransfer's Mod.Call() based API to set up an adapter for it. (More information available here.)

    Currently, the containers from Portable Storage support MechTransfer.
    Support for Magic Storage is built into MechTransfer. (see Magic storage interface)​
    (25x)Transfer pipe [​IMG] (1xPneumatic actuator + 1xAny iron bar @ Anvil)
    Connects receiving devices to sending devices at a distance.

    Transfer inlet [​IMG] (1xPneumatic actuator + 1xInlet pump @ Workbench)
    Picks up items that land on top of it, and sends them away.
    Transfer outlet [​IMG] (1xPneumatic actuator + 1xOutlet pump @ Workbench)
    Receives items and drops them on the ground.

    Transfer relay [​IMG](1xPneumatic actuator + 1xAny pressure plate @ Workbench)
    The back of the arrow acts as a receiver, the front acts as a sender. It receives items, and sends them out again.
    Outputs a wire signal when an item passes through it.

    The sending device will always connect to the first receiver in line. It will also skip any injectors, that can't inject due to lack of chest space.

    You can use relays to reroute items to a longer path.

    Every relay will only receive once per transfer. This prevent things like this, from crashing the game.
    Transfer gate [​IMG] (1xPneumatic actuator + 1xActuator @ Workbench)
    Acts just like a pipe, but can be toggle with a wire signal.

    [​IMG] [​IMG]
    Transfer filter (whitelist) [​IMG] (1xPneumatic actuator + 1xActuator + 1xItem frame @ Workbench)
    Also acts like a pipe, but it will only let one kind of item through.
    Right click on it with an item to set the filter.

    [​IMG] [​IMG]
    Transfer filter (blacklist) [​IMG] (1xPneumatic actuator + 1xActuator + 1xItem frame @ Workbench)
    A filter, that will let through any item, except for the one specified by right clicking.​
    Filter items [​IMG]
    These items can be placed in filters to select a wider group of items. The base filter can be bought from the mechanic, you can use it to craft the other kinds of filter items.

    Currently available filter items: Rarity (various), Equipable, Armor, Vanity, Accessory, Dye, Ammo, Bait, Money, Bag, Tool, Consumable, Material, Potion, Tile, Wall.​
    Magic storage interface [​IMG] (1xSorage component + 1xDiamond + 1xPneumatic actuator @ Workbench)
    This device lets you interact with the items stored in a Magic Storage network. It acts as a storage component. You can access it using transfer extractors and injectors.

    Player interface [​IMG] (1xTransfer extractor tile + 1xTransfer injector tile + 1xMannequin + 10xCog @ Workbench)
    This thing allows you to access the inventory of a player directly as a storage container. You can take items from it, or even change the player's equipment.

    And, for the grand finally:
    Transfer assembler [​IMG] (1xPneumatic actuator + 10xCog @ Workbench)
    Crafts items automagically. Place ingredients in an adjacent chest, place required crafting station(s) at a max 5 tile distance, activate with wire. You can set the item you want to craft the same way, as with the Transfer filter. The crafted products will be placed back into the chest.
    (To make things that require a snow biome, place some snow or ice nearby.)
    This thing might not work all the time, I am still kinda working on it.
    Some moded crafting station might not work with it, but I can't really fix that, unfortunately...

    With these components, you can construct complex automatic material processing machines, such as this silt extractor:

    But wait, there's more!

    Omni turret [​IMG] (5xPneumatic actuator + 1xIllegal gun parts + 1xDart trap @ Workbench)
    Super omni turret [​IMG] (1xOmni turret + 10xCog @ Workbench)
    Matter projector [​IMG] (1xSuper omni turret + 5x Vortex fragment + 5xLuminite bar @ Ancient manipulator)
    The turrets can shoot any standard ammo, including every type of bullet and arrow, even modded ones. They can be rotated like vanilla cannons, by right clicking or via wire. The higher tier turrets do more damage and have a faster cool-down. The Matter projector has no cool-down.

    So, that's basically everything. I'll let you figure out some of the interesting side effects. ;)
    This was my first attempt at making a terraria mod, and I very much enjoyed the experience, so it certainly won't be the last. I've already got a few things planned.
    Sorry about the crummy sprites, I am not very artistic.

    It isn't impossible that I overlooked some major bug, so let me know how it works. It's fairly stable though and probably won't eat your items.

    The source code and download are available on GitHub: https://github.com/DRKV333/MechTransfer/
    The mod is also available through the TModLoader mod browser.

    Lastly, here's an automatic smelter, for (some) normal mode ores:
    Last edited: Feb 16, 2019
    putianyi888, BMB, Avamaco and 18 others like this.
  2. Gatekeeper_

    Gatekeeper_ Terrarian

    Can't wait to make a factory with this! Or, just an auto sorter for invasion farms.
  3. DRKV

    DRKV Spazmatism

    Updated to version 1.1
    - Recolored Transfer relay to reflect function better
    - Logic sensor like bounding box for assembler
    - Assembler status message
    - Assembler code cleanup
    - Various smaller fixes

    Important: In order to make these things happen, I gave the Assembler it's own tile entity. (I don't even know why I didn't do that in the first place.) Because of this, after you upgrade, the assemblers that you placed before will not work. You'll need to break and replace them.
    Sorry about that...
    On the plus side, I cleaned things up, and the download now also contains the source.
  4. Hydropawah

    Hydropawah Terrarian

    This is really dope
  5. CoronaKing

    CoronaKing Steampunker

    This mod is so darned cool! With my style of play, it doesn't do a whole lot of help, BUT... It's just so darned cool, that I will find a way to use it. If you want some specific testing done, or whatever, let me know!

    Edit: I found a crash, if you have a storage item on top of the Inlet, and break the inlet, poof! Bad things happen. (I did this with a chest as I was testing it)
    Last edited: Aug 4, 2017
  6. DRKV

    DRKV Spazmatism

    Thank you, I fixed the crash.

    I would mostly be interested in how the assembler works with other mods. Items that do special things when crafted could cause problems, especially in multiplayer.
    Also, what do you think about the crafting recipes? I'm starting to think that the golden keys for the extractor and injector might be a bit too harsh.
  7. Fro Zen

    Fro Zen Spazmatism

    One question, does this work with Magic Storage? If not, there's an idea to implement.
    MilusBR likes this.
  8. DRKV

    DRKV Spazmatism

    It doesn't work work with Magic Storage currently, but I'll definitely try to make some sort of interface to access magic storage systems.
  9. Fro Zen

    Fro Zen Spazmatism

    Cooleo. I have a Mob-Lawn-Mower-Thing-System using multiple mods and I want the drops to go into my storage system, so that's gonna be good.
    I also like it how the inlets can pick items up from half blocks :)
    Last edited: Aug 4, 2017
    terraria is awesome 2 and DRKV like this.
  10. CoronaKing

    CoronaKing Steampunker

    I don't think Golden Keys are too harsh, mostly because they can be pretty easily farmed, but then again, I don't mind farming for things. What do you mean by "special things" when crafted? Not sure if I've used a mod that somehow triggers a special effect upon craft completion. I'll take a look at the assembler in some modded tonight, though
  11. DRKV

    DRKV Spazmatism

    I haven't been playing with mods for too long, so I am not really sure what other mods are doing. I am looking for items that override OnCraft. In the example mod, for instance, It's used to mark items with the name of the player that crafted them. Generally OnCraft should only get called when the local player is holding the newly crafted item. If I call it from the assembler in multiplayer, it runs on the server, and there is no local player. Though I think there is some kind of placeholder, because the example mod didn't crash.
    I guess I'll keep things as is, and then if there's some serious issue later I'll just add a few safety checks.
    I'll keep the keys as well, I always end up with stacks of the stuff in hard mode.
  12. DRKV

    DRKV Spazmatism

    Updated to version 1.2
    - Manual item loading
    - Added container adapters for mod interoperability
    - Support for item frames

    So, I've started to rewrite things, to make make it possible for other mods to add support for this mod. Thanks to this new system, I was able to make item frames work with transfer device.
    After a long and fearsome battle, I managed to set up GitHub, so from now on that's where you'll find the source code.
  13. Fro Zen

    Fro Zen Spazmatism

    Transfer inlets can pick up hearts, pretty sure it also happens with stars and notes from thorium as well. not sure if this is intended
    terraria is awesome 2 likes this.
  14. DRKV

    DRKV Spazmatism

    Yeah, this is not really intentional. I kinda like the idea of storing a bunch of hearts in a chest for later use, although that might be a bit OP. I'm currently working on a bunch of other bug fixes, so I'll figure something out by the next release.
  15. Fro Zen

    Fro Zen Spazmatism

    storing hearts can make damage invulnerability machines... well... a very inefficient one. dummies and slime mount does it better but still.
  16. DRKV

    DRKV Spazmatism

    Updated to version 1.3
    This version adds support for a few more containers along with some important bug fixes. Turrets now except their ammo from injectors. This way you can fire them automatically, and actually do some damage. Multiplayer should now be fully usable.
    • You can now inject snowballs into snowball launchers
    • You can now inject cannonballs into cannons
    • You can now inject explosive bunnies into bunny cannons
    • You can inject etherian crystals into crystal stand to summon the old one's army
    • Weapon racks are now supported
    • Inlet no longer picks up hearts and similar items
    I really like the whole automatic turret thing. I am also planning to add a turret which can shoot actual bullets/arrows. I think that would be fun.
    I am not sure about the automatic boss/invasion summoning. I added the Etherian crystal just because it was easy to implement, but I might remove it later.
    terraria is awesome 2 and Fury like this.
  17. Fro Zen

    Fro Zen Spazmatism

    i tried using it with magic storage and it still didnt work ;-; maybe im just a dweeb and dont know how to do it
  18. DRKV

    DRKV Spazmatism

    I haven''t added any sort of explicit support for magic storage or any other mod jet. I just added the facilities to allow other modders to make their mod compatible with MechTransfer. This feature is not even finalized jet though, and I haven't documented it at all.
    I will, in the future, try to make magic storage work, by implementing the interface on my end. First however, I want to make the mod more stable, and finish all of the other planned features.
    This might take a while, as I am currently quite busy with other things.
  19. MugetsuYarida

    MugetsuYarida Terrarian

    Oh god, I remember the Meinkreft mods that is similar to this...NICE MOD!!!!
    terraria is awesome 2 and DRKV like this.
  20. DRKV

    DRKV Spazmatism

    Updated to v1.4
    This version adds a lot of cool things. The main attraction is the new set of turrets, that can shoot any bullets, arrows or other standard ammo types.
    • Added visualization for transfers
    • Added Omni turret, Super omni turret and Matter projector
    • Added support for dressers
    • Added reflection based adapter loading
    The turrets currently don't shoot rockets. This wasn't entirely intentional, but I think it's better this way. A misfiring turret with rocket IV would be devastating.
    terraria is awesome 2 and Fury like this.