1. Encountering issues with the Localization/Translations with 1.3.5? Please report them via the section linked below so that we can account for all of them and have them addressed. Thanks! Localization Bugs & Issues Section

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

Discussion in 'Released' started by wuli1986, Dec 20, 2014.

  1. Ne Obliviscaris

    Ne Obliviscaris Terrarian

    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.
     
  2. CheatFreak47

    CheatFreak47 Official Terrarian

    Send me your world file and player in a zip and I'll see if It happens to me too.
     
  3. Ne Obliviscaris

    Ne Obliviscaris Terrarian

    I already deleted the imported character and world sorry
     
  4. CheatFreak47

    CheatFreak47 Official Terrarian

    Try importing them again? I'm sure you still have the player and world in vanilla.
     
  5. Ne Obliviscaris

    Ne Obliviscaris Terrarian

    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.
     
  6. kentanggoreng92

    kentanggoreng92 Terrarian

    I don't have this problem but I use with other mods. Mind if you show us where they are spawning?
     
  7. Ne Obliviscaris

    Ne Obliviscaris Terrarian

    They were spawning in the cavern. I fixed it by starting a new world within tAPI.
     
  8. krageon

    krageon Terrarian

    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.
     

    Attached Files:

    Last edited: Jun 21, 2015
    wuli1986 and CheatFreak47 like this.
  9. Ne Obliviscaris

    Ne Obliviscaris Terrarian

    Is this going to be updated for 1.3?
     
  10. CheatFreak47

    CheatFreak47 Official Terrarian

    Probably worth waiting until tAPI for 1.3 comes out before you ask that. :/
     
  11. Ohmat naiekol'kah

    Ohmat naiekol'kah Terrarian

    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
     
    wuli1986 likes this.
  12. wuli1986

    wuli1986 Terrarian

    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!
     
  13. krageon

    krageon Terrarian

    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.
     
    wuli1986 likes this.
  14. wuli1986

    wuli1986 Terrarian

    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.
     
    CheatFreak47 likes this.
  15. wuli1986

    wuli1986 Terrarian


    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!
     
    JustAddRanch likes this.
  16. wuli1986

    wuli1986 Terrarian

    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.
     
    Ohmat naiekol'kah likes this.
  17. Ohmat naiekol'kah

    Ohmat naiekol'kah Terrarian

    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. ^_^
     
    wuli1986 likes this.
  18. wuli1986

    wuli1986 Terrarian

    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).
     
    Ohmat naiekol'kah likes this.
  19. wuli1986

    wuli1986 Terrarian

    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.
     
  20. d3x

    d3x Terrarian

    Please update for 1.3