RELEASED [Storm] CraftPlus! - Craft items using resources from chests 0.05

Craft items using resources in your chests instead of just your character inventory

  1. ThatNorthernMonkey

    ThatNorthernMonkey Aquatic Astronaut

    [​IMG]

    CraftPlus v0.01

    Always back up your save before using mods! I'm serious!!


    With this mod you can craft items from your crafting tab using resources that are stored inside chests, instead of just in your character inventory! It currently only uses chests located in either the Farmhouse, Farm or Greenhouse.

    Source: https://github.com/ThatNorthernMonkey/CraftPlus

    I'm always in irc.freenode.net #stardewvalley-mods if you require assistance (daylight GMT hours) :)

    Requirements

    Storm Mod Loader: http://community.playstarbound.com/threads/storm-modding-api-super-alpha.108484/

    ---->The StormLoader.exe in the zip file<----
    This mod uses events I have added that I cannot currently push to the main Storm branch. Storms master branch is undergoing huge changes (including changes to events) so my merge requests would not be accepted at this time. You must copy the StormLoader.exe from the .zip file into your Stardew Valley install folder. You can use my Youtube guide to find out how to do this in the Storm forum topic above.

    ---->The injectors in the zip file<----
    For the same reason outlined above, you also need to replace your injectors in %appdata%/StardewValley/Storm/ as no pull requests are being accepted for Storm at the minute.

    Stardew Valley 1.06
    Mod Files (attached)

    Known Issues

    - This is the first release, there may or may not be bugs! Please report any and all problems here so I can take a look at them. Backup your save file!.

    -Currently the mod will consume the first items in the first chests it comes to, ignoring quality. Be wary of the Quality Fertilizer! You may or may not ending up consuming a legendary fish! Place a chest inside one of your animal buildings and put your really rare items inside as a "safe zone".

    - Does not work with items in the fridge. While the fridge is represented as a Chest, its actually stored as a field on the FarmHouse class. I won't be writing accessors and wrappers for Storm until the rewrite is complete.

    -This does not affect cooking recipe crafting. Yet. Most of the code is there, I just need to fiddle about with it a bit more. Cooking will commence like normal - i.e., with items from the fridge or your character inventory.

    Future Plans

    - Have the mod consume lowest quality items first.
    - Implement a "Safe Chest" option, where you can put items inside the chest and the mod will skip them.
    - Cooking recipes
     
      Last edited: Mar 22, 2016
      leafi, Flumme, Lycheeee and 10 others like this.
    • Midaychi

      Midaychi Scruffy Nerf-Herder

      A great idea, thanks!
      A suggestion for future plans though: Enable it for kitchen recipes as well, and have a number next to the craftable that shows approximately how many you can make?
       
        ThatNorthernMonkey likes this.
      • saranghaes2

        saranghaes2 Void-Bound Voyager

        Hey guys! Sorry for being nooby but I don't understand where to put the files from the zip folder. Anyone willing to help a guy out? :) (I put it in my mod folder in appdata/.../stardewValley/Mods but it doesn't load in?)
         
        • Midaychi

          Midaychi Scruffy Nerf-Herder

          You have to install storm API binaries from http://storm.handsomematt.co.uk/builds/
          by getting your favorite zip from there, opening it and going into the appdata folder (in the zip), and dragging that storm folder inside to X:\Users\<user>\AppData\Roaming\StardewValley\
          where <user> is your username and X is your system drive letter.
          If you're using a version of windows earlier than 7, you might have a different directory to put it into instead. (documents and settings or just straight appdata)

          Then go back in the zip and into the stardewvalley folder (in the zip) and you'll see a bunch of dlls and exe and stuff. Drag all that into X:\<Path to Steam>\steamapps\common\Stardew Valley\
          Obv if you somehow use a non-steam version, the directory for this will be different.

          That's the api installed. For this mod then, you want to put the craft plus folder from the zip into the same base folder you stuck that storm folder in earlier, insode of a "Mods" folder (create it if it's not there)
          Example: On win 10 the folder would go into X:\Users\<user>\AppData\Roaming\StardewValley\Mods\

          If you don't care about achievements (or don't use a steam version), then you just run from StormLoader.exe in the steamapps folder,
          if you do care about achievements, then go into steam and right click stardew valley, go to properties, and open "set launch options". In the popup that shows, you'll want to enter in

          "X:\<PathtoSteam>\steamapps\common\Stardew Valley\StormLoader.exe" %command%

          Where X is the drive letter steam is on and <Pathtosteam> is the path to steam.
          If you installed stardew using steam library folders, then point to that instead.
           
          • Midaychi

            Midaychi Scruffy Nerf-Herder

            THAT SAID, now that I have had a chance to try it, this mod doesn't seem to actually work?
            Any of the semi-recent storm versions end up in this error,

            [LocalModLoader] Failed to load mods from assembly CraftPlus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null due to error System.TypeLoadException: Could not load type 'Storm.StardewValley.Event.OnConsumeCraftingIngredientEvent' from assembly 'StormLoader, Version=0.1.1.0, Culture=neutral, PublicKeyToken=null'.
            at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
            at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()
            at System.Reflection.RuntimeMethodInfo.GetParameters()
            at Storm.ExternalEvent.AssemblyModLoader.LoadModsFromAssembly(Assembly assembly)


            ..and you'd need to include a lot more than just the EXE if you expect people to use THAT version.

            EDIT: even using the earliest 1.1.0 build, actually, and the exe you provided was of the 1.1.0 build, SOOO.... how did you even get this to run?
             
              Last edited: Mar 21, 2016
            • ThatNorthernMonkey

              ThatNorthernMonkey Aquatic Astronaut

              Edit: sorry guys, forgot a ton of stuff that I've now added to the OP. Completely my bad, this wouldn't have worked for anyone. If you use the injectors and StormLoader.exe I have provided this should now work.
               
                Last edited: Mar 21, 2016
              • ThatNorthernMonkey

                ThatNorthernMonkey Aquatic Astronaut

                Give me a minute, I actually need to include my injectors too. Eugh. Will see if I can port this to SMAPI in the coming days.
                 
                  Trdonja and Superior_s like this.
                • ThatNorthernMonkey

                  ThatNorthernMonkey Aquatic Astronaut

                • Midaychi

                  Midaychi Scruffy Nerf-Herder

                  After installing the latest storm, then extracting your edited version of storm over it (You still need the other binaries and libraries), and putting the mod in the mod folder, the mod appears to load and work. Neat.
                   
                  • ThatNorthernMonkey

                    ThatNorthernMonkey Aquatic Astronaut

                    Oh yes, I was kinda assuming whoever was installing the mod had already followed the guide to install Storm beforehand - so the other libraries would have already been there :) A few complexities to porting this over to SMAPI (on top of learning SMAPI itself) so I'm starting easy (Harvest With Scythe port). Hopefully get this done at some point though.
                     
                    • DrRyouBakura

                      DrRyouBakura Void-Bound Voyager

                      I know it's not exactly the same but you know you can already cook with the food in your fridge without taking it out right?
                       
                      • zeraxx

                        zeraxx Subatomic Cosmonaut

                        The main problem is the space of fridge is limited and there are a lot of ingredients in this game.
                         
                          This JustIn likes this.
                        • This JustIn

                          This JustIn Tentacle Wrangler

                          Yea, but the fridge holds as much as a chest does for the sake of cooking. Do you know how inconvenient that is?
                           
                          • ThatNorthernMonkey

                            ThatNorthernMonkey Aquatic Astronaut

                            I had a good look at expanding this for cooking this morning, and its definitely possible. The fridge is a chest, but unfortunately it's stored as a field on the FarmHouse class. I would have to write accessors, wrappers and injectors for FarmHouse if I wanted to implement it - and right now demmonic is rewriting Storm to auto generate accessors and other things. It would be wasted effort tbh. Until Storm is ready for use again I'm currently just working on porting old mods to SMAPI (though I will fix bugs that arise in my Storm mods before then). Thanks for checking! :)
                             
                            • saranghaes2

                              saranghaes2 Void-Bound Voyager

                              I think the github download is completely different from the attached download (attached download has .dll and .json files where as the github download has .suo files and .cs files etc) so I think it was just my bad for downloading the wrong link ^^;; Thanks for explaining though! I didn't mean to make you list the storm api install steps, I already had it installed. Sorry D:
                               
                                ThatNorthernMonkey likes this.
                              • Superior_s

                                Superior_s Sandwich Man

                                It's great seeing people add features to the game that make it better.
                                 
                                • Midaychi

                                  Midaychi Scruffy Nerf-Herder

                                  Attempting to craft while in the town will cause a fatal hang of the game with this mod installed, if all the ingredients are only in your inventory.
                                  I suspect it's causing a null pointer error if there's no such object in the farm chests.

                                  Example for testing: Have wood at farm chests, go to town and craft a fence just fine, have some wood in inventory and some in farm, do the same just fine, take ALL but ONE wood (Not enough to make fence with) and craft a fence just fine in town,

                                  BUT

                                  take ALL wood from ALL chests in farm and go to village, craft fence and get a fatal hang.
                                   
                                  • ThatNorthernMonkey

                                    ThatNorthernMonkey Aquatic Astronaut

                                    So grab every piece of wood and put it in char inventory, head into town and craft a fence? Checking this out thanks :)

                                    Edit: Spotted the problem, fixing.
                                     
                                      Last edited: Mar 21, 2016
                                    • ThatNorthernMonkey

                                      ThatNorthernMonkey Aquatic Astronaut

                                    • Duckcat

                                      Duckcat Void-Bound Voyager

                                      I watched your youtube video and did precisely what you said to install storm, but when I launch it, it just crashes. Here is the log, I mean it says it loaded but I don't really understand the rest.

                                      [LocalModLoader] Failed to load mods from assembly CraftPlus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null due to error System.TypeLoadException: Could not load type 'Storm.StardewValley.Event.OnConsumeCraftingIngredientEvent' from assembly 'StormLoader, Version=0.1.1.0, Culture=neutral, PublicKeyToken=null'.
                                      at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
                                      at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()
                                      at System.Reflection.RuntimeMethodInfo.GetParameters()
                                      at Storm.ExternalEvent.AssemblyModLoader.LoadModsFromAssembly(Assembly assembly)
                                      Loaded CraftPlus 0.02 by ThatNorthernMonkey
                                      [CecilInjectorFactory] Loaded 1545 injectors.
                                      [CecilEventCallbackInjector] Instruction 2801 out of bounds
                                      StardewValley.Game1 Draw (Microsoft.Xna.Framework.GameTime)System.Void
                                      PostDrawCallback (Storm.StardewValley.Accessor.StaticContextAccessor)Storm.Manipulation.DetourEvent

                                      System.Int32[]
                                      [CecilEventCallbackInjector] Could not find injectee!
                                      StardewValley.Game1 playSound (System.String)System.Void

                                      PlaySoundCallback (System.String)Storm.Manipulation.DetourEvent

                                      [CecilFieldAccessorMutatorInjector] Could not find field!
                                      StardewValley.Farmer temporarySpeedBuff System.Single
                                      TemporarySpeedBuff System.Single False
                                      [CecilFieldAccessorMutatorInjector] Could not find field!
                                      StardewValley.Farmer movementMultiplier System.Single
                                      MovementMultiplier System.Single False
                                      [CecilFieldAccessorMutatorInjector] Could not find field!
                                      StardewValley.TerrainFeatures.Flooring whichView System.Int32
                                      WhichView System.Int32 False
                                      [CecilFieldAccessorMutatorInjector] Could not find field!
                                      StardewValley.TerrainFeatures.Flooring isSteppingStone System.Boolean
                                      IsSteppingStone System.Boolean False
                                      [CecilFieldAccessorMutatorInjector] Could not find field!
                                      StardewValley.TerrainFeatures.FruitTree greenHouseTree System.Boolean
                                      GreenHouseTree System.Boolean False
                                      [CecilFieldAccessorMutatorInjector] Could not find field!
                                      StardewValley.Game1 thumbstickMotionMargin System.Int32
                                      ThumbstickMotionMargin System.Int32 False
                                      [CecilFieldAccessorMutatorInjector] Could not find field!
                                      StardewValley.Object health System.Int32
                                      Health System.Int32 False
                                      System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Method '_GetThumbstickMotionMargin' in type 'StardewValley.Game1' from assembly 'Storm-Hooked-Game, Version=1.0.5900.15624, Culture=neutral, PublicKeyToken=null' does not have an implementation.
                                      at StardewValley.Program.Main(String[] args)
                                      --- End of inner exception stack trace ---
                                      at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
                                      at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
                                      at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
                                      at Storm.StardewValley.ManagedStardewValleyLauncher.Launch()
                                      at Storm.Program.Main(String[] args)
                                      [CecilInjectorFactory] Loaded 1545 injectors.
                                      [CecilEventCallbackInjector] Instruction 2801 out of bounds
                                      StardewValley.Game1 Draw (Microsoft.Xna.Framework.GameTime)System.Void
                                      PostDrawCallback (Storm.StardewValley.Accessor.StaticContextAccessor)Storm.Manipulation.DetourEvent

                                      System.Int32[]
                                      [CecilEventCallbackInjector] Could not find injectee!
                                      StardewValley.Game1 playSound (System.String)System.Void

                                      PlaySoundCallback (System.String)Storm.Manipulation.DetourEvent

                                      [CecilFieldAccessorMutatorInjector] Could not find field!
                                      StardewValley.Farmer temporarySpeedBuff System.Single
                                      TemporarySpeedBuff System.Single False
                                      [CecilFieldAccessorMutatorInjector] Could not find field!
                                      StardewValley.Farmer movementMultiplier System.Single
                                      MovementMultiplier System.Single False
                                      [CecilFieldAccessorMutatorInjector] Could not find field!
                                      StardewValley.TerrainFeatures.Flooring whichView System.Int32
                                      WhichView System.Int32 False
                                      [CecilFieldAccessorMutatorInjector] Could not find field!
                                      StardewValley.TerrainFeatures.Flooring isSteppingStone System.Boolean
                                      IsSteppingStone System.Boolean False
                                      [CecilFieldAccessorMutatorInjector] Could not find field!
                                      StardewValley.TerrainFeatures.FruitTree greenHouseTree System.Boolean
                                      GreenHouseTree System.Boolean False
                                      [CecilFieldAccessorMutatorInjector] Could not find field!
                                      StardewValley.Game1 thumbstickMotionMargin System.Int32
                                      ThumbstickMotionMargin System.Int32 False
                                      [CecilFieldAccessorMutatorInjector] Could not find field!
                                      StardewValley.Object health System.Int32
                                      Health System.Int32 False
                                      System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Method '_GetThumbstickMotionMargin' in type 'StardewValley.Game1' from assembly 'Storm-Hooked-Game, Version=1.0.5900.15624, Culture=neutral, PublicKeyToken=null' does not have an implementation.
                                      at StardewValley.Program.Main(String[] args)
                                      --- End of inner exception stack trace ---
                                      at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
                                      at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
                                      at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
                                      at Storm.StardewValley.ManagedStardewValleyLauncher.Launch()
                                      at Storm.Program.Main(String[] args)
                                       

                                      Share This Page