Add open-config script, VS Code tasks, and vanilla file warnings

This commit is contained in:
2026-08-20 16:35:58 -04:00
parent 358941379c
commit b76a724945
5 changed files with 139 additions and 52 deletions
+22
View File
@@ -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: 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 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 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` - 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 ## 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: 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:
+17
View File
@@ -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
+48
View File
@@ -36,6 +36,54 @@
"panel": "new" "panel": "new"
}, },
"problemMatcher": [] "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": []
} }
] ]
} }
+7 -5
View File
@@ -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: 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. 1. **Use CONFIG-REFERENCE.md** — Look up which XML file likely contains the setting
2. **Check archetypes.xml first** — Many base stats are defined here 2. **Open the file in VS Code** — Run `.kilo/scripts/open-config.ps1 -Filename "filename.xml"` to open it
3. **Look at entityclasses.xml** — Item and block properties 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 progression.xml** — Skill and level changes 4. **Check archetypes.xml first** — Many base stats are defined here
5. **Search the web** — The 7 Days to Die modding community has extensive documentation 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 ## Common XPath Targets for Simple Modlets
+45 -47
View File
@@ -1,63 +1,61 @@
# Modlet Management Scripts # Open 7D2D vanilla config files in VS Code
## Quick Start ## Quick Start
Enable all modlets for testing in vanilla 7 Days to Die: Open a specific config file in VS Code:
```powershell ```powershell
.kilo\scripts\modlet.ps1 -Action enable .kilo\scripts\open-config.ps1 -Filename "archetypes.xml"
``` ```
Disable all modlets: Common files to open:
```powershell ```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 ```powershell
.kilo\scripts\modlet.ps1 -Action sync .kilo\scripts\open-game-config.ps1
``` ```
Check which modlets are currently enabled: ## ⚠️ IMPORTANT: Do Not Edit Vanilla Files Directly!
```powershell
.kilo\scripts\modlet.ps1 -Action status **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
<?xml version="1.0" encoding="UTF-8"?>
<configs>
<set xpath="/player/@maxHealth" value="200" />
<set xpath="/player/@health" value="200" />
</configs>
``` ```
## 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: ## Finding the Right File
- 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
## Manual Shortcuts 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.
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