Rules

When the companion go an adventure with me?

Companions has their own rules where do accept or do reject your adventure invitation. Each rule contain a key which represents a condition required to apply a rule and the action what happens when the rule is matched. The rules are checked from the first to the last and when a rule condition is matched, then the rule action is applied and the rule cheking is interrupted. Rules are defined for each companion in their disposition JSON file under field Rules.

Rule conditions are parsed by Expanded Precondition Utillity.

Writing rules

Define your rules from the most specific to the most general.

Conditions

The rule conditions has the similar format like preconditions for SDV events, but negations with ! are supported. You can define. You can define more conditions for the rule delimited by /. For more information about conditions see EPU docs.

<condition 1>/<condition 2>/...

Actions

Actions represents what happens when the rule is matched and they are the string with format: <ActionName> [<DialogueKey>] [<AskCooldown>]

FieldTypeDescription
ActionNameaccept or reject string.REQUIRED! This represents what invited NPC does. They can accept or reject your invitation.
DialogueKeystringA dialogue key of dialogue which asked NPC speaks when you invite them. Default is companionAccepted for accept action and companionRejected for reject action.
AskCooldownintThis field is applicable only for reject action. It represents a time in real seconds during which player can't ask the NPC for the adventure since they was asked last time. After this cooldown expiration player can try invite them to an adventure again. The default value is 10 seconds.

Example

There is an example of rules for Abigail NPC acompanion. They are sorted from the most specific to most general rule and splited into two parts: marriage rules (applicable if you are married with her) and the regular aka non-marriage rules (applicable if you aren't married with her).

{
  /* Marriage */

  // Reject adventure when you are married with Abigail and your hearts is less than 8 hearts
  "O Abigail/!f Abigail 2000": "reject",

  // Always accept adventure when farmer is married with her (ignores all other rules)
  "O Abigail": "accept",

  /* Regular */

  // Requires Abby's six hearth event to be seen
  "k 4": "reject",

  // Reject adventure when it's Friday after 3pm and farmer has less than 8 hearts
  "!f 2000/!d Fri/t 1500 2100": "reject companionRejectedFridayPub",

  // Accept adventure whole day except her sleep hours
  "t 600 2200": "accept"
}

We highly recommend follow the format used in this example for your own rules for your companion.