Dialog/written text in the game beyond simple one-offs are handled by a system referred to internally as DDS (Dynamic Dialog System).

Essentially, this breaks up written components into editable phases, which are nested inside one another. From smallest to largest they are as follows:

Blocks

Messages

Conversation Trees/Threads

Bundles

The idea behind this system is to generate messages that are as dynamic as possible with as little input as possible. Dynamic trees hold dynamic messages formed of dynamic blocks etc.