# RHT: Hot Reload

## Summary

**Published:** Aug 18 2024 by [mana vortex](https://app.gitbook.com/u/NfZBoxGegfUqB33J9HXuCs6PVaC3 "mention")\
**Last documented edit:** Aug 18 2024 by [mana vortex](https://app.gitbook.com/u/NfZBoxGegfUqB33J9HXuCs6PVaC3 "mention")

This page describes Red Hot Tools's **Hot Reload mechanism**.

## How it works

Although there is a CET overlay, Hot Reload is fully integrated with Wolvenkit and Visual Studio Code — you don't have to do anything except pushing the right button.

### The theory

As you know, Cyberpunk 2077 loads its mods from `archive/pc/mod`. While you run around in Night City, it will keep them open and use the files inside as it needs them.

{% hint style="info" %}
As far as the game is concerned, the `.archive` files never change.
{% endhint %}

By placing `.archive`s inside the `hot` folder, you put them under the control of RHT, which will add them to the game's internal pool of never-changing content:

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-266145e439dabea90814f8f0262cde248d8d84f3%2Frht_hot_reload__file_system.png?alt=media" alt=""><figcaption></figcaption></figure>

### But the folder is always empty!

That's because RHT moves the file into `mods` and splices them into the game's resource pool.

{% hint style="info" %}
Don't worry if your files disappear from `hot`, that means everything is working as intended.
{% endhint %}

### But my changes don't show up!

Red Hot Tools invalidates the game's resources and loads your changes, but things that are already spawned won't be affected. Here is how you can trigger change detection:

* Loading a save (always works)
* Spawning a new copy of your item via CET and equipping that (usually works)
* Despawning and respawning the NPC or world entity you're modifying (usually works)
* Respawn the UI widget (usually works)
* Unequipping and re-equipping your item (sometimes works)

## Integrations

### Wolvenkit

Simply push the "Hot Reload" button in your toolbar:

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-74bd63ac02b3943bcfbb56c17025f3511db589d6%2Frht_hot_reload_wolvenkit.png?alt=media" alt=""><figcaption></figcaption></figure>

### Visual Studio Code

You can download the RHT plugin `red-hot-vscode-x.x.x.vsix` from [github](https://github.com/psiberx/cp2077-red-hot-tools/releases/):

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-05df5d86c7fe599da0f50670006b2e04d3ce553e%2Frht_vscode_github.png?alt=media" alt=""><figcaption></figcaption></figure>

Install the extension via Extension Manager's `...` menu (`Install from VSIX...`) and restart VScode.\
Now you can see the following actions:

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-e4b32909528df52e91a591dd85e2a5a0e3289e65%2Frht_vscode.png?alt=media" alt=""><figcaption><p>You can open the Commands palette by pressing <code>Ctrl+Shift+P</code></p></figcaption></figure>

## The CET overlay

Hot Reload is integrated with [Cyber Engine Tweaks](https://app.gitbook.com/o/-MP5ijqI11FeeX7c8-N8/s/-MP5jWcLZLbbbzO-_ua1-887967055/). Depending on your workflow, you don't need these buttons.

### Archives

Here, you can manually trigger a reload of archive extensions (read: `.xl` files).\
You only have to do this if you edit an .xl file in `archive/pc/mods`.

{% hint style="warning" %}
Pushing the button will not reload `.archive` files. RHT will do that automatically by watching the `hot` folder.
{% endhint %}

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-fef1b095b5d09db9ca61ee33616d63e5d41eeeee%2Frht_hot_reload__archives.png?alt=media" alt=""><figcaption></figcaption></figure>

### Scripts

Here, you can manually trigger a reload.

*You can do this via by running "Hot Reload Scripts" from Visual Studio Code*

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-fd94c907d2bef836a8407d3f0cd7338b93181c48%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### Tweaks

Here, you can manually trigger a reload.

*You can do this via by running "Hot Reload Scripts" from Visual Studio Code*

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-47963339d73ea0b4ef1bceecfcc1f93c7279f868%2Frht_hot_reload__tweaks.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.redmodding.org/cyberpunk-2077-modding/for-mod-creators-theory/modding-tools/redhottools/rht-hot-reload.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
