Script panel: files and help
Open documents, search, buffer conflicts and C# integration boundaries.
The Script panel combines open text files and built-in help. It does not replace a C# IDE: .csproj context, C# analysis and debugging are configured separately. Start with the external editor for C#.
Open the intended document
- Open a supported project text file from Content Browser or the Script panel's file-open command.
- Use the panel's class search for help. A class document and a script are different tab types.
- Opening
.csfollows the selected C# provider: double-clicking can launch an external program rather than create an internal tab. - If Script is hidden, check the editor feature profile. A hidden panel does not require an engine reinstall.
The left list contains open documents, not every project file. Use Content Browser or file search for a file not yet open. The active document outline helps navigate methods or help sections.
Find and edit text
- Select the intended document in the open-file list.
- Use Search → Find… within that document. Check case and whole-word modes if a match is missing.
- Use Find in Files… across files, narrowing the folder/extensions to avoid generated caches and assemblies.
- Review files and matches before replacement. A mass disk replacement is not one guaranteed undoable buffer-editing operation; keep a controlled project version beforehand.
- Save after editing. Changing C# source requires a separate successful build.
Menu commands show their shortcuts, which can be reassigned under Editor Settings → Shortcuts. Follow current bindings rather than assuming identical keys on every platform.
Resolve external-edit conflicts
A file open both internally and in an IDE can have two versions: saved disk content and an unsaved buffer. Automatic rereading must not silently destroy the latter.
text_editor/behavior/files/auto_reload_scripts_on_external_change permits automatic rereading of applicable files, but unsaved edits can prompt a version choice. Compare versions, save the intended one, then reload. Rereading text does not establish that the game loaded a new C# assembly.
Built-in help and the C# API
Class help opens as a separate document. A plugin calling ScriptEditor.GetCurrentScript() can receive null on a help tab. GetCurrentEditor() can also be null: a help document is not a ScriptEditorBase.
GetOpenScripts() lists open Script resources, not every help document or project file. GetUnsavedFiles() concerns internal unsaved buffers; it does not know about unsaved text in an external IDE. These methods do not establish that the entire project is saved.
Use the current SDK API reference for exact C# names, types, overloads and parameters. Panel text search and symbol search across the SDK solve different tasks.
Diagnose failures
| Problem | Action |
|---|---|
| File missing from the list | This is an open-document list; use Content Browser or Find in Files. |
| Script opens externally | Check the C# selection and general Text Editor → External settings. |
| Search misses a line | Check the active document, case, whole-word mode and search scope. |
| Both programs changed a file | Compare disk and unsaved buffer; do not reload blindly. |
| API returns null on help | Valid behavior: help is not an editable script. |
| C# behavior did not change | Check the build, error messages and assembly restart/reload. |
Verification limits
The headless 1.0.0 editor opened Entity help and verified that it is not a Script/ScriptEditorBase, does not add an open script and does not create an unsaved buffer. Reload settings and external-editor routing were reviewed in source. Physical editing, find/mass replacement, conflicting buffers and C# debugging were not exercised by this test.