Page 1 of 1
"Got Item" dialogue with name and description of the item
Posted: Sun May 03, 2020 8:20 am
by MrGurbiful
Hey,
I need help in making a "Got Item" dialogue with name and description of the item.
Later I like to localize and the name and description as well, so I need to keep that in mind. How can I do this?
Maybe set the variables as int for let's say an ID and then grab the text from script? I believe am thinking more complex than it should be...
Cheers
MrGurbiful
Re: "Got Item" dialogue with name and description of the item
Posted: Sun May 03, 2020 9:03 am
by Tony Li
Hi,
You don't need to do anything with int IDs.
For the name, create a Text Table asset and assign it to the Dialogue Manager's Localization Settings. Add the item name as a Text Table field. For example, let's say the item is an "apple". Add a field named "apple".
If you're using the Selector/ProximitySelector component and a Usable, set the Usable's name to the same value as the field ("apple"). At runtime, the Selector will look up the localized version of "apple". If you're using using a Selector, you can look up the localized version by calling DialogueManager.GetLocalizedText("apple").
For the description, create a conversation in your dialogue database. It only needs one node, for the description text. Or you can run it as a bark conversation. To localize it, add a localized field as described in the
Localization section.
Re: "Got Item" dialogue with name and description of the item
Posted: Sun May 03, 2020 7:19 pm
by MrGurbiful
Hey Tony,
thank you for your reply.
Is it possible to do it with multiple objects? It has to be a conversation and no bark. You know I have multiple objects with names and description. And I decided to put the name also in the conversation.
Re: "Got Item" dialogue with name and description of the item
Posted: Sun May 03, 2020 7:52 pm
by Tony Li
Yes, you can do it with multiple objects. Add an entry in the text table for each object. You can run a conversation instead. An easy way to do this is to write a short conversation for each item, for example titled "Items/Apple", "Items/Telephone", "Items/Painting", etc. Then set up a Dialogue System Trigger on each item GameObject that starts the corresponding conversation.
Re: "Got Item" dialogue with name and description of the item
Posted: Sun May 03, 2020 8:49 pm
by MrGurbiful
Ah yes I can see now how!
Thank you very much Tony!
Re: "Got Item" dialogue with name and description of the item
Posted: Sun May 03, 2020 10:48 pm
by Tony Li
Glad to help!