write_script
Write GDScript files to res:// with automatic compile validation, preventing invalid code from being saved. Supports other text files like C# by writing them as-is.
Instructions
Write a GDScript (or other text, e.g. .cs) file under res://. GDScript is validated first by default — refuses code that doesn't compile; non-.gd files (C#, config…) are written as-is (use build_csharp to compile-check C#). Set validate=false to force.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | res:// path, e.g. res://player.gd | |
| content | Yes | ||
| validate | No | validate before writing (default true) |