Interaction

An **interaction** *(TDESC name: interaction)* is a complex game resource. Much of The Sims 4 revolves around interactions and they are one aspect of the game's code that are notably visible to the player. Interactions are used to cause behaviors in elements of the game such as Sims and objects, whether that behavior is performed visibly or not.

An interaction can visibly dictate a behavior of an element of the game (for example, when Sims move around, use the fridge, and so on, they are performing interactions) or can be used to push visible or invisible background effects on elements of the game (for example, an interaction to turn on the lights in a Sim's house).

The core elements of an interaction are the elements visible to the player and the outcomes. Depending on the type of interaction, they may have additional features. Interactions can be added through traits, buffs, role\_states or super affordances in an object's tuning. Sims themselves are technically objects, so adding interactions to all Sims works similar to adding interactions to other game objects.

## Purpose

*Section is incomplete and requires further expansion.*

## Coding

### Visible Components

The display\_name defines the name of the interaction visible by clicking on the target. A display\_tooltip can be added to add further information for the player. Display\_name\_in\_queue can be enabled to change the display for the interaction in the queue.

Display\_name\_overrides can be used to override the interaction randomly or based on a certain condition. An example for this are the changed interaction names during the Pirate Day holiday.

Display\_name\_wrappers can be enabled to add wrapper to the display name such as the fame wrapper from Get Famous.

The \_icon defines the picture visible in the interaction queue. It can be set to different things e.g. one of the participants of the interaction or an icon. The pie\_menu\_icon is used to add an icon to the pie menu that shows up when clicking on the target. The pie\_menu\_color can be used to associate an interaction with a certain mood and add a color overlay if the Sim is in the mood that is referenced - this has only a visual effect.

### Restricting an Interaction

An interaction can be restricted inside the tuning and by adding test set or global tests. These can also be defined inside the interaction itself and don't need to be tuned as an external test snippet.

Below is a full list of various ways to restrict an interaction (the most noteworthy ones are bolded):

* **allow\_autonomous**
* allow\_from\_object\_inventory
* allow\_from\_portrait
* allow\_from\_sim\_inventory
* allow\_from\_world
* **allow\_user\_directed**
* allow\_while\_save\_locked
* allowed\_to\_combine
* \_canceable\_by\_user
* **cheat**
* debug
* **test\_autonomous**
* **test\_globals**
* test\_incest
* **tests**
* visible

### Outcomes

An outcome is what happens *at the end* of the interaction. There are different types of outcomes. Not every outcome type is available in the different sub-classes of an interaction.

Below is a list of actions that can occur at the end of an interaction:

* animation\_ref
* basic\_extras
* consume\_object
* continuation
* display\_message
* events\_to\_send
* force\_outcome\_on\_exit
* loot\_list
* outcome\_result
* parameterized\_autonomy
* response
* route\_events
* xevt

#### Different Types of Outcomes

* **None**: As the name suggests, this sets the interaction to have no outcome.
* **Single**: This interaction will lead to a single outcome. This doesn't restrict the actions inside the outcome to one. It will only restrict the outcome so no matter what happens the interaction will always this outcome.
* **Dual:** Dual outcomes are based on a success and failure outcome. Most recognizable are Social Interactions, in which almost every interaction has a success and failure. Users can define two different outcomes that depends on the interaction succeeding or failing. The success chance can be set and influenced by multipliers based on tests.
* **Partial:** Partial outcomes allow the outcome run even if not all of its criteria have been met. For example, if the player choses two Sims to travel with and one Sim is busy, it will still let them travel with the other Sim.
* **Test\_Based**: The outcome will be chosen depending on tests. If no tests passes the fallback\_outcome will be chosen.

### Autonomy

*Section is incomplete and requires further expansion.*

### Constraints

Constraints restrict the posture or position of a participant of the interaction.

*Further reading: Constraints*

### Basic\_Content

Basic Content defines the nature of the interaction. Depending on the subclass on interaction, the choices vary. The duration and animation of an interaction are defined here, as well as changes that happen over the course of the interaction.

*Further reading: Basic\_Content*

### Basic\_Extras

Basic Extras are additional behaviors that can be triggered by the interaction. Usually, the timing for when this behavior should be triggered can be set. Basic\_Extras come with some behavior that can not be triggered by an outcome.

*Further reading: Basic Extras*

## Sub Classes of Interactions

* Super Interactions
* Mixer Interactions

*This page is incomplete and requires further expansion.*