Modding Help How to use Platonymous' Custom Furniture Mod

Discussion in 'Mods' started by Kvoor, Aug 13, 2017.

  1. Kvoor

    Kvoor Void-Bound Voyager

    I have been searching all the forums I could find and researched all that pertains to it but I simply cannot understand how to use this to make furniture. I feel like I'm other-thinking it? Most likely but can someone please explain this to me like I'm five. Here's the mod page.
    Note: I have barely any experience with coding, I can do pixel art just fine (even the unpacking and packing).
     
      Flumme likes this.
    • MysticTempest

      MysticTempest Spaceman Spiff

    • Kvoor

      Kvoor Void-Bound Voyager

      I just wanted to make craftable plaques that you can make out of the legendary fish once you catch them... I know that's a long ways from this but I figured being able to put new objects in the game is the first step. Being able to make new furniture would also just be a nice thing to do, I have a good number of ideas. I just don't understand what to do with the information given.
      There's a script, I see... I copied the script, cut it down and changed the names and whatnot to a test image but smapi screamed about there not being no matching file path in about 6 locations or so and I just got flustered and stopped (it took me hours to find this mod to begin with, was already frustrated)
      So I was just hoping someone could explain this to me step by step because I get confused very easy.... For now I'm just making random hairstyles.
       
      • MysticTempest

        MysticTempest Spaceman Spiff

        Alrighty, I only ask because it helps find an adequate place to start explaining things.

        First off, after installing SMAPI, Custom Element Handler, and this furniture mod. You'll want to go into the CustomFurniture Mod folder.

        You should see the following files:
        Code:
        CustomFurniture
        ├── CustomFurniture.dll
        ├── CustomFurniture.pdb
        ├── Furniture
        │  └── Example
        │      ├── example.json
        │      └── example.png
        └── manifest.json
        
        Your mod will overwrite the Example folder.
        So, for instance you can create a folder like "KvoorPlaques" or whatever you want to call it.

        Then create 2 files inside; as an example, let's call them 'plaques.json', and a transparent png file named 'plaques.png'.

        Now using the examples Platonymous provided; lets reference some of that data.
        We'll change the Small Statue to a painting so you can see how it works.

        Here's the code for it from his example.
        Code:
        {
          "id": 2,
          "texture": "example.png",
          "name": "Statue",
          "description": "A small Statue",
          "type": "decor",
          "price": 100,
          "index": 10,
          "width": 1,
          "height": 2,
          "boxWidth": 1,
          "boxHeight": 1,
          "rotations": 1
          },
        
        Mostly a rehash of his image documentation: https://staticdelivery.nexusmods.com/mods/1303/images/1254-0-1497995735.png

        The "id" number is which furniture in the spritesheet it is. In this case; it's the 3rd piece; going from left to right, and with '0' always being the first item.

        The 'texture' is the spritesheet name. You can have all your furniture on one sheet, or do them individually, but it has to have the correct name.

        The 'name/description' entries are pretty straightforward. Just the text that is displayed for the furniture item.

        The 'type' is the important part. It tells the mod how to treat your art, furniture wise. Will it be a chair, a painting, rug, etc...

        Price is also straightforward.

        The 'index' is another location on the spritesheet. If we go back, and look at the mod page; the example image that has this stuff documented. You'll notice there's a grid overlayed on the furniture spritesheet.
        Each square, from 0 to 83 on the example is a 16x16 pixel square. The index as it mentions is the where the furniture item first starts. Similar to the id earlier, except in this case. Instead of counting which furniture it is; you count how many 16x16 squares it takes to get to that square.
        Again, starting from '0' at the top left, and going across the rows until you find what you're looking for.

        The 'width/height' are pretty easy. They're also determined by the 16x16 tiles. The small statue is 1 wide, and 2 tall. Or in other words; it's a 16x32 sprite.

        The 'boxWidth/boxHeight' are the collision boxes. The difference between walking around a chair, and a bookcase. The bookcase would have a wider collision box number. 1x1 for a chair, but a bookcase would be 2x1.

        Rotations; are pretty straightforward. 1 for default. 2 for horizontal/vertical orientations(the example mentioned is a rug), and 4 for something like a chair.


        For the last 3 'setWidth','animationFrames', and 'fps'; we'll need the Weather Vane & Rug as an example.

        Platonymous mentions the setWidth variable is the combined width of tiles involved in the rotations.
        Since the WeatherVane has no rotations it defaults to 2; the size of the full sprite. But, the rug has 2 rotations; so it'd be 5. 3 for the horizontal view, and 2 more when combing the vertical side.
        Animation frames are just that; how many frames you animate for the furniture piece. The Weather Vane has 4 frames in order to animate the statue's spinning vane.
        While the FPS is just how fast you want the animation to go.

        -----------------
        So, let's go back, and modify the small statue into a painting.

        Change the 'type' from "decor" to "painting". That will allow us to put it on the wall.
        But, it'll be placed awkwardly since we don't have the full height for it yet.
        You also need to change its 'boxHeight' to "2" to register its full size.
        After you do so; it'll go on the wall quite nicely.
        Code:
          {
          "id": 2,
          "texture": "example.png",
          "name": "Statue",
          "description": "A small Statue",
          "type": "painting",
          "price": 100,
          "index": 10,
          "width": 1,
          "height": 2,
          "boxWidth": 1,
          "boxHeight": 2,
          "rotations": 1
          },
        

        Now if you want to make your own plaque; using our earlier examples. You'll have to do something like this.
        First make sure you have the full furniture code; then in between the square brackets you write the code for the furniture items.

        Since you're using a new spritesheet, the one we created earlier. You need to change the 'id' and 'index' to "0" as this will be your first item. on that sheet(assuming you start in the top-left corner; else adjust the id & indexes accordingly). The texture will be the name of your spritesheet, and from there it's basically the same code described above modified to your liking.

        The "}, " right after "rotations" is the end of that furniture item. So, you can enter a new line right after, and start on the data for another furniture item.

        Code:
        {
          "furniture": [
          {
          "id": 0,
          "texture": "plaques.png",
          "name": "Bream Plaque",
          "description": "A wall-mounted fish.",
          "type": "painting",
          "price": 100,
          "index": 0,
          "width": 1,
          "height": 2,
          "boxWidth": 1,
          "boxHeight": 2,
          "rotations": 1
          },
          ]
        }
        

        That was a bit long winded, but does that help clarify things a bit?
         
          Last edited: Jul 21, 2018
        • Kvoor

          Kvoor Void-Bound Voyager

          Yes yes yes! Thank you so much! Once I can get in front of my computer screen and try again I shall let you know of my success. I already see where I went wrong the first time and that's a start! ^w^
           
            MysticTempest likes this.
          • Kvoor

            Kvoor Void-Bound Voyager

            Last edited: Aug 14, 2017
            Amburr and MysticTempest like this.
          • MysticTempest

            MysticTempest Spaceman Spiff

            Ah, that's good to hear; glad I could help!

            And, I love your plaque with the Legend; looks great!

            In terms of making it craftable; I'm not sure if that's possible. You'd best check with @Platonymous himself. I know he has "Custom Farming" which adds craftables to the crafting menu. While, "Custom Furniture" adds furniture to the furniture catalog & Robin's store. But, I don't know if there's any overlap; haven't seen any mention of it yet, at least.
             
            • Kvoor

              Kvoor Void-Bound Voyager

              Alrighty, I'll check it out ^^ Thank you, I'm working on the designs of the others as well while I take a break from reading so much code haha X3
               
              • Amburr

                Amburr Phantasmal Quasar

                This looks awesome!! I am all for this!! I love having collections and showing them off in my games. :laugh:
                 
                • xangria

                  xangria Subatomic Cosmonaut

                  Thanks for the explanation! is there anything like this to add more walls and floors to the catalogue?
                   
                  • MysticTempest

                    MysticTempest Spaceman Spiff

                    No prob! Uh, I didn't see a way to do so with this mod tool. Though Platonymous should be able to confirm whether it supports it or not.

                    From what I can tell, it looks like the game has the wallpapers & floor tiles coded differently than the furniture. As in, you can see the data sheet for the furniture like you can with craftables & crops, but I can't seem to find one for the walls/floors; so it's likely hardcoded.
                    That means, it'd need to be another smapi-based mod to give players access to that.

                    But, I'm not entirely sure. Once stuff starts heading into the deeper aspects of coding; it goes over my head. So, someone more knowledgeable would have to chime in.
                     
                    • xangria

                      xangria Subatomic Cosmonaut

                      Ok, thanks the for the input. Hopefully a tool becomes available. I'd love to add more custom decorations.
                       
                      • Kvoor

                        Kvoor Void-Bound Voyager

                        I'm not sure about adding in whole new wallpapers and flooring but you can definitely change the current wallpapers. I don't like the majority of them (I have simple tastes) so it's something I'm gonna give a go at.
                         
                        • Kvoor

                          Kvoor Void-Bound Voyager

                          Thank you! Currently I'm just going to release them as a furniture set as I cannot make them into craftables. I'm not skilled enough in coding to do it (tried for 3 days to no avail) I hope that's okay ^^;

                          Edit: Uploaded it to NexusMods here. Hope you like it, let me know if you have any questions or if I messed it up anywhere!
                           
                            Last edited: Aug 16, 2017
                          • Flumme

                            Flumme Subatomic Cosmonaut

                            My english is not really good and I'm a terrible technical Dummie, so excuse my question:

                            I got lost just from the beginning *shame*: Can I just put as many new files or folder into this FurnitureFolder? And than they will be addet to the Furniture Catalog / vendor?
                            But all the furniture files I have here are .xnb files and I need .json and .png files for the new furniture ... ?

                            Or just one file? And this file must be formed / you have to add the codes for new furniture to this one file?

                            How can I create a .json and .png files?
                             
                              Last edited: Aug 18, 2017
                            • MysticTempest

                              MysticTempest Spaceman Spiff

                              The furniture files from the game; the ".xnb" ones. They are packaged for the game. You can unpack those furniture spritesheets, and merge changes by overwriting other furniture. Then repack the file, but the .xnb will only be readable by the game.

                              But, for creating new furniture through this mod; it requires the .json & .png files.
                              You can put all the furniture in one image file; or make it multiple as long as the data it needs is correct.

                              As for creating the files. The .json is text based. And, the .png is an image file. So, when saving in your chosen text/image editor. Make sure you save the files with those extensions.
                               
                                Acerbicon, Kvoor and Flumme like this.
                              • Flumme

                                Flumme Subatomic Cosmonaut

                                I can't indstall this mod right now ... I made a whole new game installation (and also a mod new installation / update). And now it can't use it anymore. Same thing with CustomFarming. Does anybody have a new game / mod installation and the same problem?

                                Here is the error message. When I installed the CustomElementHandler I got NO error message ... but with the Farming and Furniture mod ... they seem to search something and not to find it.


                                EDIT: It's done. I made A LOT of test andf now it work: I have reinstalled everything once ... still not working. And now when I installed it a third time: Everything work fine!!

                                I reinstalled the ElementHandler AND even overwrote the files from this BasicMod again after the installation, to be sure. Than I reinstalled the CustomFarming and the CustomFurniture mod - and both seem to work right now. :)
                                 
                                  Last edited: Aug 28, 2017
                                  Kvoor likes this.
                                • Ahrnie

                                  Ahrnie Void-Bound Voyager

                                  Awesome! This was a huge help for me as well!!! Many Thanks! :D
                                   
                                    MysticTempest likes this.

                                  Share This Page