BEx2 - Instance-specific paths — same name, different art

Updated a week ago

Instance-specific paths — same name, different art

Sprites · extra. The fifth sprite path, for one rare collision. Skip this unless Stitchwork has actually warned you about a duplicate collection name — if it hasn't, you don't need it.

You'll be able to: aim a replacement at one specific sprite collection when two of them share the same name but hold different art.

The collision

The game can hold two completely separate tk2dSpriteCollectionData objects that carry the same .name. A real example: Slab Prisoner Cln Data exists both in Assets/Collections/ and again under Assets/Collections/Hornet NPCs/ — same name, different sheets.

Your normal path keys off that name:

Sprites/{CollectionName}/{MaterialName}/{SpriteName}.png

So a file there applies to every collection with that name. Usually that's exactly right — you want both copies reskinned the same way, and you do nothing special. This page is only for the case where the two need different art.

How you'll know

You don't go looking for this — Stitchwork tells you. The first time you ship files for a name-colliding collection, the log prints:

[SpriteLoader] Duplicate collection name 'Slab Prisoner Cln Data' (instanceId …).
Use the vanilla texture name as the folder/file name to target this instance
specifically: Sprites/{name}/{texName}/... or Spritesheets/{name}/{texName}.png
(texture names logged per material below when vanilla is first captured).

The {texName} you need is in the lines just after it — Stitchwork logs each material's vanilla texture name as it captures the backup. That raw texture name is unique per instance, which is what makes it a usable discriminator when the collection name and material aren't.

The warning only fires when you've actually shipped files for that collection — no pack content, no nag. If you never see it, there's no collision to resolve.

The path

Swap the material folder for the vanilla texture name:

Sprites/{CollectionName}/{VanillaTextureName}/{SpriteName}.png      ← individual
Spritesheets/{CollectionName}/{VanillaTextureName}.png             ← whole atlas

Worked example — reskin only the Hornet NPCs copy, whose atlas captured as prisoner_b:

Sprites/Slab Prisoner Cln Data/prisoner_b/idle0000.png

The other copy (a different vanilla texture name) is untouched.

Priority — it composes with the normal path

Resolution tries the instance-specific path first, then falls back to the material path:

  1. {CollectionName}/{VanillaTextureName}/{SpriteName}.png — this instance only
  2. {CollectionName}/{MaterialName}/{SpriteName}.png — any instance with that name

So you can ship both: a material-path file as the default for every copy, and an instance-specific file that overrides just the one that needs to differ. The specific one wins for its instance; everyone else takes the default.

Worth remembering

  • Names match the dump, case-insensitively — same rule as every sprite path (B7). Copy the texture name exactly as the log prints it.
  • If you're unsure whether you need this, you don't. It exists for a genuine same-name/different-art clash and nothing else. The plain individual path (B1) is the answer 99% of the time.
  • Same idea, whole-atlas. The Spritesheets/{Coll}/{texName}.png form disambiguates a ported full-sheet the same way — see Porting Prior Work.

You can now resolve the one path collision Stitchwork can't guess for you — and recognise that the warning in your log is an instruction, not an error. Back to the map: Sprite Paths Reference.