Modding Help Custom Child NPC Seasonal Portrait Issues

Discussion in 'Mods' started by syo23, Jan 24, 2021.

  1. syo23

    syo23 Void-Bound Voyager

    Hey all, I recently drew up portraits for my kid(s) and Shane and want to stick them in the game. I've had success in planting Shane's in another mod folder, but for the kids, what I did is draw them at 4x(?) and am using a pytk.json that other portrait modders (specifically talkohlooey) use so that it scales into frame, directly replacing the original portrait assets in the mod's folder (NPC Child for SVE)
    I'm not sure why, but I wasn't able to get the outfits to load separately onto the bases and used the applied outfit as the base instead. I now notice the issue in my SMAPI log reading:

    [Content Patcher] unhandled exception applying patch: seasonal kid take after spouse NPC sprites and portraites > Child 1 boy clothes Portraits weather.
    System.InvalidCastException: Can't replace loaded asset of type PyTK.Types.ScaledTexture2D with value of type PyTK.Types.MappedTexture2D. The new type must be compatible to prevent game errors.
    at StardewModdingAPI.Framework.Content.AssetData`1.ReplaceWith(TValue value) in C:\source\_Stardew\SMAPI\src\SMAPI\Framework\Content\AssetData.cs:line 45
    at PyTK.PyTKMod.PatchImage(IAssetDataForImage __instance, Texture2D& source, Nullable`1& sourceArea, Nullable`1 targetArea, PatchMode patchMode) in D:\Programming\Games\Mods\GitHub\Stardew-Valley-Mods\PyTK\PyTKMod.cs:line 670
    at StardewModdingAPI.Framework.Content.AssetDataForImage.PatchImage_PatchedBy<Platonymous.PyTK>(Object source, Texture2D sourceArea, Nullable`1 targetArea, Nullable`1 patchMode, PatchMode )
    at ContentPatcher.Framework.Patches.EditImagePatch.Edit[T](IAssetData asset) in C:\source\_Stardew\Mods.Pathoschild\ContentPatcher\Framework\Patches\EditImagePatch.cs:line 132
    at ContentPatcher.Framework.PatchManager.Edit[T](IAssetData asset) in C:\source\_Stardew\Mods.Pathoschild\ContentPatcher\Framework\PatchManager.cs:line 181

    I can assume this is in regards to the scale ptyk.json, naturally, but I don't exactly understand what the types mean. The file only contains

    {
    "Scale": 4,
    }

    I don't really understand why it's giving an error, what can I do to make it work without error?
    Would like to bundle together these portraits and share them, but clearly I have no idea how to do this lol... ^^;
     

    Share This Page