Relationships
A relationship is a one-way link from one entity to another, such as a group contains a member, a person carries an item, or a mentor supports a trainee. Each link has a start and an end.
To add one, open the template’s Definitions and tap New next to Relationships.
The relationship reads as sentences you change by tapping their pills (see Editing with sentences). A new “Carries” relationship reads:
- “Carries links anyone to anyone.”
- “Each entity has any number of Carries links going out.” and the same for links coming in.
- “Nobody may link to themselves.”
- “Only pairs where no rule.”
- “At the start: nothing is linked yet.”
Who can be linked
Section titled “Who can be linked”- Tap the first anyone to answer “Who can be the start of a Carries link?”, and the second to answer “Who can be the end of a Carries link?”. With no condition, anyone can. Tap Add a condition to add a condition about the start of the link or the end of the link, such as “the start of the link is a Person”.
- Tap no rule to answer “Any rule about the pair together?”: an optional condition about the two entities, such as both being in the same department.
These rules can only check the entities themselves, such as their kind, traits and attributes: not other links, counts, scenario attributes or time.
These rules keep applying after a link is made. If an entity stops meeting them, for example by losing a trait, its links are removed automatically.
Limits
Section titled “Limits”- Max outgoing per source: tap any number of in the “going out” sentence to set how many links each start entity can have.
- Max incoming per target: the same in the “coming in” sentence, for each end entity.
Choose Any number for no limit, or At most and a number. For example, a person who can carry many items, but each item carried by only one person: leave going out at any number of, and set coming in to at most 1.
To let an entity link to itself, tap Nobody and choose Anyone (Allow self-relationships). It’s Nobody by default.
Starting links
Section titled “Starting links”To have links in place when a scenario starts, save the relationship, then tap Add a starting link…. Under New starting link, choose the Kind and Which one at each end, so it reads something like “Team #0 has Member of to Person #1”, and tap Add. Starting links are added and removed straight away, not when you tap Save. To remove one, tap it in the “At the start” sentence and tap Remove this starting link.
Entities are numbered from 0, so an entity template with 3 Initial instances has #0, #1 and #2. A kind with no initial instances can’t be picked.
Using relationships
Section titled “Using relationships”- Effects create and remove links: Create a relationship and Remove a relationship.
- Conditions check whether entities are linked.
- An action can be given Via a relationship, so an entity can only do it through a link, such as an item letting whoever carries it use it.
- Triggers can react when a link is created or removed.
- An activation requirement can check that every entity has enough links.
- Groups and teams are usually built from a relationship like “contains”, from a group to each member.
Deleting a relationship
Section titled “Deleting a relationship”On a draft, open it and tap Delete relationship. Its starting links are deleted with it. Anything else that uses it is flagged when you publish.