-
Notifications
You must be signed in to change notification settings - Fork 0
Social Events
This file contains sample definitions of various social events that could be triggered by some in-game logic. TDRS uses YAML instead of scriptable objects because it is easier to build expressive constructs without complicated editor scripting or recompilation. The main trade-off is that documentation needs to be clear about what options are available to users, how to use them, how to expand upon them. Documentation for the event specifications is provided below and on the GitHub wiki: https://github.com/ShiJbey/Unity-TDRS/wiki. If you want to better familiarize yourself with YAML, the following page has been helpful: https://quickref.me/yaml.
(1) Events within YAML files must be organized as a sequence of mappings. Where each entry Contains all the required mapping keys: event, description, and responses. Each is explained in more detail below.
(2) Each social event definition should start with an "event" key followed by the name of the event and the names of agent roles involved in the event. Role names must be prefixed with an '?'. This is a convention for naming variables in TDRS' database query language.
(3) The description of the event uses a template syntax where the IDs of the agents bound to the specified roles are substituted into the description text. This description is used within the stat modifier system, among other things, to explain why some modifiers are present.
(4) Next, we specify effects that should be applied when the event is invoked. These are referred to as "responses" because they specify who should react to the event and how. Each response has two parts, "apply" and "where". The "apply" section is a sequence of strings that describe effects to trigger as a result of the event. Effects start with the effect name followed by a series of parameters separated by one or more spaces. Some effects accept variables as parameters. These are expanded by the event system to refer to the agents bound to the roles. The "where" section allows users to specify a database query as a precondition for the "apply" section. By default, the role names are always available as variables for the effects. The "where" query allows users to bind additional variables within the query and use them in effects. Below we use queries to find family and friends of the victim to change how they feel about the betrayer. All queries use the RePraxis query language. You can read more about it here: https://github.com/ShiJbey/RePraxis. Each query is provided as a multi-line YAML string.