Skip to content

02. Basic concepts

sergiodinapoli edited this page Sep 11, 2021 · 2 revisions

SpeakUp is a Social Interactions Framework (SIF) mod for Rimworld.
It works by using XML and C# files. Specifically, while C# resources make up the framework itself, XML files are used to fill in the framework. So you are not required to have C# skills to manage SpeakUp dialogues, as XML is enough.

The Patches folder contains the files for the opening sentences (Chitchat, KindWords, etc.). Specifically, the Patches.xml file contains the Chitchat content and other miscellaneous content. The Defs folder contains the Interactions.xml, where you can find the reactions.

Each line of dialogue happens between 2 pawns. The pawn speaking the line is called INITIATOR, while the one who is listening to the line is called RECIPIENT.

To avoid misunderstandings, here's an example:

P1- Hi, Carla! How are you?
P2- Hi, Mario! I'm fine, thanks.

P1 has the first line. In this line, P1 is the INITIATOR (he's speaking) while P2 is the RECIPIENT (she's listening). So, if it is a ChitChat line, it must be contained in the general Patches.xml file. Whatever parameter you use, INITIATOR will always be referred to P1, while RECIPIENT to P2.

As for the second line, it must be specified in the Interactions.xml file and everything is inverted: P2 is the INITIATOR (she's speaking) while P1 is the RECIPIENT (he's listening).

So keep in mind: a RECIPIENT is not necessarily the one who's answering a question. A RECIPIENT is always who's listening to a line of dialogue.

The XML writing rules for SpeakUp are based on a mix of:

  • C# mechanisms already available in vanilla
  • C# mechanisms coded by JPT or Matthewes, either new or vanilla-based

VERY IMPORTANT NOTE
Whatever you write, be sure you never break a <li></li> line with a return. Also never write --> or - instead of the correct form ->.
These typos will crash your game in the most hateful way: suddenly, and without a chance to understand what went wrong.
If you put some blank space in the wrong place, the game shall raise an error - but at least it won't crash. In general, pay extra attention to avoid mistypings.