write_portal
Places an areaportal, areaportal window, or occluder brush in a VMF to seal doorways and cull hidden geometry during play for runtime visibility control.
Instructions
Places an areaportal, an areaportal window or an occluder: the two brush entities read_map_geometry has counted since the beginning and nothing has ever placed. They are the runtime half of visibility. An areaportal seals a doorway and the engine opens and closes it as the player moves, culling everything beyond it while it is shut -- the strongest tool Source has and the fussiest, because vbsp refuses the whole map if the brush does not fill its opening exactly. An occluder hides what is behind it per frame on the CPU: it never fails a compile and it costs time whether or not it saves any. The brush is written through the same path as every other, and gets the tool material without which the entity is a solid wall the player walks into.
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>",
"classname": "<classname>",
"mins": "<mins>",
"maxs": "<maxs>"
},
"name": "write_portal"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| maxs | Yes | ||
| mins | Yes | ||
| path | Yes | Path to the .vmf, absolute or relative to the repo root. | |
| backup | No | Copy the file to <file>.bak before writing. Nothing is copied on a no-op. | |
| dryRun | No | Check and report without writing. Every verification runs either way. | |
| confirm | No | Required (true) to run this tool: it writes or executes. | |
| classname | Yes | What to place. A window fades rather than sealing. | |
| keyvalues | No | ||
| targetname | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| solidId | Yes | ||
| written | Yes | ||
| entityId | Yes | ||
| nextStep | Yes | ||
| warnings | Yes | ||
| classname | Yes | ||
| thickness | Yes | ||
| backupPath | Yes |