Skip to content

Developing

Zhincore edited this page Mar 19, 2025 · 8 revisions

This page containg info and tips you should know if you want to develop and contribute to this mod.

Folder structure

  • localizations/ - Simplified language files for the mod. Every effect must have at least english translation.
  • scripts/cet/ - CET scripts providing configuration UI.
  • scripts/redscript/ - RedScripts handling core mod logic and effects.
  • src/ - Red4ext plugin in Rust providing native extensions.
  • WolvenKit/ - WolvenKit project with assets, AXL, etc. Used for packaging the resulting mod.

Also when developing you might encounter a git-ignored folders libs containing stuff your IDE might need to provide you suggestions, and target which is where Rust compiler stores it's things.

Requirements

You should have some stuff ready before you start developing:

  • Windows, text editor, git, patience.
  • PowerShell and ability to run it's scripts.
  • Red-CLI - Recommended!
  • Red Hot Tools (RHT) Recommended!
  • Rust (only needed for developing native extensions).

Also your "text editor" should have support for releveant languages, especially Redscript) if you plan to change redscripts. For more info see the Preparation section.

Note

Your code has to be properly formated (and runnable of course) when submitting a PR!

Developing without Rust

If you're not modifying native extensions, you don't need Rust. Instead, download the latest chaosmod2077.dll build from the Build GitHub Action:

  1. Open workflow runs and pick "Build"
  2. Click the name of the newest one with green check.
  3. Scroll down and download chaosmod2077.dll.
  4. Create the folder structure target\build\debug\ in the project and put the DLL there.

Now you can develop and test without building the Rust components.

Recommended Workflow

When developing this mod, this is the workflow that works for me, you can adapt it for yourself when contributing effects or anything else. This uses the requirements mentioned above.

Preparation

Playtesting

  1. If you changed natives (Rust) run cargo build.
  2. If you changed translations or added effects:
    1. Run the .\convert-translations.ps1 script. You might get asked about installing WolvenKit CLI.
    2. Open the WolvenKit project and just press Install*.
  3. Run red-cli install to install the scripts.
  4. Start Cyberpunk and test!

*: You can also do the WolvenKit part last and press "Install and Load Save".

Tip

If the game is already running, reloading scripts via RHT usually suffices. Effect metadata won't update, but runtime changes will.

Warning

Avoid running red-cli bundle in a development environment. It can cause issues when pressing Install in WolvenKit, requiring manual cleanup.

Utility Commands

There is a few CET console commands that can help you with effect development:

  • ChaosMod_StartEffect("EffectId")
    • Triggers a specific effect by its ID (even if Chaos Mod is disabled).
  • ChaosMod_StopAllEffects()
    • Stops all running effects (even if Chaos Mod is disabled).
  • ChaosMod_ListAllEffects()
    • Lists all available effects in Game Log.
  • ChaosMod_ResetRegistry()
    • Empties the registry, unregistering all effects.

Clone this wiki locally