write_vscript
Writes a Left 4 Dead 2 VScript (.nut) with Squirrel-safe checks and brace validation, and can attach it to a VMF via a logic_script entity so the engine loads it from an add-on VPK.
Instructions
Writes a Left 4 Dead 2 VScript (.nut) and optionally attaches it to a map. Checks the file for the Lua habits that break Squirrel, for balanced braces, and for a load banner that makes the script's execution provable in console.log. When vmf is given, adds a logic_script entity with vscripts set to the file's base name (no extension), which is how the engine finds it inside an add-on VPK. Guarded.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"content": "<content>"
},
"name": "write_vscript"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vmf | No | Optional .vmf to attach the script to; adds a logic_script entity. | |
| path | Yes | Where to write the .nut, for example <campaign>/addon/scripts/vscripts/finale.nut. | |
| confirm | No | ||
| content | Yes | The Squirrel source. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vmf | Yes | ||
| path | Yes | ||
| bytes | Yes | ||
| attached | Yes | ||
| entityId | Yes | ||
| warnings | Yes |