Stardew Valley
0 of 0

File information

Last updated

Original upload

Created by

aedenthorn

Uploaded by

aedenthorn

Virus scan

Safe to use

Tags for this mod

About this mod

Lets you give clothing or accessories to NPCs that they will wear, or manually assign clothing to NPCs using Content Patcher logic.

Requirements
Permissions and credits
Donations
With this mod, you can create Content Patcher content packs that specify certain items as wearable by certain NPCs.

Wearables are not limited to items that are normally giftable - you can specify any item as wearable and give it to an assigned NPC.

Wearables can be assigned arbitrary slot names (e.g. "hat") and they will randomly choose a single item with that slot name to wear on a given day.

Wearables can be assigned a percent chance to be worn on any given day.

To remove a wearable item from an NPC's clothing list, try to gift them the same item again (it won't be given and the item will be removed from the NPC's clothing list).

Wearables are worn by editing character and portrait sprite sheets directly when loaded, so if you use custom character sheets you may have to adjust the clothing sprite sheets accordingly.

Content Packs

Here is an example content.json file:

{
    "Format": "1.23.0",
    "Changes": [
        {
            "Action": "EditData",
            "Target": "aedenthorn.NPCClothing/dictionary",
            "Entries": {
                "hat_0": {
                    "id": "hat_0",
                    "giftName": "Cowboy Hat",
                    "giftReaction": "like",
                    "clothingSlot": "hat",
                    "spriteTexturePath": "aedenthorn.NCFHatsCP/hat_0_sprite",
                    "portraitTexturePath": null,
                    "spriteOffsets": [
                        {
                            "offset": {
                                "X": 0,
                                "Y": -3
                            },
                            "names": [
                                "Demetrius"
                            ],
                            "ages": null,
                            "genders": null
                        }
                    ],
                    "portraitOffsets": null,
                    "namesAllow": [
                        "Demetrius",
                        "Abigail",
                        "George",
                        "Evelyn"
                    ],
                    "namesForbid": null,
                    "agesAllow": null,
                    "gendersAllow": null,
                    "skinColors": null,
                    "percentChance": 100,
                    "zIndex": 0,
                }
            }
        },
        {
            "Action": "Load",
            "Target": "aedenthorn.NCFHatsCP/hat_0_sprite",
            "FromFile": "assets/hat_0_sprite.png"
        }
    ]
}

The dictionary path for Target is aedenthorn.NPCClothing/dictionary. Entry explanations:

  • id is arbitrary, but should be the same as the entry key
  • giftName is the name of the item (not the display name) - if omitted, this clothing will be worn without having given any gift.
  • giftReaction is only for items that are normally not giftable. One of love, like, dislike, hate, neutral.
  • clothingSlot - arbitrary slot name; only one clothing item of a given slot can be worn at a time.
  • spriteTexturePath - fake path to the sprite texture for Content Patcher. This will overlay on top of the character's sprite sheet.
  • portraitTexturePath - same for portrait texture (you can omit either for clothing to only be shown in sprite or portrait).
  • spriteOffsets - pixel offsets allow you to use a single tile sheet for different size characters by name, age, or gender. Ages are child, teen, adult; genders are male, female, undefined.
  • portraitOffsets - same.
  • namesAllow - list of names to allow.
  • namesForbid - list of names to forbid (all other villagers will be allowed to wear).
  • agesAllow - list of ages to allow. Ages are child, teen, adult.
  • gendersAllow - list of genders to allow. Genders are male, female, undefined.
  • skinColors - ignore for now.
  • percentChance - percent chance of wearing this clothing on any given day (use Content Patcher for other wearing logic).
  • zIndex - arbitrary integer specifying draw order (clothing with higher numbers will be drawn on top of those with lower numbers).


Textures

Textures will be scanned for non-transparent pixels, which will be overlaid on top of the existing pixel, except when the new pixel's opacity is less than 10%. Use such almost-transparent pixels to tell the mod to replace the existing sprite pixel with a transparent pixel (useful for covering hair, for example).


Mods that use this framework:



Technical
Requires SMAPI, uses Harmony.

Implements a Generic Mod Config Menu interface to change config settings in-game.

Compatible with Mod Updater for automatic updates.

Code is at https://github.com/aedenthorn/StardewValleyMods.

If you want to complain or ask for help or help me test my mods, you can visit my Discord server.

A list of all my mods for Stardew Valley is available at https://www.nexusmods.com/stardewvalley/articles/895.