RELEASED [SMAPI] New machines (flour, sugar, vinegar, rice?)

Discussion in 'Mods' started by Igorious, Mar 31, 2016.

Tags:
  1. darkuslord98

    darkuslord98 Void-Bound Voyager

    No problem, it's your mod
     
    • SeleneLanthan

      SeleneLanthan Void-Bound Voyager

      I waited very long for a mod like this. It does not appeal to me, why such basic functions are not implemented in the game itself.. Why should i buy flour/sugar/vinegar as a famer to make food when i have the possibility to harvest it myself. :)
       
        Preacher and Oboromusha like this.
      • Oboromusha

        Oboromusha Pangalactic Porcupine

        I'm starting to see these things consolidate with More Crops Mod so that all food items in the store can be replicated by crafting or farming (rice farming needs to happen - but may need a crafter for packaging, perhaps?)

        Also, recipes should start to change to reflect this. Chocolate cake needs the cocoa chips, for one. And new recipes should come up as a consequence of the changes introduced by these two mods. It seems to me that Ape left almost a full page empty for those, just so modders would indulge in their own creations without having to expand the UIs.

        This is shaping up to be what ties up the consistency with all the vanilla crafting and farming mechanics. Will stay tuned for developments.
         
          SeleneLanthan likes this.
        • taintedwheat

          taintedwheat Master Astronaut

          I think a cooking level mechanic would be SICK.

          Just cuz you can farm doesnt mean you can cook.
          On really lucky days make gold star meals.

          Bad days a higher chance of making it into junk that can be recycled into coal or fertilizer. Shit like that
           
          • Oboromusha

            Oboromusha Pangalactic Porcupine

            Yup, I second the motion for rated meals with boosts in effect duration and/or HP/Energy restoration values. That very much keeps that mechanic relevant and on the "menu" (pun intended) for your daily playthroughs because it will actually matter. Don't know if luck can factor into crafting, but if you use all golden star ingredients, you would get a golden star dish. This would have to apply to seasonings that you craft with these machines as well, naturally.

            It feels complicated and tiered, but one of the best meals in the game is the Complete Breakfast, which is multi-tiered. So there are incentives here for this.
             
              lordvalinar and taintedwheat like this.
            • Igorious

              Igorious Sandwich Man

              OK I've just finished work with v.1.1 of mod.
              It has predominantly only code changes.
              Link

              So, you can now use machines in your house! Except small time interval from 6:00 to 6:09.
              I'm still in search of code, that helps me trigger updating objects immediatly after game saving.

              And I've unified configuration of all machines. Now you can define custom price, quality and count formulae, or directly define them for each product.

              Example
              :
              Preserves Jar has formula
              Code:
              50 + 2 * p
              where p is base price.
              You can use p for base price, q for quality. And r1, r2 as random parameters for quality/count expressions.
              Be aware, one unique formula in configuration adds ~0.25 sec to mod loading time. So use it wisely.
               
                Last edited: Apr 6, 2016
              • Oboromusha

                Oboromusha Pangalactic Porcupine


                Tested and works, even in new interior locations like those added by Farmhouse Extended mod. Splendid job. Now the potential here is really vast.
                Work with More Crops Mod to have cocoa powder, rice flour, maybe sugar can also be extracted from actual sugar canes, etc. I'm not saying mod integration, but having these two work side by side will provide amazing new ways to process and use your produce.

                Thanks for the turnaround and dedication. Yet another essential mod now confirmed.

                EDIT: I can confirm issue with 6 am. If you leave a crafter running and go to bed to cut that day short, Saving process will freeze and you'll have to kill process to get out. The save never happens, so it seems there is no danger of save corruption. You do however have to make sure crafting is finished before you go to bed to ensure you can save that day.
                 
                  Last edited: Apr 5, 2016
                • Igorious

                  Igorious Sandwich Man

                  Thanks for testing. I will try to fix it.

                  I'n going to inspect, how to work with crops, after I'll have stable version of my mod engine.
                  I sure, we can easily integrate mods, using dynamic configuration loaded from .config file.
                   
                    ress_1819, Oboromusha and Superior_s like this.
                  • Oboromusha

                    Oboromusha Pangalactic Porcupine

                    No problem, that's how we get the ball rolling. Here is the part in the SMAPI log pertaining to your mod that flags an issue, with what seems like syntax problem in this .json file, not completely sure as I'm unfamiliar with these parameters, please have a look and see you have the same issue:


                    [09:45:35.135 ] LOADED MOD: Igorious' New Machines Mod by Igorious - Version StardewModdingAPI.Version | Description: Adds new machines to create flour, sugar and vinegar. (@ D:\Os meus jogos\Stardew Valley\Mods\IgoriousNewMachinesMod\Igorious.StardewValley.NewMachinesMod.dll)
                    [09:45:35.149 ] Invalid JSON (NewMachinesModConfig): D:\Os meus jogos\Stardew Valley\Mods\IgoriousNewMachinesMod\config.json
                    Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: F. Path 'Mill.Skill', line 6, position 12.
                    at Newtonsoft.Json.JsonTextReader.ReadStringValue(ReadType readType)
                    at Newtonsoft.Json.JsonTextReader.ReadAsString()
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
                    at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
                    at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
                    at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
                    at StardewModdingAPI.Config.LoadConfig[T]()

                     
                    • Alina_Mau

                      Alina_Mau Scruffy Nerf-Herder

                      I am loving this so much! and your vinegar jar is SOOOO cute! <3
                      Could you add vinegars made from alcohols? like wine vinegars? It weould work like a subtyping I suppose :eek:

                      Also are you able to add items to already existing machines? I've always wanted to put honey in the keg to make mead, potatoes in to make vodka, corn to make whiskey, and rice to make sake! *w* lol I don't even drink but for some reason the ability to make these things is fun to me :rofl: and I think a better use of the ingredients than just making awkward pickles :rofl:
                       
                        Oboromusha likes this.
                      • Oboromusha

                        Oboromusha Pangalactic Porcupine

                        Great ideas overall and I second that, I think that's great. And I haven't tested this myself just yet because it takes time, but wine is a parameter in the config file (output product is labelled "Wine Vinegar", so I'm assuming you are already able to use wine bottles as input for vinegar, just like apples. Cool thing about this is that the property is virtually the same, hitching a ride on what wine, juices, honey, pickles and jam already do on vanilla. So yes, all of these are usable on vanilla recipes, regardles of the variant name. They are all "vinegar".

                        From what I understand, right now adding parameters to existing .json files from vanilla is being looked at, but not fully mastered by modders. But I'm thinking that will happen soon. Developments in map modding, the crops and now this in just a span of a week and a half prove that, there's going to be plenty of cool stuff to use with existing object tiles as well as adding new ones very soon. And so far, I'm liking the overal respect for balancing. These are not cheat mods. At most they make the game more challenging if you want to check every box on the list of shippable produce (another thing more crops mod also made the courtesy of expanding for us).

                        This and Starbound, because of their amazing mod communities will end up being the best pieces of software Chucklefish ever released. And probably ever will.
                         
                        • Igorious

                          Igorious Sandwich Man

                          I will try to override default behavior.

                          So, to-do list:
                          - to test cases for game saving (sleep from bad, sleep from outdoor), try to find good solution;
                          - to try override in-game machines;
                          - to inspect work with crops and trees. It will be helpful to More Crops mod;
                          - to extend mod for adding items to shops. Now its α-version used in More Crops and, it seems, works stable.
                           
                            Alina_Mau likes this.
                          • Norfuer

                            Norfuer Orbital Explorer

                            You can edit the config file so that the vinegar jar takes in wines. The instructions are I think on page 2 or 3. :3
                             
                            • krakau

                              krakau Big Damn Hero

                              the new version 1.1 gives an error in config.json "unexpected character encountered while parsing value: F. path `mill.skill` line 6 position 12"
                               
                              • Norfuer

                                Norfuer Orbital Explorer

                                Looking at it through Notepad++, all I see in line 6 column 12 is the letter "F" in the "Farming" skill. I'm not really a programmer, but I've had a couple of courses on C and Java. Sorry I can't say more... =/
                                 
                                • Igorious

                                  Igorious Sandwich Man

                                  Missing quotes for string.
                                  I've updated .config file. Sorry.

                                  You can delete .config, if it's corrupted. After next run mod will create valid default config.
                                   
                                    Norfuer and Superior_s like this.
                                  • Igorious

                                    Igorious Sandwich Man

                                    Stable version 1.1.
                                    Mod shouldn't crash game during saving.
                                    I was forced to use cross-subcribing in events, UpdateTick event and capturing of .exe objects in my code. I don't sure, that mod still work right after all of this.
                                    Please check and post, if you found errors.
                                     
                                    • Entoarox

                                      Entoarox Oxygen Tank

                                      I'm not a modder, so excuse me if I am wrong, but should the `timeEvents.onNewDay` let you do what you want? By registering and then checking if the `newDay` argument is false?
                                      According to SMAPI code, the `newDay` will be `true` before saving, and `false` after, and the event is only triggered when the propery changes (so it triggers twice, once before saving as true, and once after saving as false)
                                       
                                        Igorious likes this.
                                      • Igorious

                                        Igorious Sandwich Man

                                        Big thank you!!! It works fine.
                                        Is any documentation for SMAPI exist?
                                         
                                        • ress_1819

                                          ress_1819 Void-Bound Voyager

                                          My game crashed twice at end-of-day save after using this mod, do you know why this is happening? Here's the crash log:

                                          [01:33:52.558 AM] [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 Igorious.StardewValley.NewMachinesMod.SmartObjects.Mill 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.Write60_FarmHouse(String n, String ns, FarmHouse 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)
                                           
                                            irene21000 likes this.

                                          Share This Page