RELEASED Content Patcher *

Loads content packs that change the game's images and data without replacing XNB files.

Thread Status:
Not open for further replies.
  1. Pathoschild

    Pathoschild Tiy's Beard

    @Cvne Fixed in the upcoming SMAPI 2.6 beta 19. Thanks for the help on Discord!
     
    • Cvne

      Cvne Master Chief

      Yep, the dev build works great so far. Thanks for the speedy response. =)
       
      • Pathoschild

        Pathoschild Tiy's Beard

        Done! See character-specific dialogue and its five subsections. It should cover most cases, but it's possible I missed some cases or made a mistake. If you spot any issues, feel free to let me know or fix it yourself.
         
          Cvne likes this.
        • Cvne

          Cvne Master Chief

          Oh, that's fantastic. Location based dialogue, easy heart syntax, text bubbles... I'd been wanting to do all that since I started my mod so I can't tell you how nice it is that you found these.

          Am I blind, or have you forgotten to add that if you begin a sentence with %, as in %Abigail is lost in her music, a regular text box opens up which can be used to describe things? Example usage (typing up now, don't take my word that it'll parse):

          Code:
              "summer_4":
                  "%Suddenly a camera flashes in your face, then Haley smiles happily at you from behind the lens.",
          Also, what's the deal with https://wiki.stardewmods.com/Modding:Dialogue exactly? It seems like a less complete version of the wiki you linked to.

          And sure, I can edit the wiki myself if you want. I can at least provide some quick one-line usage examples.
           
          • Pathoschild

            Pathoschild Tiy's Beard

            @Cvne The dialogue is a pretty complex system, so I'm sure there's still a lot of missing. Feel free to add that. :)

            Stardewmods.com is one of the sites that steals mods and reposts them for advertising profit. I didn't know they did it for the wiki too, but I'm not surprised. They usually don't bother to keep their pages up to date (e.g. they still have SMAPI 0.40), so I'm not surprised it's outdated too.
             
            • Cvne

              Cvne Master Chief

              Weak, but I'm not surprised. I've been using the one you linked anyway.

              I'll add some usage examples and the like, but syntax keys (such as <location>_<x>_<y> which you just added) is not something I can really find on my own. Unless the existing .yaml files have concrete examples there's no way for me to know what's possible in the game code, so I'm afraid that's all on you.
               
              • Seyph

                Seyph Scruffy Nerf-Herder

                Hi again, popping in for a request.

                I was looking at Longevity, and was trying my hand at splitting the clothing part of the mod (DNPCC) into a content pack for personal use, but DNPCC has a lot of different situations that call for different clothing options: clothing dependent on general indoor/outdoor location, specific festivals, and even specific maps such as the beach or NPC's workplace. While I could technically stuff all of these options into a config, I would still have to edit it and reload the game for each situation, which can be rather tedious.

                I know this stuff can definitely be done with pure SMAPI, but I'm wondering if it would be feasible to add a feature to CP (for people like myself who are not as well-versed in coding.. :oops:) that reads player's current location, as well when the player is within a festival.


                Conditions
                Location: outdoor, indoor
                Event: egg, flower, luau, jelly, fair, spirit, ice, market, feast
                Map: beach, blacksmith, forest, joja, saloon

                Not sure if a Map condition would be all that useful, admittedly, but the other two can definitely be.
                Code:
                {
                   "Action": "Load",
                   "Target": "Portraits/Abigail",
                   "FromFile": "assets/Abigail/{{season}}_{{location}}.png", // assets/Abigail/spring_indoor.png, assets/Abigail/spring_outdoor.png, etc.
                }
                
                {
                   "Action": "Load",
                   "Target": "Character/Caroline",
                   "FromFile": "assets/Caroline/{{event}}.png", // assets/Caroline/egg.png, assets/Caroline/luau.png, etc.
                }
                
                {
                   "Action": "Load",
                   "Target": "Character/Clint",
                   "FromFile": "assets/Clint/blacksmith.png",
                   When: {
                      "Map": "blacksmith"
                   }
                }
                 
                • Pathoschild

                  Pathoschild Tiy's Beard

                  @Seyph I do plan to add more conditions (including location). It'll require some pretty big changes to how Content Patcher works though, so I'm not sure when that'll be available. :)
                   
                    Seyph likes this.
                  • Saint-in-Chief

                    Saint-in-Chief Scruffy Nerf-Herder

                    How do you delete an entry? I saw one of the updates added support for that, but I can't seem to find it in the documentation.
                     
                    • Pathoschild

                      Pathoschild Tiy's Beard

                      @Saint-in-Chief Set the entry value to null:

                      Code:
                             {
                                "Action": "EditData",
                                "Target": "Data/Events/SeedShop",
                                "Entries": {
                                   "3102768/j 15/H": null
                                }
                             }
                      
                       
                      • Pathoschild

                        Pathoschild Tiy's Beard

                        Vortex now officially supports SMAPI mods and content packs (including Content Patcher packs)! You can install them directly from the Nexus page, and install updates from within Vortex.

                        nexus-download-link.png

                        Caveats:
                        • This should work for any SMAPI mod or content pack, but it won't work for XNB mods.
                        • The Vortex alpha is Windows-only, but Nexus plans to make it crossplatform.
                         
                          hatmouse likes this.
                        • Saint-in-Chief

                          Saint-in-Chief Scruffy Nerf-Herder

                          How about editing the "name" of an entry? Is it possible? For example:


                          "Stone Fence": "390 2/Field/323/false/Farming 2"

                          to

                          "Iridium Fence": "390 2/Field/323/false/Farming 2"


                          The problem is I'm trying to change the name of an item in the crafting menu. I can change the name of the item itself when it shows in my inventory, but the item in the crafting menu doesn't change its name that way.
                           
                          • Pathoschild

                            Pathoschild Tiy's Beard

                            @Saint-in-Chief You can change the key by deleting and adding an entry, but I don't recommend that. The key is what's used by the game to recognise the data (e.g. when checking whether you've learned the recipe). Unfortunately the key is also used as the display name in English, which is inconvenient.
                             
                            • Allayna

                              Allayna Ketchup Robot

                              with Vortex, I have all my mods in Stardew/Mods, how do I get vortex to see them?
                               
                              • Pathoschild

                                Pathoschild Tiy's Beard

                                @Allayna I don't think Vortex can import your current mods; you'd need to remove them from your Mods folder and reinstall them through the Vortex links on Nexus. I suggest keeping a backup of your mods if you do though; Vortex is still in alpha, so there may be issues and limitations.
                                 
                                • Suppeedi

                                  Suppeedi Scruffy Nerf-Herder

                                  Hey, so, I'm still thinking it through and there's only a very tiny chance that I'll actually go ahead.. But anyway uh.. I have an idea for a mod, probably won't see the likes of day any time soon, haha..

                                  And I was wondering- could I use ContentPatcher alongside it? By which I mean.. ah.. ContentPatcher needs a content.json file and the images in an assets folder- something that other mods do not seem to use. So maybe I could make a mod and require ContentPatcher to edit pre-exiting images?

                                  Basically, would it work if all the conditions for a regular ContentPatcher mod were met ALONGSIDE a regular mod? I'd think maybe the 'ContentPackFor' option might make a problem, but I don't know..

                                  (Honestly, alternatively, I'm already thinking of simply splitting it up in two modfolders, which should work.)
                                   
                                    HopeWasHere likes this.
                                  • Pathoschild

                                    Pathoschild Tiy's Beard

                                    @Suppeedi Nope, a SMAPI mod can't also be a content pack. You can either have two mod folders, or use SMAPI's content API directly (though it's a bit more work than using Content Patcher).
                                     
                                    • Suppeedi

                                      Suppeedi Scruffy Nerf-Herder

                                      Double mod folder it is. Ah well. Thanks Pathos.
                                       
                                      • Pathoschild

                                        Pathoschild Tiy's Beard

                                        Content Patcher 1.4 beta 7 is now available! (For Stardew Valley 1.3 beta only.)

                                        Release notes:
                                        • Added Relationship condition to check the player's relationship with an NPC (like "Relationship:Abigail": "Engaged").
                                        • Added Hearts condition to check the player's heart level with an NPC.
                                        • Fixed case sensitivity issues in some cases.
                                        • Tweaked patch summary display order.
                                         
                                        • staarfruit

                                          staarfruit Pangalactic Porcupine

                                          I'm not sure if this is the right place to ask, but I don't wanna start a new thread just for this question. So I'm trying to recolor some of the crops, but I can't get the edits to show up in game, everything is loading in correctly, I'm not getting any errors, but it's not actually showing up in game.

                                          I'm having it edit/replace the crops.xnb in Content/TileSheets, is there another location for the sprites in this file? I know there's the Crops.xnb in the Data folder, but that shouldn't need to be touched right?
                                           
                                          Thread Status:
                                          Not open for further replies.

                                          Share This Page