Is it possible to construct a dynamic instance variable reference.
Let's say an NPC has instance variables with the following names:
Dialogue1
Dialogue2
Dialogue2
It also has an instance variable called DialogueState, which stores the name of the current dialogue to be written (for example Dialogue1).
Is it possible to refer to the Dialogue1 instance variable based on the DialogueState instance variable? In other words, can I construct the instance variable reference dynamically using DialogueState to determine which instance variable I want to take the value from?