"Got Item" dialogue with name and description of the item

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
MrGurbiful
Posts: 3
Joined: Sun May 03, 2020 8:07 am

"Got Item" dialogue with name and description of the item

Post 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
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: "Got Item" dialogue with name and description of the item

Post 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.
MrGurbiful
Posts: 3
Joined: Sun May 03, 2020 8:07 am

Re: "Got Item" dialogue with name and description of the item

Post 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.
Last edited by MrGurbiful on Mon May 04, 2020 6:52 am, edited 2 times in total.
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: "Got Item" dialogue with name and description of the item

Post 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.
MrGurbiful
Posts: 3
Joined: Sun May 03, 2020 8:07 am

Re: "Got Item" dialogue with name and description of the item

Post by MrGurbiful »

Ah yes I can see now how!

Thank you very much Tony!
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: "Got Item" dialogue with name and description of the item

Post by Tony Li »

Glad to help! :-)
Post Reply