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. VonLoewe

    VonLoewe Void-Bound Voyager

    Hi, for someone wanting to get started with content patcher, is there a documentation for the path, coordinates and size of each in-game sprite, to help write the contents file?
    I understand perfectly how CP works but I have no idea how people create mods that replace so many tiny sprites without manually going through each xnb to find out where each sprite is located, opening it up in some image software to find the exact coordinates and size, etc..
     
    • Pathoschild

      Pathoschild Tiy's Beard

      @VonLoewe We have documentation for specific topics, which explains which assets to edit (e.g. for dialogue or portraits). For the coordinates and sizes, you can open the image asset in an editor and select the region you want to edit; most image editors will show the coordinate and size of the selection somewhere on-screen. In some cases you can also calculate the coordinates given the sprite size and index, but it's usually faster to just check in the image editor.
       
      • Pathoschild

        Pathoschild Tiy's Beard

        LoiteringAround likes this.
      • leadpotato

        leadpotato Yeah, You!

        Hello, I seem to be the only one having this problem; when I run the game using SMAPI it tells me that the Content Patcher mod cannot be loaded, with no further information. I have dowloaded the latest version of this mod 5 times, and each time deleting the previous file. I even cleared out my trash bin and this problem still persists. Kind of feeling helpless right now because there's literally nothing I can do to fix this.
         
        • Xshathra

          Xshathra Space Spelunker

          Hey, will Content Patcher ever be compatible with the android version of Stardew Valley?
           
          • Moonwaferr

            Moonwaferr Void-Bound Voyager

            Hi! I'm also having trouble with SMAPI saying content patcher does not load.
             
            • pepoluan

              pepoluan Big Damn Hero

              Haven't played SDV for sometime and return to 2 wonderful news:

              1) 1.4 is out! And

              2) Omigosh @Pathoschild you've implemented the {{Random}} token, that's awesome!

              Now I need to parse the mods to ensure compatibility with 1.4 assets and I'm good to go :catwink:

              Hmmm, after seeing this request (different config per save file), I think it would be wonderful to have CP allow "per-save" config.json.

              A backward-compatible way would be for CP to check for the existence of "config-PlayerName.json" in the mod's directory, and if exists, merge values from that file on top of the values in "config.json".

              This way, users that do not need per-save variation can keep using config.json as before, but users wanting variation between their save files can simply create a "config-PlayerName.json" to override settings in "config.json". Definitely much simpler than havint the player edit "content.json" (which will get overwritten when the mod gets upgraded).

              Probably the best time to check the existence of per-save config is during the SaveLoaded event, though I'm not sure if FarmerName already exists at that point.

              What do you think, @Pathoschild ?
               
                Last edited by a moderator: Dec 30, 2019
                Dawnstar1202 and HopeWasHere like this.
              • Pathoschild

                Pathoschild Tiy's Beard

                @leadpotato @Moonwaferr Can you upload your SMAPI log (see instructions on that page) and post a link here?

                @Xshathra Content Patcher has been compatible with Android for a while now. Android doesn't have the latest game update, so make sure you get the download marked "For android players only".

                @pepoluan The upcoming Content Patcher 1.11 has some big improvements to the {{Random}} token if you're interested. Per-player configuration is a bit tricky, since content packs can use config tokens before the save is loaded; it's not impossible though, and it's something I want to add in a future version.
                 
                  pepoluan and Dawnstar1202 like this.
                • Pathoschild

                  Pathoschild Tiy's Beard

                  Content Patcher 1.11 is now available!

                  Release notes:
                  • Added Lowercase and Uppercase tokens.
                  • Random tokens can have 'pinned keys' to support many new scenarios (see readme).
                  • Random tokens are now bounded for immutable choices (e.g. you can use them in numeric fields if all their choices are numeric).
                  • FromArea and ToArea fields can now use tokens (thanks to spacechase0!).
                  • Optimized asset loading/editing a bit.
                  • Fixed warning when an EditData patch references a file that doesn't exist when that's checked with a HasFile condition.
                  • Fixed HasFile token being case-sensitive on Linux/Mac.
                  • Fixed error if a content pack has a null patch.
                   
                  • Pathoschild

                    Pathoschild Tiy's Beard

                  • leadpotato

                    leadpotato Yeah, You!

                  • Pathoschild

                    Pathoschild Tiy's Beard

                    @leadpotato Updating to SMAPI 3.0.1 should fix most of those:
                     
                    • leadpotato

                      leadpotato Yeah, You!

                      Ok I feel pretty dumb now, but I swear I thought I had the most recent version of SMAPI when I was going through this. Thank you
                       
                      • Pathoschild

                        Pathoschild Tiy's Beard

                        Content Patcher 1.11.1 is now available!

                        Release notes:
                        • Mitigated OutOfMemoryException issue for some players. (The underlying issue in SMAPI is still being investigated.)
                        • Reduced performance impact in some cases when warping with content packs which have a large number of seasonal changes.
                        • Fixed patches being reapplied unnecessarily in some cases.
                        • Fixed token validation not applied to the entire token string in some cases.
                        • Fixed Random tokens being rerolled when warping if the patch is location-dependent.
                        • Fixed error when married to an NPC that's not loaded.
                         
                          Ladysarajane likes this.
                        • ahalwl11

                          ahalwl11 Orbital Explorer

                          Hello, I found the Bug in CP 1.11 ver.

                          No rechoose {{value}} even day pass in characters dialogue data, whereas rechoose {{value}} when a new day starts in "character schedules data."

                          cf.
                          characters dialogue data => ex) characters\Dialogue/Alex
                          Schedule data => ex) characters/Schedules/Alex

                          In example,

                          "{{dayofweek}} {{day}}"

                          In Characters dialogue, it prints "Monday 1" when monday 1st, but still prints "Monday 1" when next day Tuesday 2nd even came.
                          In the other hands, it prints appropriately in Schedules dialogue.

                          Pls check this problem.
                          Because yet I Checked Only 'dialogue' & 'schedules' that i commended above, it may have another Bug in other parts.
                          I always thank you very much for your efforts.
                           

                            Attached Files:

                            • 1.JPG
                              1.JPG
                              File size:
                              222 KB
                              Views:
                              15
                            • 2.JPG
                              2.JPG
                              File size:
                              197.1 KB
                              Views:
                              16
                          • Pathoschild

                            Pathoschild Tiy's Beard

                          • ahalwl11

                            ahalwl11 Orbital Explorer

                            This is it.
                            There are test code in '[cp] dialogue' 251 line. /* ~~~~~~ */

                            Please note that this file made by korean.
                             

                              Attached Files:

                              Last edited: Dec 30, 2019
                            • mardrest

                              mardrest Pangalactic Porcupine

                              Hello, i need help by editing the MoviesReactions file. What i have is this, but i know its wrong, as it didn't load. I wan't to change the name for Sam and others.
                              Code:
                              {
                              "Action": "EditData",
                              "Target": "Data/MoviesReactions",
                              "Entries": {
                                "Sam": {
                                "NPCName": "Sam",
                                "Reactions": [
                                 {
                                  "Tag": "dislike",
                                  "Response": "like",
                                  "Whitelist": [],
                                  "SpecialResponses": {
                                   "BeforeMovie": {
                                    "ResponsePoint": null,
                                    "Script": "",
                                    "Text": "It's an old movie with lots of talking, right? Hmm...$s"
                                   },
                                   "DuringMovie": {
                                    "ResponsePoint": null,
                                    "Script": "/message Sam \"Sam is playing his handheld video game system.\"",
                                    "Text": "Huh? Oh! Yeah... The movie's... interesting...$10"
                                   },
                                   "AfterMovie": {
                                    "ResponsePoint": null,
                                    "Script": "",
                                    "Text": "Yeah... Uh... That one character was interesting... And, um... heh...$10"
                                   }
                                  },
                                  "ID": "reaction_4"
                                 }
                                ]
                              }
                              }
                              }
                              
                              Thank you
                               
                                Last edited: Jan 17, 2020
                              • babybird22

                                babybird22 Void-Bound Voyager

                                Hi Pathoschild!
                                As you may remember, I have asked you some question about the NPCs marriage mod.
                                Many thanks for your help that I eventually released my Wizard marriage mod last year (Download Link : https://drive.google.com/open?id=1Iub7bCdxGCSaufNbA2wVzYB7B66W8yQw)
                                This mod seemed to working well. However, after the update of SDV 1.4, some players reported to me that there was a serious bug about the festival event.

                                The background what is happening:

                                In order to make Wizard attend all the festival, I knew there are two approach: 1. edit the festival map with Tiled 2. Setting festival spots for NPCs with TMXloader.
                                Seeing that the NPC would disappear in the flower dancing event, I finally chose to edit all of the festival maps:

                                {
                                "Action": "Load",
                                "Target": "Maps/Forest-FlowerFestival",
                                "When": {
                                "WizardAttendFestivals": "True",
                                },
                                "FromFile": "assets/Forest-FlowerFestival.tbin"
                                },

                                As stated above, this mod worked well before the release of SDV 1.4. However, recently my player told me that the game crashed when the farmer talking to the booth (e.g. the Pierre and Fortune Teller).
                                I checked the SMAPI log that my player provided to me but I didn't know how to fix this bug :(

                                Would you mind giving me some suggestions? Thanks!
                                 
                                • LehGaming

                                  LehGaming Void-Bound Voyager

                                  Hi, I'd like to ask if there is, or if there is a possibility of, a token that registers the time of the day
                                   
                                  Thread Status:
                                  Not open for further replies.

                                  Share This Page