REQUEST Mod Request: Refrigerated Chests

Discussion in 'Mods' started by Schaeffer, Apr 13, 2016.

  1. Schaeffer

    Schaeffer Space Spelunker

    Require refrigerated chests for things like milk, eggs, tomatoes, etc.
    If anything that requires refrigeration spends 2 days outside of a refrigerated container, it turns into a trash item (which you can then recycle, as one would with compost). A custom trash item texture specifically for spoiled food in this mod would look nice, but isn't necessary. It would just need to look like a pile of mush and that could be used for all spoiled food. Maybe instead of making it a trash item you could have a machine that converts compost into wheat for your silos?
    The refrigerated chests could just be white versions of the standard chests, maybe something like this?:
    I was thinking about this when I realized my character was eating cheese that I placed in a chest a year prior, and thought about how disgusting that would be in real life.

    Anyone know if this mod is possible?
      suzannemonroe likes this.
    • suzannemonroe

      suzannemonroe Scruffy Nerf-Herder

      great idea! i hope this is possible & someone makes it
      • Entoarox

        Entoarox Oxygen Tank

        Custom machinery is currently a difficult task as it is, most likely this isnt going to happen until SMAPI has a system for handling serialization of them.
        • lannihamm

          lannihamm Big Damn Hero

          There is Vixxi's fridge box mod, which changes the wooden chest sprite into that of a white fridge chest.
          • Schaeffer

            Schaeffer Space Spelunker

            That would be perfect, I guess the only thing keeping me from using that is the fact that I still like to use standard wooden chests for non-perishables. I would need something exactly like that, but something that adds a new chest sprite for the fridge rather than replacing the current one. Thanks for the link, though!
            • Vixxi

              Vixxi Aquatic Astronaut

              I have seen a few people able to add new things to the game, such as the new crops mod. But I personally have no idea how you could have different chest models added. Would be a cool idea though.
                RoastedCoconutz likes this.
              • taintedwheat

                taintedwheat Master Astronaut

                @Igorious could probably make a new crafting recipe by just replicating the code for the regular wooden one and using this sprite? it might not be actual fridge for perishables but at least there will be different looking containers to separate non-food and food items.
                  Vixxi likes this.
                • Alina_Mau

                  Alina_Mau Scruffy Nerf-Herder

                  I'd be ok with this being just a visual roleplay type change, like just a secondary type of chest for kicks

                  I never cared for the perishables system in HM as it made stacking items 10 times more difficult but the idea of losing star quality for not properly storing your perishables, reducing it to a base quality item, would be alright. Maybe even storing something properly could increase the quality, like a special fridge chest could have that ability (probably crafted using iridium)

                  A mod like this would be extremely difficult to build with the current limitations but it has potential to being pretty unique
                    Schaeffer and taintedwheat like this.
                  • Igorious

                    Igorious Sandwich Man

                    It's interesting...
                    But @Entoarox is right, while we haven't way to serialize custom properties, we can work only in one-day limits.
                    Can you describe it more formally?

                    Egg/Milk/Cheese + 2 days outside refrigerator = Trash (?)

                    OK, how you wish to resolve problem, that many items in one inventory cell is, formally, one item?
                    E.g. I have one-day milk, than I will add fresh milk to same inventory cell. What freshness they will have?

                    I can try implement this for one-day period. If you don't hide Egg/Milk/Cheese into refrigerator, you'll get «Trash».
                    This approach solves problem with serialization and freshness recalculation.
                    • taintedwheat

                      taintedwheat Master Astronaut

                      Could it be a one-day limit set on a craftable item (or is that serialization problem too?) reason I'm asking is i'd like to keep chests in the barns w/ milk, cheese, etc <having it in more than one place, not really sure, just because>
                      • Igorious

                        Igorious Sandwich Man

                        Sorry, I can not undestand your message :(

                        Object class has hardcoded restrictions, that is problem:
                        So we can add custom behaviour, but I've not found way to add custom data, like «freshness» or something like that.
                        • taintedwheat

                          taintedwheat Master Astronaut

                          Dude, I will apologize ten times in advance --while I am well written most of the time, being conversational and typing as such is difficult for me to portray outright. I constantly have to edit everything. I'll try my best to be better at it, promise. <sometimes I'm just lazy> (idk if it's because im high all the time, or because of some of my conditions, w/e)

                          by the looks of this we can create new chests then?
                          Fix the wallpaper in quantum's farmhouse expanded map?
                          Make high heels, add use the crabpot for something else (someone wants to use it for the rice crop), more statues, more fences, more rings?
                            katgirl28888 likes this.
                          • Igorious

                            Igorious Sandwich Man

                            @taintedwheat, maybe it all are posible. I will try again to serialize custom objects. I sure, way to do this exists.
                              Schaeffer and taintedwheat like this.
                            • Igorious

                              Igorious Sandwich Man

                              ... or not :(

                              I will try to explain, why custom classes can't be serialized at the current moment.
                              @Entoarox, maybe it will be interesting for you.

                              Let's look at class for game locations:

                              All objects at location are stored in special collection called SerializableDictionary. This class writes information from memory to save-game xml-file.
                              If we look at its implementation, we can found method WriteXml:
                              We can see, that XmlSerializer uses information of specific type TValue, in our case it's TValue = Object.
                              So, I need explain, how exactly XmlSerializer works.
                              It gets types and then for each type compile (!) specific function. Compiled functions work lot faster, than usual reflection functions.
                              XmlSerializer gets Object type and all types, that are described in [XmlInclude]:

                              Therefore XmlSerializer can't work with custom types, because it doesn't know about them and it has not created functions for them.
                              It used locally, therefore we have not access to it to add custom type information.

                              So, it's bad news :(
                              • Schaeffer

                                Schaeffer Space Spelunker

                                So basically CA could add it, but no one else can mod it in..
                                Could a mod move this thread from Mods to Suggestions?

                                Share This Page