Page 1 of 1

Inconsistent error.

Posted: Sat Apr 04, 2015 8:02 am
by Munion
So we have an error popping up when we start a conversation.  However it's very easy to make go away.  Make any single change to anything in the inspector, even unrelated to dialogue, and it goes away.  That is, it goes away until you reload the scene.  Then the error persists thru many runs of the scene until I make any change in inspector.  Changing player runspeed makes the error go away until I reload the scene, changing player class does the same.  These are unrelated things that never touch dialogue system.  The closest thing we have tracked it to is when we send the OnUse message for conversation trigger to catch. Everything involved is should be valid and not null as far as the message is concerned.  The actors exist and have proper transforms which are able to be used without issues elsewhere.







NullReferenceException: Object reference not set to an instance of an object



PixelCrushers.DialogueSystem.SendMessageOnDialogueEvent.TryActions (.SendMessageAction[] actions, UnityEngine.Transform actor)



PixelCrushers.DialogueSystem.SendMessageOnDialogueEvent.TryStartActions (UnityEngine.Transform actor)

PixelCrushers.DialogueSystem.ActOnDialogueEvent.OnConversationStart (UnityEngine.Transform actor)

UnityEngine.Component:BroadcastMessage(String, Object, SendMessageOptions)

PixelCrushers.DialogueSystem.ConversationModel:InformParticipants(String)

PixelCrushers.DialogueSystem.ConversationController:.ctor(ConversationModel, ConversationView, Boolean, Action)

PixelCrushers.DialogueSystem.DialogueSystemController:StartConversation(String, Transform, Transform, Int32)

PixelCrushers.DialogueSystem.DialogueSystemController:StartConversation(String, Transform, Transform)

PixelCrushers.DialogueSystem.DialogueManager:StartConversation(String, Transform, Transform)

PixelCrushers.DialogueSystem.ConversationStarter:StartConversation(Transform)

PixelCrushers.DialogueSystem.ConversationStarter:TryStartConversation(Transform)

PixelCrushers.DialogueSystem.ConversationTrigger:OnUse(Transform)

UnityEngine.Component:SendMessage(String, Object, SendMessageOptions)

ActorComponent:StartDialogue() (at Assets/Code/Core/Components/ActorComponent.cs:470)







Really lost on this and the fact that any single change makes it vanish temporarily is making it really hard to track down any farther.

Inconsistent error.

Posted: Sat Apr 04, 2015 9:16 am
by Tony Li
Hi,



Thanks for posting the full error message. It points to a "Send Message On Dialogue Event" component. If you have one of these components in your scene, it might need a little adjustment. As it's going through the list of messages to send, it's encountering an element that doesn't have something assigned properly. If you don't see anything obvious, maybe its serialization got messed up somehow. Try removing the component, add it again, and reconfigure it.



You can also temporarily set the Dialogue Manager's Debug Level to Info. When it gets to the Send Message On Dialogue Event component, it will log lines like:

Dialogue System: Sending message 'X' to Y (parameter=Z)

Also, what version of Unity and the Dialogue System are you using?

Inconsistent error.

Posted: Sat Apr 04, 2015 10:27 am
by Munion
We are on Unity 4.6.3 and Dialogue System 1.4.8.



The component does look fine, filled out just like we have had it working for a long time now and it's still been working for a couple weeks since we updated dialogue system.  Tho we actually build the component on startup with the creation of our npcs, maybe that could be causing an issue.  The error only just popped up today tho.  Going to try setting the debug to info now and see if anything stands out.

Inconsistent error.

Posted: Sat Apr 04, 2015 10:48 am
by Tony Li
4270 wrote: Tho we actually build the component on startup with the creation of our npcs, maybe that could be causing an issue.


That was going to be my next question. When you build the component, initialize the onStart and onEnd arrays. For each element that you add to these arrays, initialize the condition field.



Version 1.4.8 and earlier had a couple places (primarily the condition field) that assumed that the components were added in the Unity editor, which initializes all public fields. Version 1.4.9 doesn't make that assumption. It's coming out tomorrow, so the fix may be as simple as importing 1.4.9.