Page 2 of 2
Re: How to use a cloned database
Posted: Thu Jun 14, 2018 5:54 pm
by lord_loej
Hey, I forgot to mention in my previous post that I do have dialogue actor component on my npc. The "Conversation Conversant" variable on the trigger is set to the instance of the prefab, not the asset. I also downloaded that package you sent me, the scene you setup works. I copied from that scene into mine, and mine still does not however, im not sure what ive still got wrong.
the actor is being added to the database (I know this because after I add the actor I will use
Code: Select all
Debug.Log(DialogueManager.MasterDatabase.GetActor(actorid).id);
to access all of its fields and see that they exist. also the conversation doesnt bring up any errors, meaning the variables are created.
Re: How to use a cloned database
Posted: Thu Jun 14, 2018 6:42 pm
by Tony Li
Is the instance's DialogueActor.actor property being set to the actor's name?
The Dialogue System provides some useful tools for debugging:
If you set the Dialogue Manager's Other Settings > Debug Level to Info, it will log a lot of info to the Console window. You can sift through this to see what's going on under the hood. Look especially for a line similar to:
Code: Select all
Dialogue System: Starting conversation 'Builder' with actor=player and conversant=NpcPrefab
Make sure it's using the right GameObjects.
At runtime, the Dialogue Editor window's Template tab turns into a
Watches tab where you can set watches on variables and general Lua expressions. You can set a watch on the ConversantIndex variable to make sure it's getting set properly.
Finally, you can add a
Lua Console to your scene. I like to put it on the Dialogue Manager. During play, press ~+L to open the console. Then you can enter expressions such as:
Code: Select all
return Variable["ConversantIndex"]
and
Code: Select all
return Actor[Variable["ConversantIndex"]]
If none of that helps, please feel free to send a reproduction project to tony (at) pixelcrushers.com. I'll be happy to take a look.
Re: How to use a cloned database
Posted: Thu Jun 14, 2018 7:39 pm
by lord_loej
Yes, the dialogueactor.actor component is changed to the correct name.
I used the lua console, and when I do "return Variable["ConversantIndex"] im shown
http://prntscr.com/jv4d9a
however when I do the same command in the sample scene you send me it returns the player given name of the actor.
additionally if I try to do that command "return Actor[Variable["ConversantIndex"]]" im given
http://prntscr.com/jv4dwi
however if I run the same command in the demo scene im given
http://prntscr.com/jv4e6r
I suppose the actor isnt being added to the database afterall? or the conversant is being replaced by the new actor.
Here is the debug log when the new npc is added
http://prntscr.com/jv4fbz
finally here is a screenshot of the conversation starting
http://prntscr.com/jv4fgy
Re: How to use a cloned database
Posted: Thu Jun 14, 2018 8:59 pm
by Tony Li
If I had to guess, I'd say that the NpcPrefab assigned to the Dialogue System Trigger component's Conversant field is the prefab, not the instance. Can you set the instance's GameObject name to be the same as its actor name? This way you can tell it from the prefab asset.
Re: How to use a cloned database
Posted: Thu Jun 14, 2018 9:57 pm
by lord_loej
so, I found the fix. it was a naming issue with my npcname generator, if I rename the name of the npcs generator object it will work perfectly.
Thank you so much for how much you've helped me, and sorry this issue took so long to fix.
Re: How to use a cloned database
Posted: Thu Jun 14, 2018 10:22 pm
by Tony Li
Glad to help!