Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jac3km4/redscript
Compiler/decompiler toolkit for redscript
https://github.com/jac3km4/redscript
compiler cyberpunk2077 decompiler language modding
Last synced: 3 months ago
JSON representation
Compiler/decompiler toolkit for redscript
- Host: GitHub
- URL: https://github.com/jac3km4/redscript
- Owner: jac3km4
- License: mit
- Created: 2020-12-30T03:28:01.000Z (almost 4 years ago)
- Default Branch: 0.5.x
- Last Pushed: 2024-07-27T20:45:49.000Z (3 months ago)
- Last Synced: 2024-07-27T21:34:56.572Z (3 months ago)
- Topics: compiler, cyberpunk2077, decompiler, language, modding
- Language: Rust
- Homepage:
- Size: 1.47 MB
- Stars: 395
- Watchers: 18
- Forks: 37
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cyberpunk - Redscript - Compiler/decompiler toolkit for redscript. (Modding resources / Frameworks)
README
redscript
Toolkit for working with scripts used by REDengine in Cyberpunk 2077.
Currently includes a compiler, a decompiler and a disassembler.## usage
```
Usage:
decompile [opts]
compile [opts]
lint [opts]
Compiler options:
-s, --src SRC source file or directory
-b, --bundle BUNDLE redscript bundle file to read
-o, --output OUTPUT redscript bundle file to write
Decompiler options:
-i --input INPUT input redscripts bundle file
-o, --output OUTPUT output file or directory
-m, --mode MODE dump mode (one of: 'ast', 'bytecode' or 'code')
-f, --dump-files split into individual files (doesn't work for everything yet)
-v, --verbose verbose output (include implicit conversions)
Lint options:
-s, --src SRC source file or directory
-b, --bundle BUNDLE redscript bundle file to use, optional
```You can build the project and decompile all scripts in one command:
```bash
cargo run --bin redscript-cli --release -- decompile -i '/mnt/d/games/Cyberpunk 2077/r6/cache/final.redscript' -o dump.reds
```## language
The scripts use a Swift-like language.
You can find a brief overview of it's features in the [official wiki](https://wiki.redmodding.org/redscript).You can also try it out [in your browser](https://try-redscript.surge.sh).
For more examples, you can have a look at some projects using redscript:
- [jackhumbert/let_there_be_flight](https://github.com/jackhumbert/let_there_be_flight)
- [pxiberx/cp2077-playground](https://github.com/psiberx/cp2077-playground)
- [djkovrik/CP77Mods](https://github.com/djkovrik/CP77Mods)## editor support
There's a dedicated [language server for redscript](https://github.com/jac3km4/redscript-ide), with support for code editors:
- [Visual Studio Code plugin](https://github.com/jac3km4/redscript-ide-vscode)## integrating with the game
You can integrate this compiler with the game and make it compile your scripts on startup.To set it up, you can download the `redscript-mod-{version}.zip` archive from the [latest release](https://github.com/jac3km4/redscript/releases) and extract it in the main game directory. You should end up with the following files:
- `Cyberpunk 2077/engine/tools/scc.exe`
- `Cyberpunk 2077/engine/config/base/scripts.ini`If the compiler is set up correctly it will save logs to `Cyberpunk 2077/r6/cache/redscript.log` whenever you start the game.