Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
AEx1 - Conditional Activation
Updated 2 weeks agoConditional Activation
Extra · Foundations module. Make a pack switch itself on and off by game state — only in certain scenes, only with a crest equipped, only after some flag flips. Skip unless you want that; a pack with no conditions is simply always-on, which is the right default for most.
You'll be able to: give a pack a set of conditions, read the bracket diagram the editor draws, pick the right re-check timing, and debug a pack that won't fire when you think it should.
What conditions are for
A pack with no conditions is on whenever you enable it. Conditions narrow that to when game state agrees. Three shapes it's good at:
- A mood pack that only dresses up one region — custom Greymoor music that goes quiet the moment you leave.
- A crest-tied visual swap — a Witch-crest skin that appears only while that crest is equipped, and steps aside otherwise.
- A post-milestone victory lap — a skin that switches on once a particular game flag has flipped.
None of this needs code. You build it in the Pack Manager's conditions editor, one row at a time.
How the logic reads — brackets, not booleans
A pack carries a list of conditions, and the editor groups them so you can think in pictures instead of logic:
- Conditions inside the same bracket must all be true together (an AND).
- Separate brackets are alternatives — any one satisfied is enough (an OR).
- The pack is active when at least one bracket has all its conditions met.
That's the whole rule. ("Scene is Greymoor and crest is Witch" OR "scene is Bone East" — two brackets; satisfy either.) The formal name for this shape is disjunctive normal form, which you can forget immediately — the brackets are the point, and the editor draws them for you.
When the pack re-checks — the trigger
Conditions only matter at the moments they're evaluated. Each pack picks one of two trigger modes:
- On scene transition — re-checked every time a new scene loads. Cheap, and exactly right when your conditions are about where you are (Scene / SceneContains).
- Hot reload — polled every couple of seconds during play. Right when a condition can change without a scene load: a crest swap, a nail upgrade, a flag flipping mid-room.
The trigger changes when the check runs, never its outcome. A scene-only condition works fine on the hot-reload trigger — it just polls a little more often than it needs to. Rule of thumb: if the state can change mid-scene, use hot reload.
The condition types
| Type | True when… | Notes |
|---|---|---|
| Scene | the current scene name matches exactly | case-insensitive |
| SceneContains | the scene name contains your text | the forgiving cousin of Scene — survives the game renaming a scene's suffix |
| PackActive | another named pack is enabled | for addon packs that should ride on top of a parent |
| CrestEquipped | a specific crest is equipped | pick the crest from the value field; don't hand-type the ID |
| NailUpgrade | nail level matches | supports operators — >= hivesteel, < 3, or an exact level name (needle / sharpened / shining / hivesteel / pale) |
| PlayerData | any field on the game's save-state object matches | the most powerful, the most advanced — see below |
Each row also has a == / != toggle. == means "this condition is true"; != flips it — "active everywhere except here." It negates the single row, not the whole bracket.
PlayerData — the master key
PlayerData reads any field on the game's live save-state object, by name. That makes it the most general condition (geo, pickups, milestones, region flags — if the game tracks it, this can test it) and the one that needs the most care, because the field names belong to the game, not to Stitchwork.
- A bare name is true when that field is set / non-zero / non-empty — good for booleans and "has it happened yet" flags.
- A name with a comparator tests a number:
geo >= 100,nailUpgrades >= 3.
Two honest cautions:
- Don't trust a field name you didn't verify. Save-state field names shift between game versions, and names carried over from Hollow Knight 1 are a trap — in Silksong you are Hornet, so an HK1-style
defeatedHornetis not your "beat this boss" flag. Find the real names in the editor's value field (it surfaces what the current build actually exposes) rather than typing from memory or a guide written for another version. - A bad field name reads as "false," silently. It won't error — the pack just never fires, which looks identical to a typo. So verify the name before you blame the logic.
Worked examples
Each is one or two rows in the editor.
Only in one area — recolour that's scoped to Bone East:
- Row:
Scene == "Bone_East_12" - Trigger: on scene transition.
Only with the Witch crest — responds the instant you swap crests:
- Row:
CrestEquipped == "witch"(chosen from the value cycler) - Trigger: hot reload — so a mid-room crest swap takes effect without a scene change.
Anywhere in Pilgrim's Rest, but only with the Witch crest — two conditions, same bracket:
SceneContains == "Pilgrim"CrestEquipped == "witch"- Trigger: hot reload.
In Greymoor, OR once a milestone flag is set — two conditions, different brackets:
- Bracket 1:
SceneContains == "Greymoor" - Bracket 2:
PlayerData == "<the verified flag name>" - Trigger: hot reload.
Common mistakes
- Forgetting Apply. Editing conditions changes nothing until you click Apply — same rule as everywhere in the Pack Manager.
Scenewhen you meantSceneContains. Exact match fails the moment the scene name carries a suffix you didn't include. When in doubt, use SceneContains.- Typing a crest ID. Use the value cycler — a mistyped ID matches nothing.
- Wrong trigger for changing state. A condition that depends on something you do mid-room (pick up an item, swap a crest) won't update until the next scene load if you left it on the scene trigger. Use hot reload.
- An empty bracket. A bracket with no conditions in it muddies the OR logic — remove it.
- Not testing. Load the save, walk into the target scene (or set up the target state), and confirm the pack fires — and confirm it stays off where it shouldn't.
Debugging a pack that won't fire
Work the chain from the outside in:
- Is it even enabled? The Pack Manager shows each pack's state. A conditional pack that's disabled never evaluates anything.
- Do you know the scene's real name? The Status Overlay subtitle prints the current scene name — copy it from there rather than guessing, especially for an exact
Scenematch. - Suspect a field name? Treat a silent no-fire as a possible bad
PlayerDataname first (see the cautions above), since it looks exactly like a logic bug. - Bisect the logic. Strip the pack back to no conditions (always-on) and confirm the content itself works. Then add conditions back one row at a time — the row that kills it is your culprit.
You can now scope a pack to scenes, crests, nail level, another pack, or any save-state field; read the editor's brackets; choose the right re-check timing; and find out why a conditional pack is staying dark. Next: back to your module — Pack Manager for the editor itself, or Troubleshooting for everything else.
Pages
- A-0 Wikis
- A1 - Getting Started
- A2 - Installing Packs
- A3 - The Pack Manager
- A4 - How Stitchwork Works
- A5 - When Something Looks Wrong
- AEx1 - Conditional Activation
- B0 - Choosing a Workflow
- B1 - Starting a Skin Pack
- B2 - Finding Any Sprite
- B3 - Porting Prior Work — Spritesheets & CKC
- B4 - Texture2D (T2D) Sprites
- B5 - Bigger Art — Anchors
- B6 - Animation Canvas Workflow
- B7 - Sprite Paths Reference
- B8 - The Animation Controller
- BEx1 - Reused frames — one sprite, many animations
- BEx2 - Instance-specific paths — same name, different art
- BEx3 - Appliqué: Per-Clip Art
- C1 - Text & Dialogue
- D1 - Audio
- E1 - Video
- F1 - Priority & Conflicts
- F2 - Distributing Your Pack
- G1 - Dumping & Full Dump
- G2 - Companion Mods
- G3 - Hotkeys
- G4 - Pack Folder Structure
- G5 - Testing With Savestates (DebugMod)
- G6 - Troubleshooting