This page will gather knowledge and guides about scripted interactions in Lua.
Published: Feb 24, 2025 by Last update: Feb 24, 2025 by Credits: @keanuWheeze for creating 90% of the scripts shared in this pages.
This page and its subpages contain ressources to guides about making scriped interactions for the player, for Cyberpunk 2077.
For the following, we can distinguish 2 types of interactions : devices and workspots.
Device like interaction will trigger a more-or-less simple code, eg : Open the wardrobe menu, Toggle a streamingsector variant, Open the Appearance menu, etc...
Workspot interaction involve animations and/or props, eg : Sleep on a bed, Sit on a chair, Smoke a cigarette, Drink a beer, etc...
You want to add workspots for NPCs ? Check this guide : Placing AISpot Nodes
You want to change V's animations ? Check this section : Animations -> Editing V's Actual In Game Animations
The next tutorials will show you how to get interactions to work without Lua or CET knowledge, but if you want to understand more about it, you can find a dedicated wiki about Cyber Engine Teaks here.
If you're using Visual Studio Code, you can get proper information on the games / CETs functions and methods using the CET Lua Lib.
For the following tutorials, you will need this template. It provides a bunch of utilities to make diverses things, beyond just interaction scripts. You will probably not use all those files, but they can be usefull depending on your needs.
Thanks to @keanuWheeze for making most of the scripts.
Here is a breakdown of the its content:
Device interactions :
Apprearance
Mesh swap (template)
Custom door
Workspot interactions :
Sit (template)
Bench
Couch
Lean (rail)
Sleep
Coffee
Drink
Shower
Lua kit for CET : Cron, GameUI and more by @psiberx
Tween library for smooth transitions by @kikito
Add an "Open wardrobe" interaction.
Published: Feb 24, 2025 by Last update: Feb 24, 2025 by Credits: @keanuWheeze for creating 90% of the scripts shared in this pages.
This page is a subsection of the Scripted interactions guide. It will teach you how to add an interaction to open the wardrobe menu.
The logic shown here also applies to other device like interactions.
≥ 8.16.1 for Cyberpunk 2.21
Most recent from Feb 09, 2025
Visual Studio Code or any IDE to edit lua files
Knowledges required :
You know how to create a mod using Wolvenkit.
You know how to spawn objects using entSpawner
You downloaded the template that contains all the necessary files
Find the place where you want to add the interaction, this can be anything, an existing wardrobe, a new mesh you add, a secret compartment in the wall, or even in the middle of nowhere.
Using entSpawner, add and position a Meta > Static Marker where the Wardrobe icon will be displayed.
Copy the X Y Z position of the marker
(Optional) You can save the marker in a group to more easily change the position later if you're not happy with where the icon appears. But we won't need to export it.
In the interactions.lua
file, add your new device interaction inside the interactions.setupInteractions()
function :
The require contains the path to the device.
Its instantiation takes 2 parameters: an ID which must be unique, and the location.
Paste the X Y Z copied before into the Vector4
, the fourth parameter must be ignored and set to 0.0
.
If you're working with hot reload, you can change the interactions.lua
file from within your game folder and then directly press Reload all mods in the CET menu to see the result, without having to restart your game. Otherwise, redeploy you mod.
Not happy with the interaction range? or the icon visibility range? or the text label? Each interaction device comes with options that you can change to your will.
Default wardrobe parameters :
To change these, you can set their value before initializing the interaction, like so :
You want to regroup your localizations? Use the utils/localizedText.lua
to give your localizations more meaningful names.
Wolvenkit ( | )
Object Spawner ()
For localizations -> Open the LocKey browser inside Wolvenkit.
You want to add you own translations? Use the utils/lang.lua
file and take the time to translate your action in the other languages, all players will appriciate it!
For icons -> Open the Asset browser inside Wolvenkit and search for the mappin_icons.inkatlas
. The Part Mapping tab will help you choose the appropriate icon, then simply adapt the icon name as such : hide_weapon -> HideWeaponIcon. (You have a doubt on the name ? Search for it in the Tweak browser)
For sounds -> You can search for it in the SoundDB, or by using entSpawner Deco > Static Audio Emitter.