RELEASED Custom Farm Types 1.1.7

Allow adding custom farm types.

  1. spacechase0

    spacechase0 Ketchup Robot

    spacechase0 submitted a new mod:

    Custom Farm Types - Allow adding custom farm types.

    Read more about this mod...
     
      fadedwaif, Flumme, Efa43 and 2 others like this.
    • hwayunhae

      hwayunhae Pangalactic Porcupine

      I've needed this in my life. SO MUCH. THANK YOU. (seriously, the pain of choosing between all the great maps was like emotional torture. now I just gotta make icons and jsons for all the different map mods I've been wanting to use. <3 You're the best.

      Edit: I was adding in the farms I'd been agonizing over (ali is very very good at map editing), and I had a (possibly silly) question. The farm type ID in the json, do I leave it as is, or rename it to something like:

      "Ali.Farm_Foraging.No_Debris"
      "StardewValley.Farm_Foraging.AliMap"

      Basically, what I'm asking is does it require a unique Farm Type ID, or can I leave the ID as is and just replace the map file with the one that's been edited?

      Sorry for the silly question, but I didn't want to screw something up first time trying your mod.
       
        Last edited: May 6, 2017
      • Coolwyngs

        Coolwyngs Giant Laser Beams

        Sounds so cool I can not make jsons, I don't know how. Nor do I believe I have the programs. Will you share yours?
         
        • hwayunhae

          hwayunhae Pangalactic Porcupine

          Ah, if its okay, I can share them, but regarding the programs, for json files (on pc at least), you can try to open it, and when your computer bring up the "choose program" screen, open it with notepad or wordpad. Once I get an answer on whether it needs a unique farm ID, if you tell me what map you plan to use, and what type its for (for instance, Omnifarm was meant to replace wilderness, but its really an everything farm, in supersize, so that's what I put it under), I can upload you a json if you're leery of editing it yourself. (though I don't know enough about coding yet to be willing to change all the fiddly bits in the example files. )

          I'd like hunker down and read the jsons to figure out the difference in behaviors when I'm not busy with my other projects (tIDE kills me. seriously.)

          Like figuring out whether is the type ID tag or the fiddly bits that indicate whether a map is No Debris, or will have debris. If its the type ID tag, it should be pretty simple for anyone to change, but if its the other things, it'll take a bit more paying attention to detail.....

          Edit: After posting about it I got curious. Heh. I took a look at the available example jsons, and either the different sections of the type ID are what controls it, or the debris is edited out in tIDE, and the typeID is a unique identifier for each map. Which seems more likely, now that I think about it. :D

          I did figure that the behavior preset makes it act like which farm its supposed to be:

          0 - standard farm types, custom farm type (that's what the fiddly bits are for!)
          1 - Riverland/Fishing Farm
          2 - Forest/Foraging Farm
          3 - Mountain/Mining Farm
          4 - Wilderness/Combat Farm
           
            Last edited: May 7, 2017
          • Coolwyngs

            Coolwyngs Giant Laser Beams

          • Ghostly Fox

            Ghostly Fox Heliosphere

            ...Okay, can someone explain in simple terms how one would use this with... say the Greener Pastures Mod? or do you still need the map edits for the functionality of the forage map stumps and berries for example?
             
            • Zalkyria

              Zalkyria Existential Complex

            • hwayunhae

              hwayunhae Pangalactic Porcupine

              It looks to me like Greener Pastures is a map xnb, so what I'd do is decide whether you want it to have "everything" (IE respawning stumps, minable ore, foraging) or to just replace the original farm like the greener pastures map was made to do.

              Make a copy of the "Standard_No Debris" map.

              Rename is something that tells you what it is. I decided to go with "Standard_GreenerPastures"

              Delete the map.xnb from the folder you just created.

              Place the farm.xnb from the Greener Pasture's Mod in there, and rename it "map.xnb"

              Open the .json in notepad.

              You'll see this:


              {
              "Name": "Standard w/o Debris",
              "Description": "Same as Standard, but starts without debris.",
              "ID": "StardewValley.Farm.NoDebris",
              "BehaviorPreset": 0
              }


              Change the Name to "Greener Pastures"

              Change the Description to whatever you want.

              Jury is still out on whether the type ID needs to be changed. Change the ID to "StardewValley.Farm.GreenerPastures".

              Leave the behavior preset alone.

              Save the json.

              No need to touch the icon unless you really feel like going into photshop and messing about to turn the yellow dirt near the farmhouse green or sth.

              Then when you make a new character, you should be able to choose your new farm as one of the options on the sidebar. (I hope that was simple enough.)

              Edit: Forgot half the instructions. Doh.

              If you choose everything its a bit more complicated.

              The first part is the same, only copying the wilderness, or the wilderness No debris one instead.

              When you get to the json, that's where it gets a bit fiddly.

              When you open it, this is what appears:


              {
              "Name": "Everything",
              "Description": "A farm incorporating features from every type, located in the forest.",
              "ID": "spacechase0.FarmType.Everything",
              "BehaviorPreset": 0,
              "Behavior": {
              "FishPoolToDrawFrom": [
              {
              "Area": {
              "x": 0,
              "y": 0,
              "width": 80,
              "height": 65
              },
              "PoolId": 0,
              "ListFromLocationID": 1
              }
              ],
              "FishPools": [
              [
              {
              "Chance": 0.5,
              "LuckFactor": 1.0,
              "OnlyTryIfNoneSelectedYet": false,
              "LocationPreset": null,
              "ObjectID": 734
              },
              {
              "Chance": 0.3,
              "LuckFactor": 0.0,
              "OnlyTryIfNoneSelectedYet": false,
              "LocationPreset": "Forest",
              "ObjectID": 0
              },
              {
              "Chance": 1.0,
              "LuckFactor": 0.0,
              "OnlyTryIfNoneSelectedYet": true,
              "LocationPreset": "Town",
              "ObjectID": 0
              }
              ]
              ],
              "FishingSplashChance": 0.5,
              "RepopulateStumps": true,
              "SpecialWeedCount": 6,
              "ForageableSpawnChanceBase": 0.75,
              "ForageableSpawnChanceMultiplier": 1.0,
              "ForageableSpawnBehavior": {
              "spring": [
              {
              "Chance": 1.0,
              "Area": {
              "x": 0,
              "y": 0,
              "width": 80,
              "height": 65
              },
              "Entries": [
              {
              "Chance": 0.25,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": -1,
              "ObjectID": 16,
              "InitialStack": 1,
              "OreHealth": 0,
              "SubEntries": null
              },
              {
              "Chance": 0.25,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": -1,
              "ObjectID": 22,
              "InitialStack": 1,
              "OreHealth": 0,
              "SubEntries": null
              },
              {
              "Chance": 0.25,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": -1,
              "ObjectID": 20,
              "InitialStack": 1,
              "OreHealth": 0,
              "SubEntries": null
              },
              {
              "Chance": 0.0,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": -1,
              "ObjectID": 257,
              "InitialStack": 1,
              "OreHealth": 0,
              "SubEntries": null
              }
              ]
              }
              ],
              "summer": [
              {
              "Chance": 1.0,
              "Area": {
              "x": 0,
              "y": 0,
              "width": 80,
              "height": 65
              },
              "Entries": [
              {
              "Chance": 0.25,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": -1,
              "ObjectID": 402,
              "InitialStack": 1,
              "OreHealth": 0,
              "SubEntries": null
              },
              {
              "Chance": 0.25,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": -1,
              "ObjectID": 396,
              "InitialStack": 1,
              "OreHealth": 0,
              "SubEntries": null
              },
              {
              "Chance": 0.25,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": -1,
              "ObjectID": 398,
              "InitialStack": 1,
              "OreHealth": 0,
              "SubEntries": null
              },
              {
              "Chance": 0.0,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": -1,
              "ObjectID": 404,
              "InitialStack": 1,
              "OreHealth": 0,
              "SubEntries": null
              }
              ]
              }
              ],
              "fall": [
              {
              "Chance": 1.0,
              "Area": {
              "x": 0,
              "y": 0,
              "width": 80,
              "height": 65
              },
              "Entries": [
              {
              "Chance": 0.25,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": -1,
              "ObjectID": 281,
              "InitialStack": 1,
              "OreHealth": 0,
              "SubEntries": null
              },
              {
              "Chance": 0.25,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": -1,
              "ObjectID": 420,
              "InitialStack": 1,
              "OreHealth": 0,
              "SubEntries": null
              },
              {
              "Chance": 0.25,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": -1,
              "ObjectID": 422,
              "InitialStack": 1,
              "OreHealth": 0,
              "SubEntries": null
              },
              {
              "Chance": 0.0,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": -1,
              "ObjectID": 404,
              "InitialStack": 1,
              "OreHealth": 0,
              "SubEntries": null
              }
              ]
              }
              ]
              },
              "NewSaveOreGenRuns": 28,
              "OreSpawnChanceBase": 1.0,
              "OreSpawnChanceMultiplier": 0.66,
              "OreSpawnBehavior": [
              {
              "Chance": 1.0,
              "Area": {
              "x": 52,
              "y": 50,
              "width": 11,
              "height": 11
              },
              "Entries": [
              {
              "Chance": 0.15,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": true,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": -1,
              "ObjectID": 590,
              "InitialStack": 1,
              "OreHealth": 0,
              "SubEntries": null
              },
              {
              "Chance": 0.5,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": -1,
              "ObjectID": 670,
              "InitialStack": 10,
              "OreHealth": 0,
              "SubEntries": null
              },
              {
              "Chance": 0.1,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": -1,
              "ObjectID": 0,
              "InitialStack": 1,
              "OreHealth": 0,
              "SubEntries": [
              {
              "Chance": 0.33,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": 8,
              "ObjectID": 77,
              "InitialStack": 10,
              "OreHealth": 7,
              "SubEntries": null
              },
              {
              "Chance": 0.5,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": 5,
              "ObjectID": 76,
              "InitialStack": 10,
              "OreHealth": 5,
              "SubEntries": null
              },
              {
              "Chance": 1.0,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": -1,
              "ObjectID": 75,
              "InitialStack": 10,
              "OreHealth": 3,
              "SubEntries": null
              }
              ]
              },
              {
              "Chance": 0.21,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": -1,
              "ObjectID": 751,
              "InitialStack": 10,
              "OreHealth": 3,
              "SubEntries": null
              },
              {
              "Chance": 0.15,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": 4,
              "ObjectID": 290,
              "InitialStack": 10,
              "OreHealth": 4,
              "SubEntries": null
              },
              {
              "Chance": 0.1,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": 7,
              "ObjectID": 764,
              "InitialStack": 10,
              "OreHealth": 8,
              "SubEntries": null
              },
              {
              "Chance": 0.01,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": 10,
              "ObjectID": 765,
              "InitialStack": 10,
              "OreHealth": 16,
              "SubEntries": null
              },
              {
              "Chance": 1.0,
              "LuckFactor": 0.0,
              "SkipChanceDecrease": false,
              "OnlyTryIfNoneSelectedYet": false,
              "MiningLevelRequirement": -1,
              "ObjectID": 668,
              "InitialStack": 10,
              "OreHealth": 2,
              "SubEntries": null
              }
              ]
              }
              ],
              "SpawnMonsters": true
              }
              }


              Eesh. Scary looking at first.

              You'll want to change the Name, Description, and ID as normal. Once again, leave the "behavior preset" alone. Under that, there is a section called behavior.

              Behavior seems to allow for changing the following:
              What you can fish up. (I could be wrong, but the code lead me to believe that you can fish multiple types. not a coder, doing my best here). I'll leave it up to OP or someone more experienced to explain how to do all these when/if they get around to it.

              You can change the percentage change of a fish splash appearing, chance of "special weeds". Whether or not stumps respawn. Different fiddly bits by season for foragable spawaning, etc. Oreg generation, I think it lets you change what and how often they spawn.

              My personal favorite, you can turn on or off whether monsters will spawn on your farm like they do on the combat farm. All without needing to install a mod that will affect every map you have the way Omnifarm does.

              I hope this helps.
               
                Last edited: May 7, 2017
                anothersarah likes this.
              • Ghostly Fox

                Ghostly Fox Heliosphere

                I was thinking the everything, minus the Fishing section to avoid breaking the game, but I had some concerns about what that could do with the stumps spread around on default. I guess I'll experiment at some point- thanks for the help.
                 
                • hwayunhae

                  hwayunhae Pangalactic Porcupine

                  No problem. Sorry I can't help more with all the fiddly parts. I'm not a coder. My realm is photoshop. But I've been poking and prodding to try and see if I can get it to do the same thing OmniFarm is supposed to after porting my Omnifarm map over to this mod.

                  Pretty sure anyone who wants to use a normal map edit for one of the main types can do it pretty easily, though. (Those who haven't been able to decide between the 3 different Greener Pasture's types won't have to now. That's a plus!

                  @Zalkyria @Coolwyngs

                  I'll see if I can upload my folders of those mods once I'm done getting them all done. I do not make any guarantees that anything in the "everything" folders will work, but I'll do a wilderness and an everything of OmniFarm just in case.
                   
                    Zalkyria likes this.
                  • Coolwyngs

                    Coolwyngs Giant Laser Beams

                    thank you so much
                     
                    • Zalkyria

                      Zalkyria Existential Complex

                      Okay thank you very much appreciated and also Ominfarm is awesome! I can't wait for that to be on there :D
                       
                      • hwayunhae

                        hwayunhae Pangalactic Porcupine

                        On testing, my question was answered. You have to change the name of the custom farmtype ID to something unique or smapi won't load it. I'll update my mini-tutorial now.

                        If I get permission to upload my files for this mod by the authors of the map mods in question to the public, I'll probably do so both here and in their own topic. For now, though, I'll be sending files to @Zalkyria and @Coolwyngs via PM.

                        Edit: I finished some map files (I even edited icons, why, me?!). after I test whether Smapi will load the custom greenerpastures on a new save, I'll send them to you guys.
                         
                          Last edited: May 7, 2017
                          Coolwyngs and Zalkyria like this.
                        • Coolwyngs

                          Coolwyngs Giant Laser Beams

                          Wonderful Thank you so much
                           
                          • hwayunhae

                            hwayunhae Pangalactic Porcupine

                            Mods this mod does not play nice with, according to my smapi log:
                            Save Anywhere
                            Move Shipping Containers
                            Some ALL location mods.


                            Upon attempting to load farm, game crashes at first save. Gonna try loading up one of OP's farms to see if its me or the mod. Because it's crashing on starting the farm, stardew isn't generating a log. Grrr. Guys, its gonna be a bit of a wait.
                             
                            • spacechase0

                              spacechase0 Ketchup Robot

                              ...Was not expecting so much activity so soon. :p

                              ID is unique per map file. I used a format similar to SMAPI (author.<whatever>), but it isn't important what it actually is.

                              The options are kinda complex because I wanted to be able to have custom farm types behave virtually the same as vanilla ones.

                              But yeah, the debris is edited out in the editor.

                              • The fish options are from the riverlands map.
                              • Stumps, special weeds (see the section here on the Forest map), and forageables from are from the forest map.
                              • Ore spawns are from the mountain map.
                              • Spawn monsters is from the combat map.

                              I'm not terribly familiar with what OmniFarm allows (I didn't know it existed), but let me know if there's anything you need. The only thing I can think of off-hand that I haven't implemented yet is to have specific areas to spawn stumps in instead of across the entire map. (Vanilla Forest only does it through x=20 if I remember correctly).
                               
                                hwayunhae likes this.
                              • hwayunhae

                                hwayunhae Pangalactic Porcupine

                                Okay, so ALL does NOT play nice with the new farms. I'm gonna remove all locations from inside it and see if GP will load. (It finally started generating the error logs after I took out YDE. Yay.)

                                Side Note: I can live without ALL if I can get this working.

                                @spacechase0 , Thank you for the response to my question. :D

                                Edit: I'm actually starting to wonder how much of this is just SMAPI 1.12 hating on me.
                                 
                                • hwayunhae

                                  hwayunhae Pangalactic Porcupine

                                  This is such good news it deserves a new post. I GOT IT WORKING!

                                  That said. You ABSOLUTELY CANNOT HAVE SEND LETTERS BETA RUNNING WITH THIS MOD. (I took that out and it stopped crashing my game). The log said that one the new farm it can't find you, and it causes an error that force-closes SDV.

                                  ALL is fine as long as you don't put in anything thats supposed to affect the farm. (Jungle temple, cleanup crew should be okay. Expanded crevices YMMV.)

                                  Remember to backup your saved games if you're gonna test any mods that connect to the farm map.

                                  Save Anywhere throws errors, possibly for the same reason Sendletters did, so its on you if you wanna test it.

                                  I'm gonna go ahead and send those files now that I've figured out the problem and verified my edits work. <3
                                   
                                    Coolwyngs likes this.
                                  • spacechase0

                                    spacechase0 Ketchup Robot

                                    I was editing my previous post, but since you responded I'll just make a new one.

                                    About the options:
                                    • General: Chances > 1 are the same as a chance of 1.
                                    • Fishing: You can set multple regions of tiles to pull to have different drop pools. A fish pool can have chances for more specific drops, which either pull from a pre-existing Location fish pool (such as Town fish or Forest fish) from Data/Fish.yaml, or a specific Object ID from Data/ObjectInformation.yaml. Chance is pretty straightforward. 0.5 is 50%, 0.75 is 75%, etc. Luck Factor is how much your daily luck affects this chance. 1.0 simply adds Game1.dailyLuck, 0.5 would add Game1.dailyLuck * 0.5, etc. For luck value examples, check the wiki. NOTE: Later entries CAN override previous entries that succeeded, unless you set OnlyTryIfNoneSelectedYet to true in the later entries. If no entry is selected, then you get the default farm fishing stuff. (Whatever that is).
                                    • "FishingSplash" is the shiny fishing spot you sometimes see. With vanilla farm types, this will never happen except on Riverlands. The chance is the chance that one will TRY to spawn every 10 in-game minutes. Once it will try, it will try three times and pick a random tile that will hopefully be water. (If it isn't, oh well. This means maps with more water coverage will get splashes more often, even with the same splash chance.)
                                    • "RepopulateStumps": Currently respawns ANY stumps on your map. For the vanilla forest map, it will only check the first 20 tiles from the left edge of the map. I intend to add repopulate regions at some point (similar to how everything else allows choosing a specific area).
                                    • "SpecialWeedCount": Special weeds are spawned every day. Check the wiki to see what they are.
                                    • Forageables: There is a base chance of a forageable spawning. If this passes, it will try to place something (which may or may not happen, if it tries to place it in water or something), and then try again with the previous chance times the multiplier (unless it chose something with SkipChanceDecrease set to true). This will keep going until a chance fails. (This means you can set the base chance over 1.0 to guarantee a certain amount of placement attempts. Just make sure the multiplier is less than 1!) While not shown in the example, multiple areas can be defined. The actual entry choice is similar to that of fish.
                                    • "NewSaveOreGen": How many times the ore placement (below) should run when you create a file.
                                    • Ore spawning: This works identically to forageable spawning, except it isn't per-season.
                                    • "SpawnMonsters": If monsters will spawn by default. This can be changed later in-game via the witch's hut, like normal.
                                    • About 'SubEntries': These work slightly differently from normal entries and fish. For these, once it picks a sub-entry, it stops. The ones after that don't matter.
                                    • Another note about forageables/ore spawns: If none of the entries are chosen, it will default to the last one. (This is NOT the case for fish!) This is why, in the everything file, the last forageable in each list has a chance of 0.
                                    • Did I miss anything?

                                    NOTE: I just realized that mining level requirement isn't actually taken into account at the moment. I'll fix that soon. Probably.
                                     
                                      Coolwyngs likes this.
                                    • Coolwyngs

                                      Coolwyngs Giant Laser Beams

                                      Great thank you so much for doing this.
                                       

                                      Share This Page