Adding Text Based on Knowledge

I did a perusal of topics with some key words but don’t see anything relevant, so forgive me if this has been solved.

I’m attempting to create a compendium/journal of the lore within my world. However, I don’t want the player to have all the information at once.

If you’ve ever played Hades, I’m attempting to add things to a journal entry as they learn more from people or quests. For example:

XYZ is a city on the coast. It’s known for its bustling trade.

(Play more to Unlock)

Say they went to XYZ and found out there is a super successful black market there. I want the journal entry about XYZ to the read:

XYZ is a city on the coast. It’s known for its bustling trade.

There is a secret black market run by feral gnomes who hate elves. You went there and did ABC and the gnomes now hate you.

How would I code something like this? I’m well versed in *selectable_if’s, *if and *else statements, etc… but I don’t feel like any of those apply, or if they do, there is a simple way to do it.

Thanks all.

4 Likes

It may be that you would need a list of variables that activate after the right choice path has been followed. If you avoid the coastal town altogether, then the text unlocked about the towns’ secrets by visiting never gets set to “true” so to speak. I don’t know if there’s a less involved way to manage this, though. :thinking:

4 Likes

Store the text in a variable. Everytime the player unlocks more content, you simply concatenate it with more strings of text.
But I have no idea how to insert line breaks in between the paragraphs.

Maybe divide the page in various paragraphs with a (empty?) string variable in each? And you will be *set ing or concatenating as the contents grow?

As said above, you will need to use variables and *if statements.

You can use numbers to track how much the player character knows about an entry, increasing it at key points as they learn more about the world. Have it start at 1 (minimum level of knowledge), then *set it when that level increases.

*if know_xyz >= 1
  XYZ is a city on the coast. It’s known for its bustling trade.
*if know_xyz >= 2
  There is a secret black market run by feral gnomes who hate elves.
[and so on] 

But one problem with using only one variable is that it won’t remember player choice. So you will need more to keep track of choices that change the entries:

*if (did_abc)
  You went there and did ABC and the gnomes now hate you.
3 Likes

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.