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

    Seyph Scruffy Nerf-Herder

    Hi, I'm having trouble with adding some new furniture into the blank spaces of the Tilesheets/furniture.png when editing Data/Furniture.

    The new furniture I placed are the two desks furthest to the right.
    [​IMG]

    The code I'm using is
    Code:
    "Entries": {
          "730": "Birch Desk/table/2 2/2 1/2/1250",
          "733": "Oak Desk/table/2 2/2 1/2/1250",
    }
    which is basically a duplicate of
    Code:
    724: "Coffee Table/table/2 2/2 1/2/1250"
    in the data, but renamed and shifted to what I assume to be the appropriate "entry number" (index value?).


    When I go to test in-game, the icon looks fine, but when I go to place it in the world... it stays stuck in side view, mirrors its side view when I try to rotate it to face front, and yet somehow retains the proper rotated collision box. :lod:
    [​IMG]
    [​IMG] [​IMG]
    [​IMG] (gif)


    So far I've tried "table", "dresser", "long table" and "decor" furniture types for these desks (without changing item size and collision box). The only furniture type that seems to work remotely close to a vanilla "table" is a "long table", but the bottom 16px gets cut off.
    [​IMG]


    I've been successful with adding decor and painting items that don't rotate (and don't typically in vanilla) within the blank spaces... but I guess when I try to add rotating items, things go wonky. :facepalm:

    Am I doing something wrong, or is there a bug somewhere that I have just painfully been made aware of?
     
      Last edited: Aug 2, 2018
    • Pathoschild

      Pathoschild Tiy's Beard

    • sheetcakeghost

      sheetcakeghost Weight of the Sky

      Is there a way to get this to work with the wave bank as well?
       
      • Pathoschild

        Pathoschild Tiy's Beard

        @sheetcakeghost Not currently, though audio changes is something I want to look into in the future.
         
        • swyrl

          swyrl Scruffy Nerf-Herder

          Hi, I know that this may be a kind of odd question, but is it possible to use CP to load an additional tilesheet/spritesheet without replacing an existing asset? Use case would be modifying existing maps with new tiles, like adding a waterfall to the famrcave or something. I know I could probably just include an .xnb in stardew's Content folder, but that's a little bit messier, and doesn't really follow the new "everything in the mods folder" standard. (for example, the 2cute series and a number of custom farm maps use additional tilesheets.)

          EDIT: also, is it possible to add walls and floors, and if so, which data file should I edit?

          EDIT2: @Seyph I'm pretty sure you're using the wrong "rotation" value. I know I had the same difficulty when I was making custom furniture packs. Stardew's rotation system is kinda confusing. try setting it to a couple different values and see what happens.
           
            Last edited: Aug 11, 2018
          • Pathoschild

            Pathoschild Tiy's Beard

            Yep. You still need to replace the map file, but you can reference a custom tilesheet and just drop its .png into the same folder as the .tbin. Content Patcher will automatically load the tilesheet, so you don't even need a patch to load it.
             
            • swyrl

              swyrl Scruffy Nerf-Herder

              oh cool, thanks!
               
              • Pathoschild

                Pathoschild Tiy's Beard

                @swyrl I don't think you can add new wallpapers/floors with only Content Patcher, since the game has a hardcoded range for those. You could probably do it by creating a custom SMAPI mod though.

                @Seyph See swyrl's comment above. (I don't think pings work if they're edited in after the message is posted.)
                 
                • Mango666

                  Mango666 Big Damn Hero

                  Hi, apologies if this is the wrong thread! I am not a coder, so forgive any wrong terminology etc... OK all apologies out of the way!

                  I am trying to pull a Content Patch/Pack for Enchanted Extended Hilltop which uses two xnb files from other maps BusStop.xnb from Extended Hill-Top and SummerTown.xnb from Rosalies's Enchanted Hill-Top

                  Now, I have managed to get the Code together to use the xnb files for the Farm_Mining map and the BusStop as these are direct replacements in Content\Maps

                  However the game will not load without the SummerTown file being added to \Content - this is an additional file not a replacement. Is this something I can do and I don't understand how or do I need to change my map to something that does not require an additional file adding to make it "future proof"?

                  Also on a side note, totally thrilled with how easy you made the error reports etc... Can't believe I have managed to get as much working as I have!
                   
                  • Pathoschild

                    Pathoschild Tiy's Beard

                    @Mango666 Yep! First unpack the XNB files and update your content.json file (so you have Farm_Mining.tbin instead of Farm_Mining.xnb). Then just drop the SummerTown.png file into the same folder as the map file, and Content Patcher / SMAPI should detect the tilesheet automatically. If you need more help, feel free to ask in #modding on the Stardew Valley Discord and we'll help you in more detail. :)
                     
                    • HopeWasHere

                      HopeWasHere Existential Complex

                      Hi Pathos! First, I just want to say thank you for all that you do for this community, you have done so much for everyone here!

                      I was wondering if there was a way for content patcher to load files based on if the player was male or female. I just have so many different hairstyles that I had to split them up by gender to get them all to fit, and I would like the game to switch to the correct hair file depending on what the player chooses. Is this already something I can do? Or is it something that wouldn't be possible?
                       
                      • Pathoschild

                        Pathoschild Tiy's Beard

                        @HopeWasHere That's not currently possible, but it'd be easy to do. I'll create a ticket to look into that for a future update. Thanks for the suggestion!
                         
                          HopeWasHere likes this.
                        • keytars

                          keytars Void-Bound Voyager

                          Sorry if this is a dumb question, but how would I edit weapon names with this? I've tried using EditData, like

                          {
                          "Action": "EditData",
                          "Target": "Data/weapons",
                          "Entries": {
                          "0": "Sord/This thing is so unspeakably shitty you are having a hard time even holding it./2/5/1/0/0/0/3/-1/-1/0/.02/3"

                          }
                          }

                          to change the entry in Data/weapons.xnb of

                          content: #!Dictionary<Int32,String>
                          0: "Rusty Sword/A rusty, dull old sword./2/5/1/0/0/0/3/-1/-1/0/.02/3"

                          which will change the description for Rusty Sword, but not the item name despite what I put.
                           
                          • Pathoschild

                            Pathoschild Tiy's Beard

                            @keytars I think that should work. It might only affect new swords though, since previously-created swords cache some of their data.
                             
                            • keytars

                              keytars Void-Bound Voyager

                              @Pathoschild Yeah, that was it. Thanks for that, I wouldn't have thought to try spawning in new instances of them on my own.
                               
                              • MrRandom287

                                MrRandom287 Intergalactic Tourist

                                I would like to do this too, however I'm not sure as to how I would do such a thing. Could someone please help me out?
                                 
                                • Pathoschild

                                  Pathoschild Tiy's Beard

                                • coldazrael

                                  coldazrael Existential Complex

                                  Do you have a fair example use of HasFlag condition?
                                  Tried to load a certain asset when the farmer has completed the community center but it doesn't load at all.

                                  Here's my code.
                                  Code:
                                  {
                                  "Action": "EditImage",
                                  "Target": "TileSheets/furniture.xnb",
                                  "FromFile": "assets/furniture.png",
                                  "When": {
                                  "Enabled": "true",
                                  "HasFlag": "ccIsComplete",
                                  }
                                  },
                                   
                                    Last edited: Aug 22, 2018
                                  • Seyph

                                    Seyph Scruffy Nerf-Herder

                                    @swyrl

                                    Well, considering what I tried was a direct copy + paste of an existing table, I don't think I'm using the wrong rotation value. Using the Coffee Table as an example, straight from the vanilla Data\Furniture.xnb:
                                    Code:
                                    724: "Coffee Table/table/2 2/2 1/2/1250"
                                    Meaning, the item named "Coffee Table" is a piece of furniture with the "table" classification (allowing you to place objects on top), takes up a 2x2 area on the tilesheet, and has a 2x1 collision box in-game, with 2 frames of rotation - in which case, rotates perfectly fine from a vanilla standpoint.

                                    It is only when I try to add a modded "table" to the tilesheet (which has only 2 sprites: front and side), in a blank space next to it while using the exact same values, that a rotation value of "2" bugs out and decides to mirror the side view of the furniture when placed down. As it stands, the 2x2 it pulls from the modded furniture (the front-facing sprite) is only used as the inventory icon, while the placed furniture is the 3x1 side view.

                                    I have tested many different combinations of furniture class/dimensions/collision box/rotation values, to no avail.

                                    "Rotation" values
                                    1: 1 still frame (front-facing)
                                    2: 2 mirrored frames (side-facing)
                                    3: Oddly enough, displays similar behavior to value 2
                                    4: Cycles between 4 frames, whether they all exist or not (front, side, back (empty in this instance), side)
                                     
                                      Last edited: Aug 23, 2018
                                    • MissCoriel

                                      MissCoriel Phantasmal Quasar

                                      I am just starting to convert my mod into a Content Patcher.. Is there a way for me to make a Repeatable event so it can happen over and over again? Like, say an NPC comes to your door to give you a certain item every few days is there a way to make it repeat without having to make 100000000 new events?
                                       
                                      Thread Status:
                                      Not open for further replies.

                                      Share This Page