Page 1 of 1

How to define tags from a text table?

Posted: Tue Jun 20, 2023 8:54 pm
by ds2497
Hi there,

I was wondering if there is a way for me to define a name for an entity (like a procedurally generated quest) in a regular quest and display it using a text table.

For example, I have a quest centered around a girl who wants to understand how guys perceive her. The girl acts as the quest giver, so I can use {QUESTGIVER} to display her name in the Journal and I want to do the same thing with guys. Is there a method to define {GUY_A}, {GUY_B}, and {GUY_C} in a text table and display their names as tags? Or, are there any other similar approaches that can accomplish this?

Re: How to define tags from a text table?

Posted: Tue Jun 20, 2023 9:40 pm
by Tony Li
Hi,

Assuming each guy is a quest entity, each guy will have a display name. You can assign a string, a String Asset, or a Text Table field to the display name.

When the girl generates a quest, the generated quest text should include the guy's display name.

Re: How to define tags from a text table?

Posted: Tue Jun 20, 2023 9:47 pm
by ds2497
Hi Tony,

I apologize for the confusion. I wasn't referring to a procedurally generated quest, but rather a designed quest. Is it possible for me to customize my own tags?

Re: How to define tags from a text table?

Posted: Tue Jun 20, 2023 10:28 pm
by Tony Li
Hi,

Yes, but only in C# using Quest.tagDictionary.SetTag(tag, value). Examples:

Code: Select all

// Assign string value to tag GUY_A:
someQuest.tagDictionary.SetTag("GUY_A", "Adam");

// Assign text table field to GUY_B:
int fieldID = someTextTable.GetFieldID("Bob");
someQuest.tagDictionary.SetTag("GUY_B", new StringField(someTextTable, fieldID));

Re: How to define tags from a text table?

Posted: Tue Jun 20, 2023 11:13 pm
by ds2497
Got it, thanks!

Re: How to define tags from a text table?

Posted: Wed Jun 21, 2023 7:57 am
by Tony Li
Glad to help!

Re: How to define tags from a text table?

Posted: Thu Jun 22, 2023 4:05 am
by ds2497
I'll leave this for anyone who might want to use custom tags or have their terms localized in I2. You can consider overriding the AddBodyContent method in UnityUIQuestJournalUI. I hope this helps!

Image