Priority conversation
-
- Posts: 33
- Joined: Tue Aug 08, 2017 4:06 pm
Priority conversation
Hi, sorry for my bad english
i have a problem:
in a NPC (Gameobject) have 2 conversation trigger (2 different dialogues).
i want to know how put priority a one of this dialogues.
thanks
i have a problem:
in a NPC (Gameobject) have 2 conversation trigger (2 different dialogues).
i want to know how put priority a one of this dialogues.
thanks
Re: Priority conversation
Hi,
Each Conversation Trigger has a Condition section. You can use a Dialogue System variable.
For example, let's say you have two conversations:
Then set the Conditions on the Conversation Triggers:
Each Conversation Trigger has a Condition section. You can use a Dialogue System variable.
For example, let's say you have two conversations:
- Lesson 1
- Lesson 2
Then set the Conditions on the Conversation Triggers:
- Lesson 1: Condition > Lua Conditions: Variable["FinishedLesson1"] == false
- Lesson 2: Condition > Lua Conditions: Variable["FinishedLesson1"] == true
-
- Posts: 33
- Joined: Tue Aug 08, 2017 4:06 pm
Re: Priority conversation
ok thanks, but if i need a random conversation?Tony Li wrote:Hi,
Each Conversation Trigger has a Condition section. You can use a Dialogue System variable.
For example, let's say you have two conversations:
You can define a Boolean variable named "FinishedLesson1" that starts False. At the end of the Lesson 1 conversation, set the variable True. (In the Script field: Variable["FinishedLesson1"] = true)
- Lesson 1
- Lesson 2
Then set the Conditions on the Conversation Triggers:
- Lesson 1: Condition > Lua Conditions: Variable["FinishedLesson1"] == false
- Lesson 2: Condition > Lua Conditions: Variable["FinishedLesson1"] == true
how i do this?
Re: Priority conversation
You could use a random variable. Let's say you create a Number variable named "X".
The first step is to assign a random value when the scene starts. Add a Lua Trigger to your scene, set the Trigger to OnStart, and set Lua Code to:
Then set your Conversation Triggers' Conditions to:
Another approach is to skip all of these components. Use a single Conversation Trigger. In the conversation, set a random variable and branch to different sub-conversations as described in this post.
The first step is to assign a random value when the scene starts. Add a Lua Trigger to your scene, set the Trigger to OnStart, and set Lua Code to:
Code: Select all
Variable["X"] = math.random(3)
- Lesson 1: Condition > Lua Conditions: Variable["X"] == 1
- Lesson 2: Condition > Lua Conditions: Variable["X"] == 2
- Lesson 3: Condition > Lua Conditions: Variable["X"] == 3
Code: Select all
Variable["X"] = math.random(3)
-
- Posts: 33
- Joined: Tue Aug 08, 2017 4:06 pm
Re: Priority conversation
thanks
an the last question? (i hope so )
in set enable on dialogue event. the only one script disable is selector. how i can fix that?
an the last question? (i hope so )
in set enable on dialogue event. the only one script disable is selector. how i can fix that?
Re: Priority conversation
Do you want to assign more scripts? If so, increase the Size fields. This will make the lists bigger so you can assign more scripts.claudius_I wrote:in set enable on dialogue event. the only one script disable is selector. how i can fix that?
If that's not the problem, please reply with more details or a screenshot explaining what you want to do.
-
- Posts: 33
- Joined: Tue Aug 08, 2017 4:06 pm
Re: Priority conversation
Tony Li wrote:Do you want to assign more scripts? If so, increase the Size fields. This will make the lists bigger so you can assign more scripts.claudius_I wrote:in set enable on dialogue event. the only one script disable is selector. how i can fix that?
If that's not the problem, please reply with more details or a screenshot explaining what you want to do.
I only can select (gameobject) in target and always is the same script (protagonista).
other problem that i have is when the conversation start. The name of the character is the name of the (Gameobject) and not the that writed in dialogue database.
Re: Priority conversation
You can drag a specific component into the target slot. Click and hold on the component title, and drag it into the target slot.claudius_I wrote:I only can select (gameobject) in target and always is the same script (protagonista).
If the component is on a different GameObject, you'll need to use two Inspector tabs: To open another Inspector tab, right-click on another tab such as Game and select Add > Inspector. On one Inspector, select the GameObject with the Set Enabled On Dialogue Event, and click the padlock in the upper right to lock it. Then select the other GameObject, and drag the component title from one Inspector to the other.
This is by design. (See here for details.) Add an Override Actor Name component, and set the name that you want to appear in the UI.claudius_I wrote:other problem that i have is when the conversation start. The name of the character is the name of the (Gameobject) and not the that writed in dialogue database.
-
- Posts: 33
- Joined: Tue Aug 08, 2017 4:06 pm
Re: Priority conversation
this was very stupid i an a idiotTony Li wrote:You can drag a specific component into the target slot. Click and hold on the component title, and drag it into the target slot.claudius_I wrote:I only can select (gameobject) in target and always is the same script (protagonista).
i did't knew this form
thanks...
Re: Priority conversation
No worries! Unity is full of little tricks like this.