REQUEST Toggle to make flowers (or all crops) unclickable/unharvestable

Discussion in 'Mods' started by flyinghusky, Mar 16, 2016.

  1. flyinghusky

    flyinghusky Void-Bound Voyager

    I'm desperate to have this mod. My farm is basically a flower garden/paradise that helps me relax and unwind just by enjoying the scenery. It's extremely frustrating when I accidentally click on a flower. =(( Most of the time my cursor is far away from one but it picks them anyway when I click (e.g. trying to ride my horse). I'm hoping someone could help me out with this mod. I would extremely appreciate it and would be forever most grateful!
     
    • Undreamed

      Undreamed Scruffy Nerf-Herder

      this is a incredible idea for my honey garden :D

      +1
       
      • FinalMantasyX

        FinalMantasyX Big Damn Hero

        Seconded, but with the caveat that if possible they should be harvestable via scythe, but not by clicking.
         
        • Last_Aeon

          Last_Aeon Void-Bound Voyager

          How about there be a specific way to harvest it instead of simply picking it up?
           
          • flyinghusky

            flyinghusky Void-Bound Voyager

            That would be great too!! Maybe someone can find out how to change the code of the flower's harvest method to match those like wheats?
             
            • KingJoey

              KingJoey Phantasmal Quasar

              Looking for harvest methods I found some code in the game files determining what way to harvest (just picking up or scythe) this was in HoeDirt:
              Code:
                 
              if (this.crop.harvestMethod == 1 && this.readyForHarvest())
                    {
                      if (Game1.player.CurrentTool != null && Game1.player.CurrentTool is MeleeWeapon && (Game1.player.CurrentTool as MeleeWeapon).initialParentTileIndex == 47)
                      {
                        Game1.player.CanMove = false;
                        Game1.player.UsingTool = true;
                        Game1.player.canReleaseTool = true;
                        Game1.player.Halt();
                        try
                        {
                          Game1.player.CurrentTool.beginUsing(Game1.currentLocation, (int) Game1.player.lastClick.X, (int) Game1.player.lastClick.Y, Game1.player);
                        }
                        catch (Exception ex)
                        {
                        }
                        ((MeleeWeapon) Game1.player.CurrentTool).setFarmerAnimating(Game1.player);
                      }
                      else
                        Game1.showRedMessage("Requires Scythe");
                    }
              
              And I then I went into the 'Crop' code of the game file and found this:
              Code:
                   
              if (this.harvestMethod == 1)
                      {
                        DelayedAction.playSoundAfterDelay("daggerswipe", 150);
                        for (int index = 0; index < num1; ++index)
                          Game1.createObjectDebris(this.indexOfHarvest, xTile, yTile, -1, num2, 1f);
                        if (this.regrowAfterHarvest == -1)
                          return true;
                        this.dayOfCurrentPhase = this.regrowAfterHarvest;
                        this.fullyGrown = true;
                      }
              
              So I figured if harvestMethod == 1 the crop should be harvested with a scythe (I could be totally wrong here)
              I went on to the unpacked crops.xml (the yaml file) and started comparing the values of the crops that you harvest with a scythe (afaik Kale, Wheat and Amaranth) with the values of normal harvesting crops.
              Code:
              corn     483: "1 1 1 1  /summer fall/11/262/-1/1/false        /false/false" #!String
              amaranth 299: "1 2 2 2  /fall       /39/300/-1/1/false        /false/false" #!String
              Kale     477: "1 2 2 1  /spring        /5 /250/-1/1/false        /false/false" #!String
              
              Tomato     480: "2 2 2 2 3/summer     /8 /256/ 4/0/true 1 1 6 .05    /false/false" #!String
              Pepper     482: "1 1 1 1 1/summer     /10/260/ 3/0/true 1 1 5 .03    /false/false" #!String
              Rhubarb  478: "2 2 2 3 4/spring        /6 /252/-1/0/false        /false/false" #!String
              After some comparing I noticed the last number before the true's/falses is 1 on only Kale, Wheat and Amaranth and I hoped that would be harvesting method. I tried altering it with the flowers to no succes. Hope somebody can go from here or that this is of any help.

              Edit: I have no idea what is going wrong with the spacing at the crops, but you get the point.
               
                Last edited: Mar 16, 2016
              • flyinghusky

                flyinghusky Void-Bound Voyager

                I really feel that you're on to something. Here's to hoping that someone can help us out more!
                 
                • dk2020

                  dk2020 Space Penguin Leader

                  nothing is wrong. new flowers with that change will only be harvestable via scythe but existing flowers do not inherit the <harvestMethod>1</harvestMethod> tag. The new flowers once grown will. If you want existing flowers to be harvestable via scythe, you will have to edit your save game and set the <harvestMethod>0</harvestMethod> to <harvestMethod>1</harvestMethod> for each flower.
                   
                    flyinghusky likes this.
                  • flyinghusky

                    flyinghusky Void-Bound Voyager

                    Oooh. That is awesome!!!! Thank you for that clarification!! I'll now be able to frolic freely in my flower paradise without worrying about accidentally clicking anything. It would be awesome as well if someone can integrate this to SMAPI or similar tool so that others can easily use it too. :D
                     
                    • ThatNorthernMonkey

                      ThatNorthernMonkey Aquatic Astronaut

                      flyinghusky likes this.
                    • ThatNorthernMonkey

                      ThatNorthernMonkey Aquatic Astronaut

                    • Caudyr

                      Caudyr Black Hole Surfer

                      Is SMAPI even necessary for this mod, though? I like it...but I've been avoiding using SMAPI for awhile now. =x

                      I think I'll just do the XML edit myself and just worry about the crops for next season. Hopefully it works for the foraging ones, as well. :3

                      EDIT: That isn't to say that I don't appreciate the work ThatNorthernMonkey did, cause I do...I just...would prefer to avoid using that for as long as possible (forever if I can help it :rofl:). ^^
                       
                      • ThatNorthernMonkey

                        ThatNorthernMonkey Aquatic Astronaut

                        The only problem is (by design) you don't get any XP when harvesting with a Scythe. So Amaranth, Kale etc. in the default game is no XP :( With the mod you do! :p
                         
                        • Caudyr

                          Caudyr Black Hole Surfer

                          Ah, well. I normally don't find the whole thing tedious until I start getting a larger farm (at least fall of year 1)...so...it's not that big a deal for me, though that's definitely a nice touch.

                          It's not that hard for me to swap the original and 'modded' file once I've gotten to lvl 10 farming, though.

                          I'm not really sure why I avoid using SMAPI, but...I do. I think it might have to do with avoiding things that directly modify the .exe, tbh. ^^

                          EDIT: Though I did have one question...does this Crops thing include the foraging plants...and if so, would not using the API mod for that yet making them require scything stop me from gaining foraging exp with it...or does that only apply for the actual farming crops?
                           
                            Last edited: Mar 31, 2016

                          Share This Page