tAPI "The Invisible Hand" -- Inventory Management for the Organizationally-Challenged

Nope- all fresh- though I did add the mod after generating the world.

Hmm... well the world I imported the underworld spawns would be within a few minutes of entering the first place below the dirt walls without background walls, but it was imported. New world I made in tAPI hasn't happened at all yet.
 
Hmm... well the world I imported the underworld spawns would be within a few minutes of entering the first place below the dirt walls without background walls, but it was imported. New world I made in tAPI hasn't happened at all yet.
Send me your world file and player in a zip and I'll see if It happens to me too.
 
Try importing them again? I'm sure you still have the player and world in vanilla.

I deleted them from vanilla after I imported them to begin with. If you want to test it yourself, just import a world and character on your own. Also, importing characters has a known bug to reset any stacks in all your chests and inventory to 1. Had that happen too.
 
EDIT: Both issues I've had seem to stem from importing vanilla characters and worlds. To be safe, create your character and world within tAPI. The other issue I had was my imported character, all the stacks reverted to 1. Thought it was this mod that did that, but it's a known glitch caused by importing characters. I'm going to assume my other issue with underworld biome monsters spawning far higher than they should was caused by importing the world, because creating a world within tAPI I've yet to run into the issue.

Guys I'm having an issue. This is the only mod I'm using, but since I've started using it and tapi, hell biome spawns are spawning way higher up than normal. They don't spawn on the surface, but they are spawning in the cavern. It's really hard to explore when you have fire imps and hell bats spawning where they shouldn't be spawning. I posted about this in the tapi thread, but was told to post it in here since this is the only mod I'm using. Anyone else having this problem?

I don't have this problem but I use with other mods. Mind if you show us where they are spawning?
 
For anyone having trouble with getting this mod to work in multiplayer, attached is a version of the mod that has a minor patch so that it will work. The problem was that it was trying to load textures on the dedicated server and that that apparently does not work. I have fixed this by applying some common C# design patterns, most notably the code now only tries to load the texture the very first time they are requested (subsequent access just takes the copy in memory, as before). If you don't trust my changes, you can simply access the code by opening the .tapi file in something like .7z and looking at the source files.

I have not tested this extensively, but I can confirm everything now loads and the sorting looks like it works.

I have based this patch on 1.1.2b+tr14a - if you need a different version (eg 1.1.2) patched to work, you can diff this code and the original 1.1.2b to see the changes. As far as I can tell they would be the same.

Edit:
Multiplayer has a few bugs:
  • A chest that you sort automatically does not remain sorted (it is unsorted again upon re-opening it).
  • If you automatically sort a chest, pick up a stack of items and put it back immediately (eg a stack of mushrooms) and this stack was split before automatically sorting, you will duplicate some of them. Upon closing and opening the chest the full stack will be where it was before, as well as all the other little stacks.
Edit 3 (Edit 2 is irrelevant now):
I seem to have solved the issue of sorted chests not staying sorted on the server. I have updated the attached file and incremented the version number a bit (1.1.2 -> 1.1.3) to indicate that this is a different version from the one on the thread cover. While this seems to fix that specific issue, I do have some minor concerns about optimisation (it updates the whole chest every time you sort).
I'm trying to avoid changing too much here as I'd like to also work on my own mods and also because I'd probably be tempted to refactor all the code in there. That might be annoying for the original author if he decides to incorporate these changes into the mod.

Edit 4:
I figured out a way to do it using a delegate (it's been a while since I C#-ed), and it now sends only updates for changed chests. Performance should be better and it should work on every action. I think there might still be some multiple syncing going on (there's various calls to sendmessage elsewhere as well and I'm almost certain they are not necessary now), but at least it's sure about the syncs. I've attached the working version here - comments welcome.

Edit 5:
I broke it on singleplayer in 1.1.4, so I made a tiny fix and added it as 1.1.5.
 

Attachments

  • TheInvisibleHand 1.1.5.zip
    82.2 KB · Views: 161
Last edited:
You is my hero, my modus operandi when playing some games that have LOTS OF CONTENTS it's the same, i get lost in all of my chests looking for what i need, and then i quit the game because i get bored and sad because of not finding what i want... Thank you so damn much. <3
 
For anyone having trouble with getting this mod to work in multiplayer, attached is a version of the mod that has a minor patch so that it will work. The problem was that it was trying to load textures on the dedicated server and that that apparently does not work. I have fixed this by applying some common C# design patterns, most notably the code now only tries to load the texture the very first time they are requested (subsequent access just takes the copy in memory, as before). If you don't trust my changes, you can simply access the code by opening the .tapi file in something like .7z and looking at the source files.
<snip>

Hey, I just wanted to say THANK YOU so much, I mean, like wow, like holy carp! As it's been several blue moons since I've last played multiplayer, I probably would never have been able to properly implement and test it myself. Not to mention that this mod is THE reason I learned C#, so my sharp-fu is still quite weak. I'm not only impressed with your work, I'm touched that people have taken such a liking to this mod. I do regret not being able to support it properly over the past 6 months, but I hope to now get it to a polished and more properly "finished" point for 1.2.4.1. As I wrote in the updated OP, for now I've just recompiled your code for r16 and uploaded it in place of the other downloads (1.1.2b was much more popular than 1.1.2, so I just removed the latter version; I hope no one will have issues with that).

I'm in the process of adapting your changes to my code so that I can more easily integrate them into the upgraded version I'll hopefully have up soon. I do have some questions...hmm, but seeing as they're more of a technical nature, it'd probably be better to PM them to you instead of cluttering up the comments here. Right, so I'll do that in a bit. Thanks again!
 
That will be fine :)

