# Scripted interactions

{% hint style="warning" %}
This is an outdated way of adding interactions, use the [Native Interactions Framework](https://wiki.redmodding.org/cyberpunk-2077-modding/modding-guides/world-editing/native-interactions-framework) instead
{% endhint %}

### Summary

**Published:** Feb 24, 2025 by [Akiway](https://app.gitbook.com/u/2021vbDrMKZ0TbHeIx2wzPyAYtl2 "mention")\
**Last update:** Feb 24, 2025 by [Akiway](https://app.gitbook.com/u/2021vbDrMKZ0TbHeIx2wzPyAYtl2 "mention")\
**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&#x20;*****like*****&#x20;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...

### Wait, this is not what I want!

* You want to add workspots for NPCs ? Check this guide : [placing-aispot-nodes](https://wiki.redmodding.org/cyberpunk-2077-modding/modding-guides/world-editing/ai-and-npcs/placing-aispot-nodes "mention")
* You want to change V's animations ? Check this section : [animations](https://wiki.redmodding.org/cyberpunk-2077-modding/modding-guides/animations "mention") -> [creating-animations-editing-vs-actual-in-game-animations](https://wiki.redmodding.org/cyberpunk-2077-modding/modding-guides/animations/creating-animations-editing-vs-actual-in-game-animations "mention")

## Get into scripting

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](https://wiki.redmodding.org/cyber-engine-tweaks/).

{% hint style="success" %}
If you're using Visual Studio Code, you can get proper information on the games / CETs functions and methods using the [CET Lua Lib](https://wiki.redmodding.org/cyber-engine-tweaks/resources/vs-code).
{% endhint %}

## Download the template

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.

{% file src="<https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-c2e59a2d00d43b0e77caec472ffd7697cbc84afe%2Finteraction_script_template.zip?alt=media>" %}

Thanks to @**keanuWheeze** for making most of the scripts.

Here is a breakdown of the its content:

```
archive
 └─ base
     └─ gameplay
         └─ devices
             └─ arcade_machines // Contains entities used to play workspot animations
resources
 └─ bin
     └─ x64
         └─ plugins
             └─ cyber_engine_tweaks
                 └─ mods
                     └─ {YourModName}
                         └─ init.lua                    // Your main file
                             └─ tween                   // Library used to ease transitions between animations (https://github.com/kikito/tween.lua)
                             └─ modules
                                 └─ devices             // Device interactions "ready-to-use"
                                     └─ template        // Device template that can be extended
                                 └─ external            // Game related utilities maintained in external repositories
                                 └─ utils               // Lua/CET utilities
                                 └─ workspots           // Workspot interactions "ready-to-use"
                                     └─ template        // Workspot template that can be extended
                                 └─ interactions.lua    // List of interactions you add to the world
                                 └─ variants.lua        // Variants and settings logic
                                 └─ variantSettings.lua // List of settings and variants
```

### Interactions available

Device interactions :

* Apprearance
* [Wardrobe](https://wiki.redmodding.org/cyberpunk-2077-modding/modding-guides/world-editing/archived-guides/scripted-interactions/wardrobe-interaction-device)
* Mesh swap *(template)*
  * Custom door

Workspot interactions :

* Sit *(template)*
  * Bench
  * [Couch](https://wiki.redmodding.org/cyberpunk-2077-modding/modding-guides/world-editing/archived-guides/scripted-interactions/sit-on-couch-interaction-workspot)
  * Lean (rail)
* Sleep
* Coffee
* Drink
* Shower

### External resources

* Lua kit for CET : [Cron, GameUI and more](https://github.com/psiberx/cp2077-cet-kit/tree/main) by @psiberx
* [Tween library](https://github.com/kikito/tween.lua) for smooth transitions by @kikito


---

# 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/modding-guides/world-editing/archived-guides/scripted-interactions.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.
