Setting up Redscript and VSCode
How to configure your setup
Last updated
How to configure your setup
Last updated
Created by HJHughJanus on github, moved here for better maintainability
Download redscript from github:
The zip file will contain the following folders:
Extract it directly into your directory, so that the folders merge with the ones already there.
Start the game so that redscript can set itself up.
Check the folder Cyberpunk 2077\r6\logs
: if redscript has done its thing, you will now see a file named redscript_rCURRENT.log
You can now put your redscript mods into Cyberpunk 2077\r6\scripts
and they will be automatically loaded when the game starts.
Download and install VSCode.
After starting it, click on the Extensions icon in the left menu bar:
Search for redscript ide
and install the Redscript IDE
extension.
Click on the cog menu next to redscript-ide-vscode:
Set up the path to your cyberpunk install in VS Code preferences.
Save the settings
You need to restart VSCode before the redscript language server will start working
Create a mod development folder somewhere (example: D:\Cyberpunk\redscript_modding
)
Inside the folder, create a plain text file with a .reds
extension (e.g. MyMod.reds
)
Open VSCode and click Open Folder
, then point it at your mod development folder from step 1
On the left, you should see the file you created in step 2. Open it and paste the following (incorrect) code snippet:
Save the file (Hotkey: Ctrl+S
).
You should see an error, because bool
should be Bool
.
Hover your cursor over the error, you should see something like this:
Correct the code:
Save again — everything should work now.
If you want to make a redscript mod, you can check out How to create a hook (originally by HJHughJanus on github)
This step is optional. You might find this tool helpful to avoid repetitive tasks.
red-cli
is command line interface tool to improve your experience as a scripting modder. It allows you to run commands from a terminal to quickly install your scripts in game folder. It is also convenient to make an archive with your scripts, ready to release to users on Nexus Mod.
You can find red-cli on GitHub to download and install it on your system. You can then follow its README, it should explain everything you need to know to use it.
As an example, lets say your project (Cocktail · v0.1.0) contains the following scripts:
If you run the command red-cli pack
in a terminal, it will bundle scripts and output an archive like this:
It helps quickly prepare your mod to release it. It also reduce the amount of scripts by merging them per module (see module feature). When the code is in the global scope (no module statement), it will merge scripts in <name>.Global.reds
, with this example, in Cocktail.Global.reds
.
If you have questions or feedback regarding this tool, please reach out in channel on Discord.