Player position during the conversation
-
- Posts: 25
- Joined: Thu Dec 28, 2017 6:06 am
Player position during the conversation
Hey, Tony!
I want my Player to go to some position before the conversation starts. So, I have a NPC who has a ConversationTrigger component. And I can't just set that Conversation should start OnTriggerEnter, because my PC is not on the position. At the beginning my player should go to some point, and then conversation must start. How do I need to resolve this problem? Thank you! Sorry for my English.
I want my Player to go to some position before the conversation starts. So, I have a NPC who has a ConversationTrigger component. And I can't just set that Conversation should start OnTriggerEnter, because my PC is not on the position. At the beginning my player should go to some point, and then conversation must start. How do I need to resolve this problem? Thank you! Sorry for my English.
Re: Player position during the conversation
Hi!
Do you want to immediately teleport the PC to the position? Or make the PC walk there?
To immediately teleport the PC, use a MoveTo() sequencer command in the first dialogue entry node.
For example, let's say your NPC is named Adam. You want the PC to teleport to a position one unit in front of Adam. To do this, add an child GameObject to Adam named "In Front Of Adam". Position it one unit in front of Adam, and facing Adam. Assuming the first dialogue entry node is spoken by the NPC, set its Sequence to:
If you need to make the PC walk to the NPC, it's more complicated. It depends on how your PC is configured to walk. If this is what you require, please let me know how the PC normally moves.
Do you want to immediately teleport the PC to the position? Or make the PC walk there?
To immediately teleport the PC, use a MoveTo() sequencer command in the first dialogue entry node.
For example, let's say your NPC is named Adam. You want the PC to teleport to a position one unit in front of Adam. To do this, add an child GameObject to Adam named "In Front Of Adam". Position it one unit in front of Adam, and facing Adam. Assuming the first dialogue entry node is spoken by the NPC, set its Sequence to:
Code: Select all
MoveTo(In Front Of Adam,listener); {{default}}
-
- Posts: 25
- Joined: Thu Dec 28, 2017 6:06 am
Re: Player position during the conversation
I tried to start conversation by using DialogueManager.StartConversation("ConversationName"); But it doesn't consider conversation's conditions.. Any ideas with this way?Tony Li wrote: ↑Thu Apr 26, 2018 8:38 am Hi!
Do you want to immediately teleport the PC to the position? Or make the PC walk there?
To immediately teleport the PC, use a MoveTo() sequencer command in the first dialogue entry node.
For example, let's say your NPC is named Adam. You want the PC to teleport to a position one unit in front of Adam. To do this, add an child GameObject to Adam named "In Front Of Adam". Position it one unit in front of Adam, and facing Adam. Assuming the first dialogue entry node is spoken by the NPC, set its Sequence to:
If you need to make the PC walk to the NPC, it's more complicated. It depends on how your PC is configured to walk. If this is what you require, please let me know how the PC normally moves.Code: Select all
MoveTo(In Front Of Adam,listener); {{default}}
PC (2D) moves by transform.Translate(). And there are a lot of computing and raycasting. I don't use any defalut character controllers. My PC moves like ->
There are several tutorials about 2D Character Controller, most thing I took from there.
Best.
Re: Player position during the conversation
Hi,
Use DialogueManager.StartConversation("ConversationName", playerTransform, npcTransform)
This associates the conversation with the correct GameObjects.
Use DialogueManager.StartConversation("ConversationName", playerTransform, npcTransform)
This associates the conversation with the correct GameObjects.
-
- Posts: 25
- Joined: Thu Dec 28, 2017 6:06 am
-
- Posts: 25
- Joined: Thu Dec 28, 2017 6:06 am
Re: Player position during the conversation
To resolve this problem, I think to write my own "ConversationTrigger". But then, I need Enum of Conversations, Quests, Variables and others in the inspector. Is it possible? For example Spine and FMOD studio let me get Enum of events in animation of Spine and FMOD events: http://prntscr.com/jaoikd
So if it is possible, I can write my own ConversationTrigger and set all conditions and start the conversation when and how I want. But it would be very good, if I just could call method StartConversation and all conditions would be considered.
Now if I call this method, I see the text in Conditions Field: "Last Check: None". When ConversationTrigger start for example by OnTriggerEnter: "Last Check: (true || false)". Applying playerTransform and NpcTransform doesn't help (
-
- Posts: 25
- Joined: Thu Dec 28, 2017 6:06 am
Re: Player position during the conversation
I found information about CustomProperties. I am gonna try it. But I still hope to make StartConversation(conversation, PCtrans, NPCtrans) work.
-
- Posts: 25
- Joined: Thu Dec 28, 2017 6:06 am
Re: Player position during the conversation
Tried like this: http://prntscr.com/jaopku
Called StartConversation, but the Conversation still does not consider its conditions
-
- Posts: 25
- Joined: Thu Dec 28, 2017 6:06 am
Re: Player position during the conversation
I'm still trying to make a custom editor to start conversation. I've made LuaConditionProperty and trying to check conditions (http://prntscr.com/jareen), but I get exception: http://prntscr.com/jarfv0
I can't understand what's wrong.
The interesting thing is - with Variable field there is no any exception. I thought that there is a ConditionWizard (like LuaConditionWizard), but there isn't.
I can't understand what's wrong.
The interesting thing is - with Variable field there is no any exception. I thought that there is a ConditionWizard (like LuaConditionWizard), but there isn't.
Re: Player position during the conversation
Hi,
Here are a few notes that should get it working:
1. Conditions are not observed on the START node.
2. The error message "Invoke function call on non function value" means the the Dialogue System did not find a quest named "FirstMeet". Is it perhaps named "First Meet" (with a space) or "firstMeet" or something like that? It's also possible, depending on how your scene is set up, that the quest database isn't fully loaded yet. If this is the case, you can wait until the end of the frame:
3.. You can add a Condition variable to your script:
If you don't want the full Condition, you can use the tag [LuaConditionWizard] to get the Lua wizard:
Here are a few notes that should get it working:
1. Conditions are not observed on the START node.
2. The error message "Invoke function call on non function value" means the the Dialogue System did not find a quest named "FirstMeet". Is it perhaps named "First Meet" (with a space) or "firstMeet" or something like that? It's also possible, depending on how your scene is set up, that the quest database isn't fully loaded yet. If this is the case, you can wait until the end of the frame:
Code: Select all
IEnumerator Start()
{
yield return new WaitForEndOfFrame();
if (Lua.IsTrue(luaCode)) StartConversation("foo");
}
Code: Select all
public class ConversationInstance : MonoBehaviour
{
public string conversation;
public Transform actor;
public Transform conversant;
public Condition condition;
void Start()
{
if (condition.IsTrue(actor)) DialogueManager.StartConversation(conversation, actor, conversant);
}
}
Code: Select all
[LuaConditionWizard]
public string luaCodel