RHT: Hot Reload
How to hot reload things with RedHotTools
Summary
Published: Aug 18 2024 by manavortex Last documented edit: Aug 18 2024 by manavortex
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.
As far as the game is concerned, the .archive
files never change.
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:
![](https://wiki.redmodding.org/~gitbook/image?url=https%3A%2F%2F1427525421-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F4gzcGtLrr90pVjAWVdTc%252Fuploads%252FtcNrNBWjsCulqcoSzMc4%252Frht_hot_reload__file_system.png%3Falt%3Dmedia%26token%3D8e73a619-7acc-405a-a930-d28503ee9bf1&width=768&dpr=4&quality=100&sign=1250315f&sv=1)
But the folder is always empty!
That's because RHT moves the file into mods
and splices them into the game's resource pool.
Don't worry if your files disappear from hot
, that means everything is working as intended.
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:
![](https://wiki.redmodding.org/~gitbook/image?url=https%3A%2F%2F1427525421-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F4gzcGtLrr90pVjAWVdTc%252Fuploads%252F4kJqVC3IE5pRnXe5bx5P%252Fimage.png%3Falt%3Dmedia%26token%3De40eab00-77ff-4d77-ba01-85542b995acb&width=768&dpr=4&quality=100&sign=521b5ae6&sv=1)
Visual Studio Code
You can download the RHT plugin red-hot-vscode-x.x.x.vsix
from github:
![](https://wiki.redmodding.org/~gitbook/image?url=https%3A%2F%2F1427525421-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F4gzcGtLrr90pVjAWVdTc%252Fuploads%252Fh6zDwGVp52o5LjcxTMqP%252Frht_vscode_github.png%3Falt%3Dmedia%26token%3D934b28e2-751c-4f5b-9aef-dcde3f20ce3f&width=768&dpr=4&quality=100&sign=df13fd55&sv=1)
Install the extension via Extension Manager's ...
menu (Install from VSIX...
) and restart VScode.
Now you can see the following actions:
![](https://wiki.redmodding.org/~gitbook/image?url=https%3A%2F%2F1427525421-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F4gzcGtLrr90pVjAWVdTc%252Fuploads%252FPg7bN8Y12rLguoZvMwl9%252Fimage.png%3Falt%3Dmedia%26token%3D29236ac6-8ee2-49a6-877d-714a9004e4f0&width=768&dpr=4&quality=100&sign=b4d5cbdf&sv=1)
Ctrl+Shift+P
The CET overlay
Hot Reload is integrated with Cyber Engine Tweaks. 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
.
Pushing the button will not reload .archive
files. RHT will do that automatically by watching the hot
folder.
![](https://wiki.redmodding.org/~gitbook/image?url=https%3A%2F%2F1427525421-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F4gzcGtLrr90pVjAWVdTc%252Fuploads%252FtTAIHaEDS3K91RbPo1fu%252Fimage.png%3Falt%3Dmedia%26token%3D4c648124-d692-40a5-b621-a0e45cf8452e&width=768&dpr=4&quality=100&sign=1e9e9c70&sv=1)
Scripts
Here, you can manually trigger a reload.
You can do this via by running "Hot Reload Scripts" from Visual Studio Code
![](https://wiki.redmodding.org/~gitbook/image?url=https%3A%2F%2F1427525421-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F4gzcGtLrr90pVjAWVdTc%252Fuploads%252FjgCrNvt4em9MnQ7SFwvb%252Fimage.png%3Falt%3Dmedia%26token%3D4655ccdc-17c8-4cac-9ff0-910d3cd59b02&width=768&dpr=4&quality=100&sign=c3c817b2&sv=1)
Tweaks
Here, you can manually trigger a reload.
You can do this via by running "Hot Reload Scripts" from Visual Studio Code
![](https://wiki.redmodding.org/~gitbook/image?url=https%3A%2F%2F1427525421-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F4gzcGtLrr90pVjAWVdTc%252Fuploads%252Fgq2wRN8s3EAFZPMCkl6R%252Fimage.png%3Falt%3Dmedia%26token%3Da93c2ca0-792e-49d8-9a62-ff1b86e71ace&width=768&dpr=4&quality=100&sign=98586a07&sv=1)
Last updated