RELEASED [SMAPI] TeleChests

Discussion in 'Gameplay Mechanics' started by Alhifar, Apr 15, 2016.

  1. Alhifar

    Alhifar Void-Bound Voyager

    TeleChests is a relatively simple mod that adds a single item. The TeleChests it adds have a shared inventory based on what item is used as a key. By default their "key" is a chest (or TeleChest), but you can select another key for a particular chest by holding Shift and right clicking on the chest with a non-tool item.

    You'll see what item the chest is linked with when you pick the chest back up. TeleChests can also be picked up whether they have anything in them or not, and next time you place it back down, it will retrieve the stored inventory.

    The crafting recipe for a TeleChest requires 100 wood, an iridium bar, and a void essence. (I could definitely use some opinions on whether this seems balanced or not.)


    useDefaultRecipe: When set to true, the crafting recipe for a TeleChest will be the default recipe of 100 wood, 1 iridium bar, and 1 void essence. If set to false, the recipe in customRecipe.json will be used. An example with the default recipe is provided in the download. The first number is the item number, a list of which can be found [here](https://docs.google.com/spreadsheet...EeAKR6EODNdKU2IqDRSolWm2mo/edit#gid=585720384). The second number is how many of that item is required.

    allowMultipleInventories: If this is set to false, you will not be able to set a TeleChest to a different inventory by Shift-Right Clicking with an item. Any TeleChests that already exist with an inventory set will, however, stay set to that inventory.


    Download location: https://github.com/Alhifar/TeleChests/releases/tag/1.1.1
    Source: https://github.com/Alhifar/TeleChests
    Issue Tracker: https://github.com/Alhifar/TeleChests/issues

    For the time being, this mod is incompatible with AccessChestAnywhere.
     
      Last edited: Apr 18, 2016
    • Entoarox

      Entoarox Oxygen Tank

      Might I suggest adding at least 1 iridium ore in the recipe, cause magically connected chests feels magical enough to need the "magical" metal in some form :p
       
      • Alhifar

        Alhifar Void-Bound Voyager

        That definitely seems reasonable. Maybe I'll replace the 2 gold bars with one iridium bar?
         
        • iart53

          iart53 Void-Bound Voyager

          I get the following log when I sleep in the game:

          [08:50:52.174 PM] [ERROR] An error occurred in the overridden update loop: System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: The type TeleChests.TeleChest was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically.
          at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterObject.Write33_Object(String n, String ns, Object o, Boolean isNullable, Boolean needType)
          at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterObject.Write34_Object(Object o)
          --- End of inner exception stack trace ---
          at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
          at StardewValley.SerializableDictionary`2.WriteXml(XmlWriter writer)
          at System.Xml.Serialization.XmlSerializationWriter.WriteSerializable(IXmlSerializable serializable, String name, String ns, Boolean isNullable, Boolean wrapped)
          at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterSaveGame.Write80_Farm(String n, String ns, Farm o, Boolean isNullable, Boolean needType)
          at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterSaveGame.Write85_GameLocation(String n, String ns, GameLocation o, Boolean isNullable, Boolean needType)
          at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterSaveGame.Write127_SaveGame(String n, String ns, SaveGame o, Boolean isNullable, Boolean needType)
          at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterSaveGame.Write128_SaveGame(Object o)
          --- End of inner exception stack trace ---
          at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
          at StardewValley.SaveGame.<getSaveEnumerator>d__0.MoveNext()
          at StardewValley.Menus.SaveGameMenu.update(GameTime time)
          at StardewValley.Menus.ShippingMenu.update(GameTime time)
          at StardewValley.Game1.updateActiveMenu(GameTime gameTime)
          at StardewModdingAPI.Inheritance.SGame.Update(GameTime gameTime)

          It occured after the earning scene, when saving the game to be exactly.
           
          • Alhifar

            Alhifar Void-Bound Voyager

            Hmm, I'd had that fixed. Let me see what's going on again.
             
            • Alhifar

              Alhifar Void-Bound Voyager

              I did find one issue that would cause you to lose your stored inventories on restarting the game, but I can't seem to reproduce that issue. Where all did you have TeleChests?
               
              • Nurio

                Nurio Cosmic Narwhal

                If I understand this right, this is basically the same as the piggybank in Terraria, right? Except that you can have multiple different ones, depending on the 'id' (or rather, item) you assign to it?
                 
                • iart53

                  iart53 Void-Bound Voyager

                  List of mods I use, maybe it could help:

                  AccessChestAnywhere
                  AllProfessions
                  AnimalPetStatusMod
                  CalendarAnywhere
                  CJBCheatsMenu
                  CJBItemSpawner
                  FarmAutomation.ItemCollector
                  FarmExtensionSMAPI
                  GateOpener
                  GiftTasteHelper
                  HarvestWithScytheSMAPI
                  HealthBars
                  InstantGeode
                  LovedLabel
                  NPCMapLocations
                  PierresGeneralStoreMod
                  RegenMod
                  SMAPIChestLabelSystem
                  SMAPISprinklerMod
                  SmartMod
                  SocialMenu
                  Stardew_Save_Backup
                  StardewJCB
                  Telechests
                  VariableGrass
                  WaitAround
                   
                  • Alhifar

                    Alhifar Void-Bound Voyager

                    I haven't played Terraria, but if you're familiar with minecraft, it is similar to the Ender Chests there.
                     
                    • Nurio

                      Nurio Cosmic Narwhal

                      Okay, read up on Ender Chests and it is the same as the piggybank.
                      But what is this about a key exactly?
                       
                      • Alhifar

                        Alhifar Void-Bound Voyager

                        Basically, there's multiple shared inventories available, and you can choose which inventory the chest is accessing via the item you've set the chest to. So if you set one chest to wood and another to stone, they won't see each other's inventory. If you then set another chest to wood, it would see all the stuff in the first chest's inventory.
                         
                        • Alhifar

                          Alhifar Void-Bound Voyager

                          It looks like the issue is with AccessChestAnywhere. I'll have to figure out where he's adding a reference to a TeleChest that is trying to get saved, but for now they are just incompatible.
                           
                          • Nurio

                            Nurio Cosmic Narwhal

                            Alright, that's what I thought. Thanks
                             
                            • iart53

                              iart53 Void-Bound Voyager

                              You are right about the incompatible mods. For now I use your mod instead of the other, as I feel the ability shouldn't come free.

                              However, I thought the key used to bind the chest is SHIFT+Right Click? Right now I can bind the chest both with or without pressing SHIFT, so Right Clicking the chest while holding an item will do the same thing. I wonder which mods I have might be incompatible again. :nurusad:
                               
                              • Alhifar

                                Alhifar Void-Bound Voyager

                                I've uploaded a new version with config options that completely redoes how the inventory setting is handled. Can you try that and see if that works a little better for you?
                                 
                                • zoniventris

                                  zoniventris Void-Bound Voyager

                                  I really like the idea of this mod. I like to keep chests everywhere (e.g. one in the barn, one in the coop, one at each place I like to fish at...), and having a way to share inventory between these locations would be perfect.

                                  I have one bug and one observation/suggestion.

                                  The bug: It looks like my game isn't loading the chests correctly using the most recent version of the mod (1.1.0). I placed two linked chests on my farm and put a random item in their shared inventory. When I progressed to the next day, the game was able to save the TeleChests (in the last version, the chests failed to save, so that appears to have been fixed). I could access the inventory from both chests, and I could hit them with a tool to pick them up. However, when I quit and reloaded the game, the chests' inventory was gone, and I was no longer able to hit the chests to pick them up, though they were still visible on the map and blocked movement. There weren't any errors reported in the error log, but here it is anyway:
                                  Code:
                                  C:\Users\Aran\AppData\Roaming\StardewValley\ErrorLogs\MODDED_ProgramLog.Log_LATEST.txt
                                  Created log instance
                                  [12:22:01.769 PM] SMAPI Version: 0.40.0 Alpha
                                  [12:22:01.769 PM] Validating api paths...
                                  [12:22:01.769 PM] SDV Version: 1.07
                                  [12:22:01.771 PM] Injecting New SDV Version...
                                  [12:22:01.771 PM] Initializing SDV Assembly...
                                  [12:22:01.771 PM] Starting SDV...
                                  [12:22:01.801 PM] Patching SDV Graphics Profile...
                                  [12:22:01.817 PM] LOADING MODS
                                  [12:22:01.817 PM] Found Manifest: C:\Users\Aran\AppData\Roaming\StardewValley\Mods\HarvestWithScytheSMAPI\manifest.json
                                  [12:22:01.957 PM] Created psconfigs directory @C:\Users\Aran\AppData\Roaming\StardewValley\Mods\HarvestWithScytheSMAPI\psconfigs
                                  [12:22:01.957 PM] Loading Mod DLL...
                                  [12:22:01.957 PM] LOADED MOD: HarvestWithScytheSMAPI by ThatNorthernMonkey - Version StardewModdingAPI.Version | Description:  (@ C:\Users\Aran\AppData\Roaming\StardewValley\Mods\HarvestWithScytheSMAPI\HarvestWithScytheSMAPI.dll)
                                  [12:22:01.973 PM] Found Manifest: C:\Users\Aran\AppData\Roaming\StardewValley\Mods\TeleChests-1.1.0\manifest.json
                                  [12:22:01.973 PM] Created psconfigs directory @C:\Users\Aran\AppData\Roaming\StardewValley\Mods\TeleChests-1.1.0\psconfigs
                                  [12:22:01.973 PM] Loading Mod DLL...
                                  [12:22:01.973 PM] LOADED MOD: TeleChests by Alhifar - Version StardewModdingAPI.Version | Description: Adds TeleChests with linked inventories (@ C:\Users\Aran\AppData\Roaming\StardewValley\Mods\TeleChests-1.1.0\TeleChests.dll)
                                  [12:22:02.020 PM] Registered command: givetelechest
                                  [12:22:02.020 PM] LOADED 2 MODS
                                  [12:22:02.020 PM] Applying Final SDV Tweaks...
                                  [12:22:02.020 PM] Initializing Console Input Thread...
                                  [12:22:02.020 PM] SDV Loaded Into Memory
                                  [12:22:02.020 PM] Registered command: help
                                  [12:22:02.080 PM] XNA Initialize
                                  [12:22:02.082 PM] XNA LoadContent
                                  [12:22:02.227 PM] Initializing Debug Assets...
                                  [12:22:02.593 PM] Game Loaded
                                  [12:22:02.593 PM] Type 'help' for help, or 'help <cmd>' for a command's usage


                                  The observation/suggestion: At one point, I placed a TeleChest, progressed to the next day, deleted the main save directory, and replaced it with an older version from before I placed the chest. The chest was still there. If possible, it might be better to put the TeleChest save files in the same folder as the game's main save files, or in a sub-folder within that folder, since this would help keep the files in-sync with each other.
                                   
                                  • Nurio

                                    Nurio Cosmic Narwhal

                                    Actually, what happens if you use this mod and then uninstall it? Are the items in the Telechests lost forever? (Or at least, until your reinstall the mod again)
                                     
                                    • Alhifar

                                      Alhifar Void-Bound Voyager

                                      The bug you were seeing should be fixed in the release I just spun up. As for your suggestion, I'd prefer to keep all of the mod-related files in one folder for easy removal of the mod, but I definitely see how putting them in the save folder would be good as well. I'll definitely give it some thought.

                                      Yes, if you uninstall the mod with items currently in a TeleChest, they'll be gone. Any tools will be automatically replaced by the game with the base level, but the others will not show back up until you reinstall the mod.
                                       
                                        Nurio likes this.
                                      • GARRthePIRATE

                                        GARRthePIRATE Big Damn Hero

                                        Awesome! Thankful you left a way for me to change the crafting requirements too! :D
                                         
                                        • GARRthePIRATE

                                          GARRthePIRATE Big Damn Hero

                                          BTW... What would it take to get its very own sprite?
                                           

                                          Share This Page