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.

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.