RELEASED Forage at the Farm

Discussion in 'Miscellaneous' started by Nishtra, Oct 28, 2016.

  1. Nishtra

    Nishtra Big Damn Hero

    StardewValley - Forage AtThe Farm.png
    Update 12.12.2016
    Forage at the Farm v1.5

    Added an option to exclude areas from spawn.
    Reworked settings defining a spawn area. Now it is possible to select several areas.
    Reworked spawn area definition and tile selection code.

    Both mods require SMAPI
    SMAPI 1.3 allows to use mods without recompiling them specifically for each OS, so these mods should work on Mac and Linux as well as Windows


    Forage at the Farm
    Link to Nexus

    Have you ever wondered why hazelnuts and daffodils, as well as other forageables, stay away from your farm unless you specifically plant them? This mod changes their behavior. Now they are as likely to spawn on your farm, as in every other part of Stardew Valley, and even more likely if you just wish so (and make some tweaks in the config file).

    What the mod does
    At the start of every day the mod runs a check to see if there are any suitable and empty tile, and spawns a number of forageable items. By default the mod checks the whole farm and spawns 1 seasonal item (on average) on the grassy tile, but these can be changed. Items lists for every season are also up to change (items are defined by the ID and an uncomplete list of ID's is included in the readme file). Additionally, your foraging skill and daily luck may raise the number of spawned items (or drop it if you are very unlucky).

    With the edited spawn list and spawn chances these spawned on the second day of spring.
    (Too)ManyDifferentForageables.jpg

    Spawning of forageables doesn't threaten your crops
    2016-11-02_07-37-16 notes forage.jpg


    Stumps to Hardwood Stumps
    Link to Nexus

    Originally designed as an extension to Forage at the Farm mod, but quickly became big enough to be a separate mod.

    This mod turns the stumps left after cutting trees into large hardwood stumps after a 5 days period of time (by default).
    Has more cheating potential than simple respawning, but at the same time is less immersion breaking (IMHO).

    Note: the mod uses 2 config files. The first is the general one, it contains basic settings of the mod and is located in the mod folder. The second one saves the location and age of stumps on your farm separately for every character, is located one level deeper in the psconfigs folder (it will be created once the ingame day changes for the first time playing with this mod) and I do not recommend doing anything with it (though, nothing should break if you do).


    Freshly cut
    Stumps stumps.jpg

    After 4 days.
    Stumps 4th day.jpg



    If you want to use ore spawning feature of the Hill-Top map on other maps or to improve standard Stardew Valley quarry check Mining at the Farm thread
     

      Attached Files:

      Last edited: Dec 12, 2016
    • Coolwyngs

      Coolwyngs Giant Laser Beams

      This is very nice thank you so much for sharing this mod with us.
       
      • Nishtra

        Nishtra Big Damn Hero

        UPDATE
        Added spawn list for winter.
        Added settings to define the spawn area.
        Added the setting for tile properties where objects can be spawned. Available values "Dirt", "Grass" and "Diggable".
        Fixed the triggering condition.
         
        • Nishtra

          Nishtra Big Damn Hero

          UPDATE
          1.3.1
          Removed fixing non-forageable items in the config when loading the game since it's often caused errors. Be careful with what items you are setting to spawn,
          Updated the code to be compatible with SMAPI 1.0.
           
            zyymurgy likes this.
          • Nishtra

            Nishtra Big Damn Hero

            UPDATE
            1.3.2
            Reimplemented fixing non-forageable items. Now you can once again make mistakes writing item ID's in the config file and once again cannot spawn fish and cooked dishes.
            Moved calling foolproofing from loading game to loading character event.
            Added fixing soilType in config file if it was set incorrectly.
            Patched for SMAPI 1.1

            Files for SMAPI 0.40 and SMAPI 1.1 are in the top post. Versions for SMAPI 0.40 will work with later versions for several future SMAPI updates (until old methods are fully deprecated)

            Also, added an "experimental" (don't worry it shouldn't break anything) mod for transforming regular tree stumps into hardwood stumps since it is thematically similar to foraging. Download is in the top post or on Nexus.

            Stumps trees.jpg Stumps stumps.jpg Stumps 3rd day.jpg Stumps 4th day.jpg



            PS I tried compiling a Mac/Linux versions using SDVCrosscompile and would greatly appreciate if someone who uses these OS confirmed if it works
             

              Attached Files:

              Last edited: Nov 20, 2016
            • Marcelo7

              Marcelo7 Big Damn Hero

              hey, how should i change the x,y configs for the omnifarm mod? the area of forageables is very small, it's just the little cliff, the shipping box area and the grass to the right border, the entire animal grass area is left out. (sorry if anything sounds strange, learning a new language is hard).
               
              • Nishtra

                Nishtra Big Damn Hero

                @Marcelo7 I think something like this will do
                "TopLeftCorner_X": 4,
                "TopLeftCorner_Y": 10,
                "BottomRightCorner_X": 116,
                "BottomRightCorner_Y": 116 ,

                Also, since the map is big and has a lot of non_spawnable tiles I think it might be good to raise baseNum.

                PS I'm working on a new version that will allow to select several soil types for spawn. It is basically ready, but I'm putting it off to release together with Mining at the Farm.
                 
                • Marcelo7

                  Marcelo7 Big Damn Hero

                  ok, thanks.
                  Edit: by the way, what does baseNum mean ?
                   
                    Last edited: Dec 6, 2016
                  • Nishtra

                    Nishtra Big Damn Hero

                    @Marcelo7 baseNum is the number of items you want to spawn, "base" part is there because this number is further modified by luck and skill level.
                     
                    • GoodChilds

                      GoodChilds Void-Bound Voyager

                      Nice Mod i expect new update from you
                       
                      • Nishtra

                        Nishtra Big Damn Hero

                        UPDATE
                        1.4
                        Changed "soilType" setting to accept several values.
                        Replaced "foragingBonus" (absolute value) with "bonusPerSkillLevel" (relative value)
                        Removed "tries" and "NoSpawn" settings to simplify config file.
                        Items can now spawn in the grass (not just a tile with Grass property) and on hoed tiles.
                        1.4.1
                        Added "verbose" setting to configure the amount of messages logged to console.
                         
                        • Nishtra

                          Nishtra Big Damn Hero

                          UPDATE
                          Forage at the Farm 1.5
                          Added an option to exclude areas from spawn.
                          Reworked settings defining a spawn area. Now it is possible to select several areas.
                          Reworked spawn area definition and tile selection code.
                           
                          • MbahGondrong

                            MbahGondrong Seal Broken

                            Thanks for this.. :)
                             
                            • Cragrim

                              Cragrim Void-Bound Voyager

                              Thank you for the mod! Awesome

                              Could you please explain the syntax for areas to include/exclude
                              FromArea/ToArea ?

                              config.json
                              "areasToInclude": [
                              "3,7/76,61"
                              ],
                              "areasToExclude": [
                              "71,13/72,13"
                              ],​

                              I'm speculating on the possibility of making this compatible with custom maps like OmniFarm.

                              //Best regards

                              OmniFarm map:
                              [​IMG]
                               
                              • Nishtra

                                Nishtra Big Damn Hero

                                I actually have written info on all the settings in the readme file, but in short:
                                in the string "3,7/76,61" first 2 numbers are x,y coordinates of the top-left corner tile of rectangle area, 2 numbers after slash are coordinates of the bottom-right corner. If you want several smaller areas, then the lines in quote marks should be separated by comma.
                                By default areasToInclude covers the whole area of standard farm, and areasToExclude - 2 tiles behind shipping box.

                                EDIT
                                And I just remembered that a several posts higher I left coordinates to cover the whole OmniFarm map
                                Though I'm not sure how fast going through all the tiles of large map would be on old computers, so you might want to exclude areas that would never have any spawns.
                                 
                                  Last edited: Dec 27, 2016
                                • Cragrim

                                  Cragrim Void-Bound Voyager

                                  Ah sorry for not reading through your readme file, I missed that.
                                  Which software do you use to view stardew maps in a grid system?

                                  Next step would be figuring out the how many tiles the omnimap is in total and just include the areas worth populating.
                                  These 9 areas to include should be enough to avoid having things spawn in water or unreachable spots. Example:
                                  [​IMG]
                                   
                                  • Nishtra

                                    Nishtra Big Damn Hero

                                    I'm using XNB Node to extract resource files and tIDE to work with maps. There are links to download and some guides in the top post of Modding Guides and General Modding Discussion.
                                    The most resource efficient way would be to input just the areas whth right conditions for spawn, but if your computer was bought in the last decade then it shouldn't have a problem with really inefficient (but quick and comfortable) way of including the whole map. Items still will spawn only on suitable tiles.
                                     
                                    • Cragrim

                                      Cragrim Void-Bound Voyager

                                      I've done some testing on using the software and repackaging modified tilesets.
                                      In the config only "Grass" is specified does this mean only the tiles with the property "Type" set to Grass will spawn forageable items?

                                      [​IMG]

                                      I've modified most grass tiles to be tillable with the property "Diggable" to "T" on the OmniFarm map as I prefer it that way.

                                      If I now add Diggable to the config, will this enable spawning forageable items in all the tiles with the diggable property?
                                      "soilTypes": [
                                      "Grass",
                                      "Diggable"
                                      ],​

                                      [​IMG]

                                      Sorry for asking silly questions, but a bit tedious to test this.
                                      Learning a bit here :) and I appreciate all the assistance you're giving me

                                      Cheers
                                       
                                      • TenkoKuugen

                                        TenkoKuugen Scruffy Nerf-Herder

                                        You can just change the config to this
                                        Code:
                                          ],
                                          "soilTypes": [
                                            "Grass",
                                            "Dirt",
                                            "Diggable"
                                          ],
                                        To include all the walk able types as valid spawn tiles. The map maker was really good about filling inaccessible places with invisible tiles to prevent out of bounds spawns.

                                        This is what I use by the way
                                        Code:
                                          ],
                                          "areasToInclude": [
                                            "98,25/112,53"
                                          ],
                                        Even with this AND mining at the farm in the same area, I never run out of space. I have my other areas covered by buildings and fields, that's why I limited the area.
                                        Code:
                                          "baseNum": 10.0,
                                          "bonusPerSkillLevel": 0.1,
                                          "chance": 1.0,
                                         
                                        • Nishtra

                                          Nishtra Big Damn Hero

                                          Yes.
                                          And yes. But "Diggable" property doesn't have to be true, as the mod checks just if it's value isn't empty.
                                           

                                          Share This Page