SWG String File Editor
A Visual Studio Code extension for viewing and editing Star Wars Galaxies .stf (String Table File) files in plain text format.
Features
- View Binary STF Files: Automatically converts binary
.stf files to human-readable text format
- Edit in Plain Text: Edit localized strings in a convenient text format with syntax:
- Section headers:
[string_name]
- Properties:
id=, crc=, text=
- Save Back to Binary: Automatically converts your edits back to the binary STF format when you save
- Preserve File Structure: Maintains all IDs, CRCs, and string mappings from the original file
Usage
Opening STF Files
- Automatic: Simply click on any
.stf file in VS Code's file explorer
- Command Palette: Press
Ctrl+Shift+P (or Cmd+Shift+P on Mac), type "Open SWG String File", and select a file
The extension converts binary STF files to this text format:
# Star Wars Galaxies String Table File
# Next Unique ID: 123
[string_name_001]
id=0
crc=1234567
text=This is the localized text content
[another_string]
id=1
crc=7654321
text=Another piece of text with\\nnewlines supported
Editing Tips
- Section Names: Each string entry starts with
[name] where name is the string identifier
- Escape Sequences: Use
\\n for newlines, \\t for tabs, \\\\ for backslashes
- IDs and CRCs: Keep the
id and crc values intact unless you know what you're doing
- Comments: Lines starting with
# are comments and will be ignored when saving
Saving Changes
Simply use Ctrl+S (or Cmd+S on Mac) or File > Save. The extension will automatically convert your text edits back to the binary STF format.
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions view (
Ctrl+Shift+X or Cmd+Shift+X on Mac)
- Search for "SWG String File Editor"
- Click Install
From VSIX
- Download the
.vsix file
- In VS Code, press
Ctrl+Shift+P and run "Extensions: Install from VSIX..."
- Select the downloaded
.vsix file
From Source
- Clone this repository
- Run
npm install in the extension directory
- Run
npm run compile
- Press
F5 to launch the extension in a new VS Code window for testing
Technical Details
The extension understands the Star Wars Galaxies String Table File format, which consists of:
- Magic Number:
0xDEADBEEF (4 bytes)
- Version: Currently supports versions 0 and 1 (1 byte)
- Next Unique ID: Used for generating new string IDs (4 bytes)
- String Entries: Each entry contains:
- ID (4 bytes)
- Source CRC (4 bytes)
- Text length (4 bytes)
- Unicode text (UTF-16LE, variable length)
- Name Map: Maps string IDs to their identifier names
Based on Official Source Code
This extension was built by analyzing the official SWG source code from the LocalizedStringTableReaderWriter implementation in the client tools repository.
Requirements
- Visual Studio Code version 1.85.0 or higher
- No additional dependencies required for using the extension
Known Limitations
- Large STF files (>10,000 strings) may take a moment to load
- Binary file structure must be valid; corrupted files cannot be opened
- Version 2+ STF files are not yet supported (if they exist)
Contributing
This extension was created for the Star Wars Galaxies community. Contributions, bug reports, and feature requests are welcome!
License
This extension is provided as-is for use with Star Wars Galaxies projects.
Acknowledgments
- Built from the official SWG source code analysis
- Thanks to the SWG Emulator and preservation communities
Support
For issues or questions:
- Check existing issues in the repository
- Create a new issue with details about your problem
- Include the STF file (if possible) that's causing issues
Note: This extension is designed specifically for Star Wars Galaxies .stf files. It may not work with other file formats that use the .stf extension.