Stardew Valley
0 of 0

File information

Last updated

Original upload

Created by

purplexpresso

Uploaded by

purplexpresso

Virus scan

Safe to use

About this mod

Patches for PyTK-based HD Portrait Mods into a Content Pack usable by HD Portraits by tlitookilakin, as well as a patcher to do it yourself.

Requirements
Permissions and credits
Changelogs
INTRODUCTION:
HD Portraits make Stardew Valley quite beautiful — yet, nearly all of them are require using PyTK to scale the image. While PyTK is a powerful toolset, for those looking to run a lighter load order may be dissuaded from adding it to their game. Although HD Portraits by tlitookilakin exists and is a great alternative, this is quite new and few portrait artists have adapted their content packs to use it. 

Until today! 

Thanks to many kind mod authors, I have gotten permission to repackage their mods into versions compatible with HD Portraits. Now, you don't have to choose between performance and beauty. View "optional files" to see what has been converted! I hope to convert every PyTK-based HD Portrait, so please send any my way and I'll talk with the original author!

HOW TO USE PATCHES:
  • Go to optional files, and download the patches of any mods you want.
  • Unless stated otherwise, download the original mods 
  • Merge my files over the original mod's files, or use a VFS like Mod Organizer 2 to handle conflicts for you automatically
  • Make sure HD Portraits, Content Patcher, and SMAPI is installed in your mods folder
  • Boot the game, and enjoy :)

I did this by developing a python script that generates the appropriate metadata to allow PyTK-based portrait mods to be used used with HD Portraits. All you have to do is point the script to the directory where your Content Pack-based mod is, run the script which takes less than a second, and now you can use those portraits without PyTK! This converts those Content Packs in a non-destructive way so if you change your mind, all you have to do is rename some files and you're back to normal. No junimos harmed in the process. The patcher is available, under "main files".

HOW TO USE PATCHER:
  • Install Python 3.10+ on your computer.
  • Using pip or your preferred package manager, install json5.
  • Run the script, specifying the path to mod folder with --path "[folder]"
    • If you need any additional help, run python portrait_patcher.py --help, which explains all the options the script has to offer.
  • Ensure SMAPI, Content Patcher, and HD Portraits are installed in your Mods folder.
  • You're done!

Example:
python portrait_patch.py --path "D:/Games/Stardew Valley/Mods/[CP] HD 4K HDR Portraits"

Internal Mode:
  • What is Internal Mode?
    • Internal mode is the default way the script runs, generating the relevant files inside the given mod folder.
    • It modifies content.json (to add the appropriate targets) and manifest.json (to remove the PyTK dependency so the Content Pack can load), though both these files are backed up in the folder with the extension .bak in case you want to restore them.
    • This is definitely the easiest way to do things — however, I would recommend you experiment with copy mode.
  • How do I use Internal Mode?
    • Internal mode is the default setting on the script, but can be manually specified with --mode internal.

Example:
python portrait_patch.py --mode internal --path "D:/Games/Stardew Valley/Mods/[CP] Linus Tech Tips HD Portraits"

Copy Mode (Advanced):
  • What is Copy Mode?
    • Rather than generating files inside the folder, copy mode generates all the new files inside a separate folder.
    • This is useful if you're interested in just distributing the metadata files, or are using a mod manager like Mod Organizer 2 (strongly recommended!) which has a Virtual Filesystem and allow you to safely overwrite files without actually overwriting them while controlling file priority.
    • It also keeps the original mod completely untouched.
  • How to use Copy Mode:
    • Specify --mode copy while running the script.
    • By default, this generates a folder inside the Content Pack folder called "Patched HD Portraits". You should move this elsewhere.
    • Alternatively, you can specify the directory where the files are generated with ---copy_dir "[directory]".

Example:
python portrait_patch.py --mode copy --path "D:/Modding/MO2StardewValley/Mods/4K HD Portraits" --copy_dir "D:/Modding/MO2StardewValley/Mods/HDPortraitPatch"

DISCLAIMERS:
  • The script was written with Python 3.10.4, and requires the json5 python library to be installed on your computer. Lower versions of python may work, but YMMV. Please bug report! 
  • As of 9/20/22, I am at college and have a rule not to game, so I cannot bug test, so please report and I will do their best to fix it.
  • I have tested this on several HD Portrait Mods, but definitely not all of them. Please leave a bug report with the link to the specific portraits and I will take a look at them!
  • If you are a mod author, and would like to use this tool to convert your mod, please reach out! I have a few ideas for potential optimizations to make, but would like to make sure that there is active interest. 
  • This script is licensed under GPL v3.0. Feel free to make modifications, granted you follow the terms of the license. I will eventually publish the script on GitHub for bug reports and pull requests — it is currently in a private repo on my personal github, in the interest of privacy I will likely transfer it to a new account and make it public.