i began to use dialogue manager with quest machine and want to autostart a quest ,with lua condition, but i get this error
Dialogue System: Lua code 'return CurrentQuestState("Ve a preguntar por trabajo en las tiendas") == "unassigned"' threw exception 'Tried to invoke a function call on a non-function value. If you're calling a function, is it registered with Lua?'
or this
Dialogue System: Lua code 'return Variable["Comenzar_Juego"] == true' threw exception 'Lookup of field 'Comenzar_Juego' in the table element failed because the table element itself isn't in the table.'
(the quest exist in dialogue manager)
thank claudio
Re: problem autostart
Posted: Thu Aug 02, 2018 1:56 pm
by Tony Li
Hi,
Some things to check:
1. Make sure you added a Dialogue System Quest Machine Bridge component to the Dialogue Manager and ticked Override Quest Log.
2. Are you running the Lua condition in Awake? If so, it's possible that the Dialogue Manager hasn't initialized yet. Run it in Start instead.
3. Can you use Quest Machine's Quest State Quest Condition instead?
The condition above will autostart the quest as soon as the harvestCarrots quest is successful.
Re: problem autostart
Posted: Thu Aug 02, 2018 2:20 pm
by claudius_I
Tony Li wrote: ↑Thu Aug 02, 2018 1:56 pm
1. Make sure you added a Dialogue System Quest Machine Bridge component to the Dialogue Manager and ticked Override Quest Log.
2. Are you running the Lua condition in Awake? If so, it's possible that the Dialogue Manager hasn't initialized yet. Run it in Start instead.
3. Can you use Quest Machine's Quest State Quest Condition instead?
Hi Tony
1. it's added.
2. where i can change this?
3. I tried. don't worked. (Quest Machine: GetQuestState(35): Couldn't find a quest with ID '35'.)
thanks
Re: problem autostart
Posted: Thu Aug 02, 2018 3:13 pm
by Tony Li
Hi,
Maybe we're talking about different things. Is '35' the value of the quest asset's ID field? For example, the ID of the "Harvest Carrots" quest is "harvestCarrots":
Does your scene have a Dialogue Manager GameObject?
EDIT: It looks like the quest is defined in the Dialogue System, not Quest Machine. Is that correct? Is it defined in the Dialogue System's dialogue database? If so, you will need to untick Override Quest Log and use the Lua functions described at the bottom of page 11 of Quest Machine's Dialogue System Support document when working with Quest Machine quests. However, I don't think this will completely fix your issue. It looks like the Dialogue Manager isn't being initialized.
Re: problem autostart
Posted: Fri Aug 03, 2018 3:21 pm
by claudius_I
Hi Tony
Tony Li wrote: ↑Thu Aug 02, 2018 3:13 pm
Hi,
Maybe we're talking about different things. Is '35' the value of the quest asset's ID field? For example, the ID of the "Harvest Carrots" quest is "harvestCarrots":
I tried also this.
I created a video
i have other question about "GiveQuest()" you always need a NPC (assigt the quest "giver") ? i want start the quest from dialogue manager, but using setqueststate dont add the quest to player
thanks again
Re: problem autostart
Posted: Fri Aug 03, 2018 5:47 pm
by Tony Li
Hi,
Thank you for posting the video. You have defined two different quests named "buscarTrabajo". One is a Dialogue System quest. It is defined in the Dialogue System's dialogue database. The other is a Quest Machine quest. It is defined in the asset file named "Busca Trabajo".
You should only define one quest with this name. Decide whether you want to define your quests in Quest Machine or the Dialogue System. If you want to define the quests in Quest Machine, leave the quest asset files in your project (e.g, "Busca Trabajo"). In the Dialogue Editor window, delete the quests from the Dialogue System's dialogue database.
Every Quest Machine quest asset must be assigned to your quest database asset. In your scene, the Quest Machine GameObject still points to the "Demo Quest Database" asset. Create a new quest database asset. Assign it to the Quest Machine GameObject. Then add your quest assets to it.
These steps should get you farther. There might still be some issues that I can't see from that video. If you have questions after making the changes, just let me know.
claudius_I wrote: ↑Fri Aug 03, 2018 3:21 pmi have other question about "GiveQuest()" you always need a NPC (assigt the quest "giver") ? i want start the quest from dialogue manager, but using setqueststate dont add the quest to player
You do not always need an NPC Quest Giver. You can add the quests directly to the player's Quest Journal component instead. They will not appear in the HUD or the quest journal UI until you activate them.