Modding Discussion Farmhand Management Tool

Discussion in 'Multiplayer' started by fredi_68, May 18, 2018.

  1. fredi_68

    fredi_68 Poptop Tamer

    I dunno if this is the right place to put this... the modding subforum has a tool prefix but this is not a mod and it is purely multiplayer related soooo... I guess this is right? Mods, let me know if this was a mistake.

    Anyways, after a few weeks of thought, I decided to release my farmhand management script for those of you who don't know how to / don't want to edit the savegames manually to fix a broken farmhand or add more than three to a game.

    I've written this script in my spare time after running into some issues in one of my games to help me deal with common problems that arise from the fact farmhands can't be easily removed from a game. I've been on and off looking through the forums and have seen a good number of people who were having similar issues, but were unable to fix them because they couldn't get the savegame edits to work. That's why I decided to put my script up for download for those that want to use it.

    Before I go on too long a tangent, here are the links:

    Binaries for Windows (64bit I think? Probably): https://drive.google.com/uc?authuser=0&id=1g-ZxqrHIrLQt8nyhGdhkdGe6ejUVY4cb&export=download

    For the Python programmers out there or people who don't use win64, here's the source as well (includes a command line interface for the people stuck in the 90s):
    https://drive.google.com/uc?authuser=0&id=1hrh7gac6g9GQ0vimGrSsfEnm_A4bYvUt&export=download
    (I've taken care to exclude all personal information from the source to the best of my abilities)
    Spare me your comments on my coding style, I know it is awful :p
    Source comments may contain some strong language, if you're into that.
    Source should run on any Python 3 distribution really, as long as the tkinter and xml packages are installed.

    If these links don't work I'll have to... think of something

    I kindly ask you to refrain from reposting, uploading or otherwise distributing these downloads in any way, because this is very much still in development and I don't want this getting out of hand when the program is in a state this early. If you are crazy enough to actually want to use this in another project, send me a message and we can try to work something out.

    It should also be noted that this script achieves its goal by breaking the game in various ways that make weird things happen. Here's the summary:

    What you can expect:
    -Adding and deleting farmhands
    -Changing user ownership of farmhands
    -Stacking farmhand cabins on top of each other until the game crashes
    -Adding (virtually) infinite client slots to your game
    -Changing your best friends "Favourite Thing" entry to some inappropriate joke
    -Dialog windows
    -Bugs

    What you shouldn't expect:
    -A fully feature complete savegame editor. This is at its core a very simple script
    -A way to edit other parts of the savegame (although the program can be modified to do that)
    -A mod. This is a separate program you have to run when SV is closed
    -Support. I will try to fix bugs when people find them but be aware that my time is limited and multi
    platform support may be a while.
    -Anything really. This software is provided as is, without any warranty. By using it, you agree to not hold me liable for any damage caused by the operation of this software.

    If you do encounter bugs or the programm just doesn't start up at all, do post a reply. You may end up having to use the source instead if you were using the binaries. If you already are running source, it is helpful to include the console log as well (screenshot or copy and paste, anything that works really).

    Known issues:
    -Yes, the button graphics are broken. I know how to fix it, I'm just lazy.
    -There is a bug where "OK" and "Cancel" in the add farmhand dialog do the same thing. This is not intended. How surprising. For now, if you accidentally create a farmhand, just delete it again.
    -The "Check" button in the XML view makes changes to the underlying data. This is also not intended.

    Lastly, the reason I'm posting this here is partially out of personal interest. A few weeks ago, user seik6 discovered, that you could modify the savegame to support more than 3 additional players. This was later confirmed to be working by Dunkley, however, there is currently still very little information on what actually happens when you play the game normally with more than 4 players. Do the festivals work? How does the netcode keep up? Is there additional lag involved? By publishing this I'm hoping that more people who would like to play with larger groups can set up a game and shine some light on the situation. If you do and want to tell me about it feel free, I'm very interested in hearing about any progress!

    HOW TO DO THINGS

    Opening a Savegame

    After downloading, extract the zip archive and run the executable found inside (for source, run either the supplied batch file or type "python mngfh_gui.py" in a terminal/console/whatever you got).
    On Windows, the program should find your savegames automatically if they are located in the usual spot, if you are using a different OS or store your savegames somewhere else, you will be prompted with a dialog window, telling you that the savegames could not be found. At this point you have two options.

    a) Give up. You will receive a loss and your SR will be adjusted accordingly.
    b) Enter the path manually. Choosing this option (the right option) the application will open a file
    browser you can use to navigate to the StardewValley/Saves folder. Do NOT open the folder of the
    savegame you are trying to load, otherwise it will not be found. Open the surrounding folder
    instead.

    Now you should see a list of entries on the left of the screen:
    1.png
    Click on the entry that has the same name as your savegame (ignore the numbers, they are SV internal stuff and not important). The program will try to open the file and then presents you with a list of farmhands that were found:
    2.png

    Adding and Removing Farmhands

    If you loaded a savegame without farmhands, the list on the right will stay empty. You may have cabins on your farm in this case, but they don't have an attached farmhand. In this case you can do one of two things (again):

    a) Go back into the game and add a new cabin to the farm. After saving the game it should appear in
    the editor the next time you load the savegame.
    b) Use the HIGHLY EXPERIMENTAL createFarmhandFromPlayer (tm) feature. This is NOT recommended.
    Just click "New..." without having any farmhand selected. The program will ask you if you agree with
    potentially having your save fried and will then attempt to copy the player character to create a new
    farmhand.

    If you have a farmhand that you want to duplicate, just select it and click the "New..." button. The program will ask you for a userID that you will leave blank:
    3.png
    This will copy the farmhand, create a new cabin for it (in the same spot, move it using Robin in the game or by using the farmhand XML view). You don't have to change anything, the multiplayer ID is adjusted automatically. You can also add way more than 3 farmhands this way.

    To remove a farmhand, simply select it and press the "Delete" button. Be careful, if you delete the last farmhand in the savegame, creating a new one will require you to build a new cabin in the game or user createFarmhandFromPlayer (tm).

    After you made your changes, do not forget to save your changes by clicking the "Save" button. This will write your changes to the file for good. Make a backup before you do this! A bug in the program may cause your file to become corrupted!

    Advanced Editing

    If you want to change the properties of a farmhand in more detail, but for some reason absolutely don't want to edit the file manually, you can use the XML view of the editor. This window doesn't provide a way of adding or removing tags but you can change their values and search through tags to find what you are looking for quickly. You can open the viewer by clicking the "Edit..." button while having a farmhand selected. This will bring up the following window:
    4.png
    The main feature of this window is the XML tree in the center. The icons on the left indicate the state of the XML tag: Grey means it doesn't contain a value, blue means it does and red indicates that changes have been made that need to be saved. To edit a value, select the key on the left and press "Edit value...".
    To save the document, press "Save". This will prompt the editor to close. If you wish to continue editing, press "Check". This will give you a message, stating if your edits broke something very obvious or not.

    Be aware, even after saving your edits in the XML view, you will still need to press save in the main window for your changes to have an effect.
     
      Last edited: May 18, 2018

    Share This Page