This guide is the advanced version of this: Simple Text Substitution. In this guide you’ll learn how to do things like:

Overview

An object is a collection of variables comprised of integers, strings, or other variables. Characters are objects by definition since they have a Unique ID and relationship values. Attributes are characteristics of objects.

Attributes

Unlike Variables, Attributes should be in lower case (as seen above in the gender substitution example). For instance, LANNISTER and STARKS could be objects with the following attributes:

// Lannister
[set: LANNISTER "Lannister"]
[set: LANNISTER.wealth 1000]
[set: LANNISTER.words "A Lannister always pays his debts"]
[set: LANNISTER.leader "Tywin"]

// Starks
[set: STARK "Stark"]
[set: STARK.wealth 500]
[set: STARK.words "Winter is coming"]
[set: STARK.leader "Robb"]

Attributes allows you to create many custom story details that are part of 1 object. You can then easily refer to that object in one line without having to refer to each individual attribute. There are 2 ways to work with objects: by reference or by copy. We’ll go over by reference first since it’s the method 95% of you will use.

Reference

Most of the time when we work with objects we simply want a shortcut for referring to that object rather than duplicating the object. Whether you perform operations on the object directly or the shortcut, it will have the exact same effect. A good rule of thumb is you’ll want to use Reference for proper nouns.

For those of you familiar with coding, reference could be thought of as a “pointer”. Extending the example above, we can have the player select a house and then all of those attributes come along for the ride and can be used in text substitution just as any variable.

We’ll show you 3 common scenarios where you can use:

Example Scenarios

This section will walk you through advanced ways to use substitution to build systems.

Swapping A Character Into A Role

This scenario will cover any time you have a set “role” (such as a love interest or party member) you want a character to fulfill for any duration of time. For this purpose, we will break down three scenarios.

Choosing My Love Interest