Modding Help "Painting all buildings 1.5 mod" - made good progress, but need some help (Edit: solved)

Discussion in 'Mods' started by OrinLinwe, Dec 27, 2020.

Tags:
  1. OrinLinwe

    OrinLinwe Void-Bound Voyager

    Hi, I recently started poking around with the 1.5 update, and after discovering that you can only paint fully upgraded buildings, I decided to see if I could remedy that.

    I released a mod on Nexus some time ago that has all the individual layers of all the buildings so you can repaint them in photoshop/Gimp, so the tedious work is already done.

    Through some trial and error, I now have the basic Coop "paintable", but I can't figure out how to make the starter farmhouse and the first upgraded farmhouse, and the greenhouse to "activate". They are on the same png, but so far only the default, fully upgraded house triggers for repainting.

    I've been posting on a reddit-thread with some updates, but haven't gotten any replies. Here is a link to the thread, and I will copy the self-documentation here, so I don't have to type it all up again:

    REDDIT_CROSS_POST:
    --------------------

    (first update)

    Update: Poking around in the new files, and each building that can be changed has a new, additional file called "filename_PaintMask", and the mask itself is a super-simple setup of green, blue and red fields that correspond to whatever you want to change.

    Emulating these wouldn't be much trouble, but I don't know how the game itself decides which building can be colorized like this.

    Interestingly, the PaintMask for the farmhouse has a mask for both the starter house and the second house, but only on the roof, which makes me think it was, at one time, planned to make all stages of these buildings customizable with a color (since the roof of each house is slightly different in shape, so it's not just a hold-over from one version of the building to the next).

    Despite having a (limited) Paintmask, the starter house and the first upgrade doesn't allow any adjustment, so there's something in the game-code that prevents it, despite there being an un-used paintmask for these versions of the buildings.

    EDIT//

    I made a quick PaintMask for house 1 and 2 that mimics the general layout of the fully upgraded house. Here is a link to both the packed houses.PaintMask.xnb and the source png file if you want to play around with it.

    EDIT2//

    Throwing in the new PaintMask I made doesn't automatically allow you to paint house 1 and 2. I didn't expect it to, but there was a chance that it would be this simple.

    So, something in the game-code is keeping a list of what building will allow the RBG-sliders (and has additional details, like specifying what each piece of the building should be called, like roof, trim, and perhaps keeping a save-file for each building that stores saved tone-picks for the player, etc).

    Still, it's something to play around with.
    -------
    Second update


    Ok, update, with some good news:

    I unpacked the PaintData.xnb which is a json file that has information about which building can be changed. I added "Coop" to the registry by copying a version straight from the deluxe Coop entry.

    Next, I unpacked a Deluxe Coop_PaintMask and copied the json file, and just changed the export-name to Coop_PaintMask.png" and packed it with a copy of the Deluxe Coop Paintmask.

    I then put the new Coop Paintmask.xnb with the buildings, and put the updated PaintData.xnb in the Data folder, fired up the game, and now I could paint the starter Coop!

    It looks messed up, but that's because it follows the general shape of The deluxe Coop. But the good news is that the option for painting was activated directly, on the save of a character that only had one building built (the Coop).

    So, some good progress. Next, I have to make a new coop paintmask to see how it actually behaves. I have a feeling that it's going to be a little tricky, and that one of the reasons all buildings weren't added in 1.5 is that the different buildings have slightly different standard colors (the Deluxe Coop is redish, the Coop has light beams and green walls), and that that could possibly mess with the new paintmask.

    That's just a guess though; will need to do more experiments.

    So far, I have two problems:

    1. I don't know what the paintdata refer to. It looks like this:
    content": {
    "House": "Building/-50 -10/Roof/-25 0/Trim/-25 -8",
    "Log Cabin": "Building/-20 20/Roof/-15 5/Trim/-10 5",
    "Stone Cabin": "Building/-15 25/Roof/-15 5/Trim/-5 5",
    "Plank Cabin": "Building/-55 -20/Roof/-10 5/Trim/-55 -30",
    "Stable": "Building/-20 5/Roof/-25 0/Trim/-15 0",
    "Big Shed": "Building/-45 -10/Roof/-20 5/Trim/-25 0",
    "Deluxe Coop": "Building/-25 0/Roof/-15 5/Trim/-25 0",
    "Deluxe Barn": "Building/-15 0/Roof/-10 5/Trim/-10 5/"

    So I just added "Coop" above "Deluxe Coop" with the exact same data string afterwards. I don't know what any of it means.



    2) I added a new paintmask for the original house and the first upgraded version of the farmhouse, but neither showed up as painting options, despite having a paintmask.png, and an entry in the paintdata.

    One guess is that the data entry above refers to where on the png map the new colors will fall, and only show up if that part has a corresponding paintmask color (one green, one blue and one red).

    Will have to keep playing with it.

    --------
    Third update


    Ok, new update. Got the Coop to work!

    https://ibb.co/k9TzkBP

    The planks are markedly darker than other painting buildings, and that's probably because the planks are green by default, and the layer-mask is red. It works alright, but I might see what using another color does.

    Still, it's perfectly usable in its current state, which is great.

    The problem is still that I don't know how to "activate" the first house, and the first upgraded house. The fully upgraded house is just called "House" in PaintData.json so it should work.

    If anyone has any idea, then let me know. Also, if the Greenhouse has a specific name separate from the houses, as it's on the same .png as the farmhouses. There's no reason why the greenhouse wouldn't be paintable.

    -----

    So that's as far as I've gotten. The numbers in the paintdata entry didn't seem to do much; I used the same copied entry from the Deluxe Coop when I did the Coop, and it works well. If anyone knows what these numbers mean, let me know. And, more importantly, if there's a way to have the game acknowledge the first and second farmhouse for repainting, and the greenhouse.

    Other than that, I could probably make layermasks for all these buildings, since I've already done the hard work, a long time ago.

    Cheers.
     
      Lillynetto likes this.
    • OrinLinwe

      OrinLinwe Void-Bound Voyager

      Posting to push the topic to the top, which I don't think is that terrible, given how impactful to the game it would be if all buildings could be "paintable".

      Still haven't figured out how to make the two main houses and the green house "click into place", script-wise. I have, however, slowly been working my way through the buildings, and have so far done the coops and the barns, and I've made two optional variants of the barns that allow for finer control of the coloring of the white beams of the side and open doors. The vanilla paintable solution to the Deluxe Barn is understandable, since it has so many elements to it if you're limited to three color options, but the composition of the barn graphic makes a lot of strong/bold color options look bad if the walls share the same hue-value as the beams (most red hues bleed over in a way that I don't think looks particularly great).

      My current plan is to slowly crawl through these buildings at whatever pace I feel like, and if I can't make the greenhouse or the first two farmhouses work, I will still release it as a mod, with those caveats, and have the mod open for collaborations if someone comes a long with a firmer grasp of the script-structure of the game. It's annoying that I can't make the most important buildings to a lot of playthroughs work - the two first farmhouses and the greenhouse - but even if I can't ever crack it, the rest of the currently unpaintable buildings will be paintable with this mod. So, that's something.

      Cheers.
       
      • OrinLinwe

        OrinLinwe Void-Bound Voyager

        Update: Ok, so I got the first and second farmhouse to work, and the greenhouse in both its ruined and rebuilt shape.

        Unfortunately, the new buildings don't always activate in Robin's shop, though most of them do. They are all, however, accessible when doing "debug bpm". After activating them once, they seem to work fine in Robin's shop, so perhaps it's just a thing that will be ironed out in the future.

        Good news is that everything seems to be working great. So, now I just need to finish them, and make some hue-choices on these buildings. I plan to also make - and have already made - a few versions of a couple of buildings, to allow for more flexibility in the way the colors are applied. You are limited to only three, and some buildings - the barns and main farmhouse, for example - have a lot of details, so it's really a judgement call on which parts are colorized (and in what hue).

        No deadline, but I'll be plugging at it when I have some time over, now that the buildings I couldn't get to work also work.

        here is a picture.

        Cheers.
         
        • OrinLinwe

          OrinLinwe Void-Bound Voyager

          Update: Making some good progress, and plugging away at the script-part right now. Because the farmhouse is so full of details, I decided to allow players to pick from 3 different paintmasks (that I think look good) that connect to different parts of the house. In one version, for example, the roof and lower beams of House 2 get colorized together, and in another version, the beams and roof is separate, but now they are connected to the window shutters.

          Also been playing around with adding additional, optional textures, like (for example) the welcome mats. In my config file, you can pick whether or not you want the vanilla style of welcome mats, or the "dimpled" one from the second house on all houses, or the smooth version from the first home on all houses. I also have an option in the config file where you can pick where the welcome mat gets its optional color from (you can connect it to the roof, the trim or the building, on top of picking what texture you want; or just leave it as "Vanilla").

          I am planing to implement something similar for the porch-section, where you can pick how its going to be colorized (from the roof, the trim or the building) and you also have an optional setting to pick an "unpainted" pale version, a weathered dark brown, or keep the vanilla version of the porch.

          It's been interesting to work on this project as a side-thing. It was a little frustrating to only have 3 options for colorization, but the limitations also has brought on some innovation in both what I can do, and also how I communicate these changes in the config.json file. For example, a lot of the config.json files I've looked at are phrased in a very utilitarian way, where you need to look up what options you can toggle on/off on a separate webpage, or text-document.

          I am currently trying to think of the changes I want to implement through "natural languages" (for example: "Which doormat do you want for your houses? Smooth, Dimpled or Vanilla?": "Dimpled").

          The farmhouses will be the most difficult part to get through, but I've made a lot of good progress already that I think will look quite nice (I also have some good optional textures just laying around on my drive; some of which I will offer as an option).

          It's helped a lot to use notepad++ (in terms of misspellings; I really encourage everyone to use it instead of windows notepad) and the debug menu from SMAPI. I think a big part of being able to deliver on a mod-idea is workflow, and so far so good.

          I had an idea of making a new tool - a paint roller - that you craft out of a roll of linen, driftwood and iron, and when you swing it near a "paintable building", it activates the paint-window. I haven't abandonded that idea (it's neat and pretty clever), but it's currently outside of my capabilities (I have no formal coding experience; just bits and pieces from games I enjoy engaging with).

          So, the current plan is to map the "paint any building function" (I currently use "debug bpm") to an action key, with default being "p". I'll have to figure out how to do that without relying on the debug command though.

          A lot of work left to do, but I'm making progress, and feel fairly confident that I will be able to deliver something.
           
            Last edited: Jan 21, 2021

          Share This Page