Player position during the conversation

Announcements, support questions, and discussion for the Dialogue System.
raingame98
Posts: 25
Joined: Thu Dec 28, 2017 6:06 am

Re: Player position during the conversation

Post by raingame98 »

Tony Li wrote: Fri Apr 27, 2018 8:28 am 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:

Code: Select all

IEnumerator Start()
{
    yield return new WaitForEndOfFrame();
    if (Lua.IsTrue(luaCode)) StartConversation("foo");
}
3.. You can add a Condition variable to your script:

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);
    }
}
If you don't want the full Condition, you can use the tag [LuaConditionWizard] to get the Lua wizard:

Code: Select all

[LuaConditionWizard]
public string luaCodel
Oh, good! Thank you, I am gonna try it. I was waiting for you)) All day working on that)
User avatar
Tony Li
Posts: 22059
Joined: Thu Jul 18, 2013 1:27 pm

Re: Player position during the conversation

Post by Tony Li »

If you get stuck, please feel free to send an example project to tony (at) pixelcrushers.com. I'll be happy to take a look.
Post Reply