From b76a724945739a042120884a5d467c0e88de84d6 Mon Sep 17 00:00:00 2001 From: Lynda Straffin Date: Thu, 20 Aug 2026 16:35:58 -0400 Subject: [PATCH] Add open-config script, VS Code tasks, and vanilla file warnings --- .kilo/agent/lyndas_mod.md | 22 +++++++++ .kilo/scripts/open-config.ps1 | 17 +++++++ .vscode/tasks.json | 48 ++++++++++++++++++ CONFIG-REFERENCE.md | 12 +++-- mods/README.md | 92 +++++++++++++++++------------------ 5 files changed, 139 insertions(+), 52 deletions(-) create mode 100644 .kilo/scripts/open-config.ps1 diff --git a/.kilo/agent/lyndas_mod.md b/.kilo/agent/lyndas_mod.md index a4381aa..c56c4ed 100644 --- a/.kilo/agent/lyndas_mod.md +++ b/.kilo/agent/lyndas_mod.md @@ -121,8 +121,30 @@ The following v3 mods are available in the mod launcher (under `C:\7D2D\v3\`): When Lynda wants to review game config files: - Run VS Code task `Open 7D2D Game Config Folder` (`Ctrl+Shift+B`) to open `C:\Steam\steamapps\common\7 Days To Die\Data\Config` in Explorer - Run VS Code task `Open 7D2D Steam Mods Folder` (`Ctrl+Shift+B`) to open the Steam `Mods` folder in Explorer +- Run `.kilo/scripts/open-config.ps1 -Filename "archetypes.xml"` to open a specific config file in VS Code - Or run `.kilo/scripts/open-game-config.ps1` / `.kilo/scripts/open-mods-folder.ps1` +## ⚠️ CRITICAL: Do Not Edit Vanilla Game Files Directly! + +**Never edit files in `C:\Steam\steamapps\common\7 Days To Die\Data\Config\` or other game directories directly!** + +These are the game's base files. Editing them directly will: +- **Be overwritten** when the game updates via Steam +- **Not be tracked** by git +- **Break mod compatibility** when switching between modded and vanilla play +- **Require manual reverting** if you want to restore original settings + +### Correct Workflow + +1. **Review** vanilla config files using `open-config.ps1` to find the settings you want to change +2. **Note the XPath** or exact values you want to modify +3. **Create a modlet** in `mods/` that overrides those values using XPath +4. **Enable/sync** the modlet to test +5. **Disable** the modlet when done testing +6. **Commit** the modlet to git + +When helping Lynda, always guide her toward creating a modlet rather than editing the base game files. + ## Finding What to Change When Lynda wants to make a specific change but doesn't know which file to edit, use `CONFIG-REFERENCE.md` to identify the relevant XML config file. Common entry points: diff --git a/.kilo/scripts/open-config.ps1 b/.kilo/scripts/open-config.ps1 new file mode 100644 index 0000000..02b6ac4 --- /dev/null +++ b/.kilo/scripts/open-config.ps1 @@ -0,0 +1,17 @@ +# Open a 7D2D game config file in VS Code +# Usage: .kilo/scripts/open-config.ps1 -Filename "archetypes.xml" + +param( + [Parameter(Mandatory=$true)] + [string]$Filename +) + +$gameConfigPath = "C:\Steam\steamapps\common\7 Days To Die\Data\Config" +$filePath = Join-Path $gameConfigPath $Filename + +if (-not (Test-Path $filePath)) { + Write-Error "File not found: $filePath" + exit 1 +} + +code $filePath diff --git a/.vscode/tasks.json b/.vscode/tasks.json index fb5cec4..907458b 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -36,6 +36,54 @@ "panel": "new" }, "problemMatcher": [] + }, + { + "label": "Open archetypes.xml in VS Code", + "type": "shell", + "command": "code", + "args": ["C:\\Steam\\steamapps\\common\\7 Days To Die\\Data\\Config\\archetypes.xml"], + "group": "build", + "presentation": { + "reveal": "always", + "panel": "new" + }, + "problemMatcher": [] + }, + { + "label": "Open entityclasses.xml in VS Code", + "type": "shell", + "command": "code", + "args": ["C:\\Steam\\steamapps\\common\\7 Days To Die\\Data\\Config\\entityclasses.xml"], + "group": "build", + "presentation": { + "reveal": "always", + "panel": "new" + }, + "problemMatcher": [] + }, + { + "label": "Open items.xml in VS Code", + "type": "shell", + "command": "code", + "args": ["C:\\Steam\\steamapps\\common\\7 Days To Die\\Data\\Config\\items.xml"], + "group": "build", + "presentation": { + "reveal": "always", + "panel": "new" + }, + "problemMatcher": [] + }, + { + "label": "Open progression.xml in VS Code", + "type": "shell", + "command": "code", + "args": ["C:\\Steam\\steamapps\\common\\7 Days To Die\\Data\\Config\\progression.xml"], + "group": "build", + "presentation": { + "reveal": "always", + "panel": "new" + }, + "problemMatcher": [] } ] } diff --git a/CONFIG-REFERENCE.md b/CONFIG-REFERENCE.md index c32caf6..25f0aa1 100644 --- a/CONFIG-REFERENCE.md +++ b/CONFIG-REFERENCE.md @@ -81,11 +81,13 @@ This document inventories the XML config files found in the vanilla game install When you want to change a specific game mechanic, use these approaches: -1. **Search for keywords** — Search the entire `Data/Config` folder for terms like "zombie", "health", "damage", etc. -2. **Check archetypes.xml first** — Many base stats are defined here -3. **Look at entityclasses.xml** — Item and block properties -4. **Check progression.xml** — Skill and level changes -5. **Search the web** — The 7 Days to Die modding community has extensive documentation +1. **Use CONFIG-REFERENCE.md** — Look up which XML file likely contains the setting +2. **Open the file in VS Code** — Run `.kilo/scripts/open-config.ps1 -Filename "filename.xml"` to open it +3. **Search for keywords** — Use VS Code search (`Ctrl+Shift+F`) in the `Data/Config` folder for terms like "zombie", "health", "damage", etc. +4. **Check archetypes.xml first** — Many base stats are defined here +5. **Look at entityclasses.xml** — Item and block properties +6. **Check progression.xml** — Skill and level changes +7. **Search the web** — The 7 Days to Die modding community has extensive documentation ## Common XPath Targets for Simple Modlets diff --git a/mods/README.md b/mods/README.md index f0c8c2b..b8181c2 100644 --- a/mods/README.md +++ b/mods/README.md @@ -1,63 +1,61 @@ -# Modlet Management Scripts +# Open 7D2D vanilla config files in VS Code ## Quick Start -Enable all modlets for testing in vanilla 7 Days to Die: +Open a specific config file in VS Code: ```powershell -.kilo\scripts\modlet.ps1 -Action enable +.kilo\scripts\open-config.ps1 -Filename "archetypes.xml" ``` -Disable all modlets: +Common files to open: ```powershell -.kilo\scripts\modlet.ps1 -Action disable +.kilo\scripts\open-config.ps1 -Filename "archetypes.xml" +.kilo\scripts\open-config.ps1 -Filename "entityclasses.xml" +.kilo\scripts\open-config.ps1 -Filename "items.xml" +.kilo\scripts\open-config.ps1 -Filename "progression.xml" +.kilo\scripts\open-config.ps1 -Filename "blocks.xml" +.kilo\scripts\open-config.ps1 -Filename "loot.xml" +.kilo\scripts\open-config.ps1 -Filename "spawning.xml" ``` -Sync changes from repo to Steam (for modlets already enabled): +Or open the entire config folder in Explorer: ```powershell -.kilo\scripts\modlet.ps1 -Action sync +.kilo\scripts\open-game-config.ps1 ``` -Check which modlets are currently enabled: -```powershell -.kilo\scripts\modlet.ps1 -Action status +## ⚠️ IMPORTANT: Do Not Edit Vanilla Files Directly! + +**Never edit files in `C:\Steam\steamapps\common\7 Days To Die\Data\Config\` directly!** + +These are the game's base files. Editing them directly will: +- **Be overwritten** when the game updates via Steam +- **Not be tracked** by git +- **Break your mods** when switching between modded and vanilla play +- **Require manual reverting** if you want to restore original settings + +### Correct Workflow + +1. **Review** vanilla config files using `open-config.ps1` to find the settings you want to change +2. **Note the XPath** or exact values you want to modify +3. **Create a modlet** in `mods/` that overrides those values +4. **Enable/sync** the modlet to test +5. **Commit** the modlet to git + +### Example: Changing Player Health + +❌ **Wrong** — Editing `C:\Steam\steamapps\common\7 Days To Die\Data\Config\archetypes.xml` directly + +✅ **Right** — Creating a modlet in `mods/my_health_modlet/Config/my_health_modlet.xml`: +```xml + + + + + ``` -## How It Works +Then run `.kilo/scripts/modlet.ps1 -Action enable` to test. -This script copies modlets from `mods/` into the Steam `Mods` folder. This means: -- Edit modlets in `mods/` and run `sync` to update -- Enable/disable with a single command -- No junctions or special filesystem features required -- Works without admin privileges +## Finding the Right File -## Manual Shortcuts - -You can also create shortcuts on the desktop for quick access: - -### Enable Modlets -```powershell -powershell.exe -ExecutionPolicy Bypass -File "C:\Users\lynda\Git\lyndas_mod\.kilo\scripts\modlet.ps1" -Action enable -``` - -### Disable Modlets -```powershell -powershell.exe -ExecutionPolicy Bypass -File "C:\Users\lynda\Git\lyndas_mod\.kilo\scripts\modlet.ps1" -Action disable -``` - -### Sync Modlets -```powershell -powershell.exe -ExecutionPolicy Bypass -File "C:\Users\lynda\Git\lyndas_mod\.kilo\scripts\modlet.ps1" -Action sync -``` - -## Adding New Modlets - -1. Create a new folder in `mods/` -2. Add `ModInfo.xml` and `Config/` files -3. Run the enable script to test - -## Troubleshooting - -If copies fail: -- Ensure 7 Days to Die is not running -- Check that the Steam `Mods` folder exists -- Run PowerShell as Administrator if needed +Use `CONFIG-REFERENCE.md` to identify which XML file contains the setting you want to change, then use `open-config.ps1` to review it in VS Code.