Modding Discussion Modding Guides and General Modding Discussion--REDUX

Discussion in 'Mods' started by cantorsdust, Mar 10, 2016.

  1. CyclopsDragon

    CyclopsDragon Void-Bound Voyager

    I'm trying to compile the wave bank for a minor audio component of a mod, but XACT keeps telling me that "The audio file uses an unsupported format" whenever I try to build it. I'm not sure what it's referring to because the file format is correct (WAV). Anyone know what could be causing this? For reference, it also does this when I just recompile with the files straight from the extraction of the original wave bank.
    • RainCloudsOnTheMoon

      RainCloudsOnTheMoon Void-Bound Voyager

      Hey everyone!

      I have a question about editing the player's house.

      I have XNBNode and have extracted the xnbs, edited the png files, repacked the files, replaced the new edited files in the game, but when I load the game nothing has changed.

      I followed the instructions for editing XNB files exactly, but I think it might have something to do with the player's home being a Map file.

      So, should I try to use tIDE and see if editing the Map files changes things? I've spent hours combining the mods I want and I just don't want it to be all for nothing.
      • Bubblebeam

        Bubblebeam Subatomic Cosmonaut

        Not sure if I'm posting in the right place for this question. Haven't logged in here forever. Did anyone ever make a simple mod to remove the slow walk inside the bathhouse to a normal speed? It feels like time is unnecessarily robbed visiting the bathhouse due to the slowed up walking.
        • minotaur

          minotaur Void-Bound Voyager

          Hey! Sorry to be a bother but I've been having issues with opening the command prompt itself. So far I've:
          1) downloaded the XNB Extract linked above
          2) extracted the files to my Stardew Valley folder
          3) attempted to open the xnb_node file.

          This is where I get stuck. The command prompt opens for a shut second before closing itself again and I can't use it. The command prompt says WINDOWS/system32/cmd.exe but my computer runs on the Windows 64 bit system.
          The Pack Files and Unpack Files work just fine, but I'd like to be able to edit maps. I've also successfully used the previous version of the XNB Node (0.2.1) in the past. I'm sorry if this issue has already been addressed. (I feel like I'm missing something really basic here, but c...:down:)

          EDIT: I managed to get a quick screencap of the program before it closed out.
          • Trevs

            Trevs Astral Cartographer

            Not sure if this is common knowledge and I'm just late to the party, but in case anyone wanted to know, you can use brackets ("[]") and an object ID in a character's dialogue.xnb file to give the player an object. Might be useful for dialogue expansion packs.

            You don't open the .cmd file. You use it in Command Prompt. Open that and type ".\xnb_node.cmd extract <input folder name> <output folder name>"
              Last edited by a moderator: Aug 8, 2017
              HopeWasHere likes this.
            • gizomo

              gizomo Void-Bound Voyager

              Hi! Is there any way to change the farm animal sizes? Like, for example, making a chicken 16x32 instead of 16x16?

              I've tried messing with the numbers in FarmAnimals.xnb but no avail.
                HopeWasHere likes this.
              • Xuomi

                Xuomi Phantasmal Quasar

                If we edit a farm map to allow it to catch ocean fish, will crab pots placed on the farm catch both river fish and ocean fish? Or is it something that's hard-coded to catch solely river fish on the farm, if anyone knows?

                Edit: Well after some testing, even with ocean fish spawnable on the farm map, it doesn't look like the crab pots will actually catch anything outside of freshwater. Oh well.
                  Last edited: Jul 24, 2017
                • boocat

                  boocat Void-Bound Voyager

                  Is there a mod that makes it daylight all the time? Thanks for your time.
                  • PPPPPPPPPPPPPPPP

                    PPPPPPPPPPPPPPPP Space Hobo


                    Every time I try to unpack something it says this,

                    :D\Games\Steam\steamapps\common\Stardew Valley\app>xnb_node.cmd extract Content\
                    Characters\Abigail.xnb Abigail.png
                    'xnb_node.cmd' is not recognized as an internal or external command,
                    operable program or batch file.

                    I followed a guide on how to unpack and repack, so I don't know why this is happening. Maybe I'm missing a simple step? Or just doing something wrong.

                    I still haven't found out why this is happening!

                    Please help.
                      Last edited: Aug 8, 2017
                    • Xuomi

                      Xuomi Phantasmal Quasar

                      @PPPPPPPPPPPPPPPP As far as my experience goes, I've never had to type xnb_node.cmd, only xnb_node.

                      So the way I type it would be (I do my XNB modding in my documents, not the SDV folder):
                      C:\Users\[-]\Documents\Mods\Stardew Valley\XNB Node>xnb_node extract Content\Extract Content\Pack

                      Personally, I could never get the individual file extract/pack to work the way you're doing it, so I just place the files I want to extract into one folder and the ones I want to pack in another and do the commands that way.
                        Flumme likes this.
                      • BohemianRedneck

                        BohemianRedneck Space Hobo

                        Alright so I've found no better place to ask this question as of yet, and frankly I have yet to figure out the exact question I need to ask but here goes.
                        I have a couple of ideas for things that were missing from stardew valley, surprise, I figure thats everyone here. Anyway one of the things that could really help would be understanding how the game handles crabpots in the code, and how the game reads weather events. Any insight or direction to insight would be helpful.
                        • BritneyMc0206

                          BritneyMc0206 Scruffy Nerf-Herder


                          Sorry if I'm just being dumb, I'm just getting into modding, & the audio has been the main thing I've been wanting to try to understand, before the only ones who know anything to help are all gone (if it's not already to late).

                          Edit: So I figured out what was wrong. Now I'm just trying to figure out why my game crashes everytime I try to add the new xwb file to my game.​
                            Last edited: Aug 29, 2017
                          • avarisc

                            avarisc Void-Bound Voyager

                            I am attempting to create a custom item using SMAPI. That's it. I already have the method to spawn the item.
                            With much experimentation [and reflection], I managed to do the following, none of which are really the goal:

                            1.) Subclassed Object, made my own type of item. Even managed to, very painfully, get manual serialization to work, but can't override the graphics used. I managed to override the spritesheet, but still can't edit the coordinates in a reasonable manner (and the overridden spritesheet doesn't apply during some animations, i.e. while picking up/dropping the item).

                            2.) Managed to modify item instance data to turn a vanilla object into a custom object, but naturally this excludes any graphics changes which are kind of important.

                            Does anyone know of an example of a custom item added via SMAPI? With Farmhand, this all takes a few lines of code- but Farmhand is officially "on hold" in favor of SMAPI, so I'd rather support the more supported one. If not with SMAPI directly, is there an SMAPI framework that makes this possible? I failed to locate any examples of items, specifically.
                            • Entoarox

                              Entoarox Oxygen Tank

                              Adding custom items is currently not yet supported in a standardized fashion, but `CustomElementHandler` is a API mod that enables custom items without to much difficulty.
                              • avarisc

                                avarisc Void-Bound Voyager

                                I assume you are referring to
                                Are there any mods that use this currently, or other examples? I'm having a bit of trouble seeing the path from this code to my objective.

                                edit: also, a reply from a SDV modding celebrity, I feel so special <3

                                edit 2: This seems very much like my custom object serializer I wrote while trying to 'roll-my-own' custom item solution, which I imagine would end the same way, where I'm unable to properly modify item/object graphics. (By subclassing item and reflecting/overriding, I managed to override the held/inventory and the placed graphics, but animations like picking the item up didn't work properly, and there were other issues).
                                • Entoarox

                                  Entoarox Oxygen Tank

                                  You extend StardewValley.Object, override its various Draw methods, and implement the CustomElementHandler's interface
                                  • avarisc

                                    avarisc Void-Bound Voyager

                                    Decided to share my WIP - it uses my own implementation for serialization, as opposed to CustomElementHandler [spookily similar in design tho, may fall back to relying on the CEH].

                                    The API is only half-implemented at the moment, don't judge me too harshly. The main thing I'm struggling with at this point is the custom graphics implementation. As you can see I've overridden all the draw methods I could, but for some reason while picking up the item it appears as weeds, and I'm not sure how to get around that. Please tell me I'm missing something simple.

                                    I believe this issue would be present even using CEH, as the serialization implementation doesn't really affect visuals.

                                    Looking into the animation code, best as I can tell the icon is pulled independently by the animation which is in a very hard-to-reflect place :\

                                    For testing, the mod currently spawns a test item right on the front porch at the start of every day.
                                    If someone can help me sort out the weeds visual issue, I'll polish up two APIs, a json one and a code interface, to make this a bit easier for others. [Then I'll look into adding more types of items/etc].

                                    My own mod's goal is a custom forageable, so this is admittedly tailored with that in mind for now.

                                    Edit: direct link to the custom item class:
                                    • Entoarox

                                      Entoarox Oxygen Tank

                                      I just checked the source of both your code and the game itself, and I do see a `StardewValley.Object::drawAsProp` method, is that perhaps the one you meant?

                                      Edit: I've spend some time now trying to find where else items get drawn with no success, if you know where please inform me so I can actually go in and look for a solution.
                                        Last edited: Aug 25, 2017
                                      • avarisc

                                        avarisc Void-Bound Voyager

                                        [edited for clarity]
                                        is not abstract or virtual though, and afaik C#'s reflection doesn't enable an external assembly to modify the virtual table. Meaning I cannot override it, and replacing (via 'new' keyword) seemingly does nothing, likely because nothing is calling my class as itself directly. This function is used to draw, for example, the items in the display at the fair. While, ideally, it should be handled as well, it is not my primary target at the moment.

                                        Farmer.showHoldingItem seems to be responsible for temporary animations, i.e. swinging a tool or picking an object up off the ground, and it references spritesheets directly rather than deferring sprite handling to the Object instance.

                                        Obviously, this one is relatively important for a lot of practical applications. It is static, not virtual or abstract. Without classloading the game by hand [which is far beyond the scope of an SMAPI mod], I'm not really sure how to get around this. Please advise.

                                        I thought that maybe I could accomplish something by subclassing SpecialItem instead of object, but SpecialItem.getTemporarySpriteForHoldingUp is also not virtual or abstract, so I can't properly override it from a SpecialItem visibility perspective (which is how the game calls this function), because it would be a subclass.

                                        Edit: The vanilla sprite is displayed when tossing the item in the sale box as well.
                                          Last edited: Aug 26, 2017
                                        • Entoarox

                                          Entoarox Oxygen Tank

                                          I recommend using to detect if your custom type is used during showHoldingItem, and if so, cancel the original method in favor of your custom handling.
                                            Nishtra likes this.

                                          Share This Page