Setting up Redscript and VSCode

How to configure your setup

Created by HJHughJanus on github, moved here for better maintainability

1. Install redscript

  1. Download redscript from github:

The zip file will contain the following folders:

- engine
- r6
  1. Extract it directly into your directory, so that the folders merge with the ones already there.

  2. Start the game so that redscript can set itself up.

  3. 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.

2. Setting up VSCode

  1. Download and install VSCode.

  2. After starting it, click on the Extensions icon in the left menu bar:

  1. Search for redscript and install the Redscript Syntax Highlighting extension. Do not close the tab yet.

  1. Download the redscript extension from github:

  1. In VSCode, click the … symbol in the topright of the extension manager and select Install from VSIX…:

  1. Navigate the file picker to your downloads folder and install the file from step 4.

  2. Your extension manager will now show both addons as installed. If it does not, restart VSCode.

  3. Click on the cog menu next to redscript-ide-vscode:

  1. Set up the path to your cyberpunk install in VS Code preferences.

  1. Save the settings

3. Testing the tools

You need to restart VSCode before the redscript language server will start working

  1. Create a mod development folder somewhere (example: D:\Cyberpunk\redscript_modding)

  2. Inside the folder, create a plain text file with a .reds extension (e.g. MyMod.reds)

  3. Open VSCode and click Open Folder, then point it at your mod development folder from step 1

  4. On the left, you should see the file you created in step 2. Open it and paste the following (incorrect) code snippet:

//add field to NPC class
let testField: bool;
  1. Save the file (Hotkey: Ctrl+S).

  2. You should see an error, because bool should be Bool.

  3. Hover your cursor over the error, you should see something like this:

  1. Correct the code:

//add field to NPC class
let testField: Bool;
  1. 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)

Last updated