s2s2lua
Transpile Stranded II .s2s scripts to Lua for OpenStranded.
Overview
s2s2lua is a Rust library and CLI tool that parses .s2s script files from
the game Stranded II and generates equivalent Lua code compatible with the
OpenStranded engine. All s2s built-in commands are translated to calls in the
core_api.* namespace.
Usage
CLI
# Single file
# Multiple files or directories
# Custom namespace
Options:
| Flag | Description |
|---|---|
-n, --namespace |
Namespace prefix for emitted commands (default: core_api) |
Library
[]
= "0.1"
use ;
let script = parse.unwrap;
let lua = generate.unwrap;
println!;
Project Structure
| Path | Description |
|---|---|
src/ast.rs |
AST node types |
src/token.rs |
Logos-based lexer / tokenizer |
src/parser/ |
Recursive-descent .s2s parser |
src/generator/ |
Lua code generator |
src/error.rs |
Error types |
src/main.rs |
CLI entry point |
tests/in/ |
Test input .s2s scripts |
Test Input Files
The files in tests/in/ are original Stranded II scripts. They are the
property of Unreal Software (https://www.strandedonline.de/s2_info.php)
and are included for testing purposes only.
License
GNU General Public License v3.0 or later — see LICENSE and NOTICE.