I feel obligated to note that shift+clicking items in/out of chests appears to not sync to the server, still. I thought I'd found the place where all the hooks were implemented, but I must have missed one.

Edit: Also, your mod is probably the most useful one I use. Kudos on the work there.
 
They were spawning in the cavern. I fixed it by starting a new world within tAPI.

So this problem hasn't reoccurred for anyone? I hope not, and I'm glad it's not my mod because I'd have absolutely no clue where to start diagnosing that problem! I haven't touched spawning or creatures or anything of that sort. Nevertheless, if it starts up again and it seems there really is no other possible culprit than TIH, lemme know.

Re: the 1.3 question -- see CheatFreak47's response, and also the note I made on the front page about it. Basically, I would if I could, but I can't so it won't.
 
Hey Wuli, I've noticed a small bug in your mod. You might already know this but the slot locking mechanic only is retained on a character if all of your othder characters have the same slots.

For instance:

If this is an inventory for two players

Character 1: (x)(x)( )( )( )( )
( )( )( )( )(x)(x)

Character 2: (x)(x)(x)( )( )( )
( )( )(x)( )(x)(x)

If you load Character 2 up again this will happen:

(x)(x)( )( )( )( )
( )( )( )( )(x)(x)


Other than that this mod is great! Keep up the amazing work!


Hey, I know it's been a while since you made this post, but I'm replying for the benefit of everyone who has this problem. You're right, I am aware of this issue, and before my long hiatus, I spent more than a fair amount of time tracking down it's source, which I did eventually find and squash (though, to be honest, it's been so long I can't even remember exactly what the problem turned out to be.) I have an updated version that includes this fix--and many others--which I hope to be releasing, uh...soon. "Soon" hopefully being measured in days and not weeks, but I don't want to make promises that I may not be able to keep. Thank you for the report, and I'm glad you found the mod useful!
 
Sometimes with this mod I get a bug where when I open a chest, it automatically does the quick restock action, and while the chest is open, the game lags to 5 fps or lower. I've mapped the inventory key to the Q button, that might be what's causing it. I'm also running a large number of mods and I haven't tried to see if I can get the bug to occur with just this mod.

Does this problem still happen for you (or anyone else that reads this)? It's one I've never run across. It did make me realize, however, that I'm pretty sure I don't check for conflicts when the keybinds are changed (if I even can?), so unless the game itself checks that somehow, it may be possible to assign multiple actions to a single key. Hmm...I'll look into that.

But even if that were occurring, unless you're holding down those buttons constantly, I don't see any reason why they would fire immediately upon opening a chest. And actually, I've implemented checks so that even if you were holding down the button, the action should only fire once on first press and not constantly trigger. So that one seems more likely to either be a conflict with another mod, or just an entirely separate issue with a different mod.
 
I think that something in his Terraria is triggering or bugging the "Q" button, and if i remember very well, that button it's used by Terraria, so, problems probably should be: Mod conflict, Terraria conflict by changing options, or... a very rare bug in Terraria source code.
Sorry if i'm kinda butting. Just wanting to halp. ^_^
 
I think that something in his Terraria is triggering or bugging the "Q" button, and if i remember very well, that button it's used by Terraria, so, problems probably should be: Mod conflict, Terraria conflict by changing options, or... a very rare bug in Terraria source code.
Sorry if i'm kinda butting. Just wanting to halp. ^_^

Nope, no butts! :pInput and insight are always welcomed. Thanks for the info, and I think you're right; it's probably a conflict of some sort, either with a mod or the game itself (though the latter is something for which I should probably find a workaround, if that's the issue).
 
Finally got the new version up. Has some new features, and hopefully fixes all the issues in multiplayer, though I'll need testers to verify this.

Apologies for the delay (again). Was on a nearly non-existent internet connection for the past month, plus I apparently went insane and decided I needed to do a total rewrite of pretty much half the mod...well, at least it's better code now (for a certain definition of better) and is more maintainable and extendable--should that matter.

If it does matter, it'll be because there's a need for a mod such as this for the Mac/Linux version of Terraria 1.3. I see that a number of other inventory-management mods have cropped up--and they, uh...kinda seem to blow my poor little project out of the water; even if they don't have all the same features as TIH, they've got plenty of fancy extras to make up for it. And some of this mod's features are now in Terraria itself. Should my mod be made irrelevant by official and/or far better solutions, I'd happily let the Invisible Hand fade to obscurity. It had its time, if brief.

However, as far as I can tell, none of these other mods currently support the *nix version, and I'm so ecstatic that Red+team have released a version for us freaks and geeks that I've no interest in using the Windows version ever again. Well, the WINE version in my case. So, as I mention in the updated OP, if anyone wants me to take a shot at updating this to a cross-platform 1.3 version, then drop me a line here or on PM and let me know. But if there's no audience, then that's an awful lot of work for nothing. So please tell me if you're interested, else it just won't happen.
 
Back
Top Bottom