A very simple way of displaying different lines of text (aside from just shoving a load of different text objects on a layout) is to use instance variables. In this example, there is an NPC object which has an instance variable called ‘Dialogue’. It’s a string variable, so we can store some text in there to use later.
To actually get the text to show up, takes just one event. In broad terms, when a thing happens, show this NPC’s text. In order to make sure we’re picking the right one, the example file uses an ‘is overlapping’ condition. This means it should only use the instance variable associated when the NPC the player is overlapping. So:
Condition
Player ▶︎ is overlapping NPC
Action
Text ▶︎ Set text to NPC.Dialogue
Then, if you want the text to disappear when you’re not ‘talking’ to an NPC, you can use an Else:
Condition
System ▶︎ Else
Action
Text ▶︎ Set text to “”
This will set the text to nothing, so the text box will appear blank until you overlap with another NPC. And that’s all there is to this method! If you've only got a couple of objects that need to display unique text, or if you have many instances of one object that need to show the same text, this system should be ideal for you!