Page 1 of 1

ArgumentException: method arguments are incompatible

Posted: Fri Apr 08, 2022 5:28 pm
by gblekkenhorst
The NPCs were set to OnUse, and the Player was set to Selector with the mouse, which doesn't make sense for our center-locked third person character. Ideally the player would get the interact message when entering a trigger on the character, and the conversation would start when the player hit the interact button. I switched to the Proximity Selector on the player, and it works, but the interact message doesn't go away during the dialogue, and I'm getting this error message I can't make heads or tails of:

ArgumentException: method arguments are incompatible
System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method, System.Boolean throwOnBindFailure, System.Boolean allowClosed) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
UnityEngine.Events.InvokableCall`1[T1]..ctor (System.Object target, System.Reflection.MethodInfo theFunction) (at <31d5d65b32ec483292e13e8ae4100b93>:0)
UnityEngine.Events.CachedInvokableCall`1[T]..ctor (UnityEngine.Object target, System.Reflection.MethodInfo theFunction, System.Boolean argument) (at <31d5d65b32ec483292e13e8ae4100b93>:0)
UnityEngine.Events.PersistentCall.GetRuntimeCall (UnityEngine.Events.UnityEventBase theEvent) (at <31d5d65b32ec483292e13e8ae4100b93>:0)
UnityEngine.Events.PersistentCallGroup.Initialize (UnityEngine.Events.InvokableCallList invokableList, UnityEngine.Events.UnityEventBase unityEventBase) (at <31d5d65b32ec483292e13e8ae4100b93>:0)
UnityEngine.Events.UnityEventBase.RebuildPersistentCallsIfNeeded () (at <31d5d65b32ec483292e13e8ae4100b93>:0)
UnityEngine.Events.UnityEventBase.PrepareInvoke () (at <31d5d65b32ec483292e13e8ae4100b93>:0)
UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <31d5d65b32ec483292e13e8ae4100b93>:0)
PixelCrushers.DialogueSystem.DialogueSystemEvents.OnConversationStart (UnityEngine.Transform actor) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Manager/DialogueSystemEvents.cs:123)
UnityEngine.Component:BroadcastMessage(String, Object, SendMessageOptions)
PixelCrushers.DialogueSystem.ConversationModel:InformParticipants(String, Boolean) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:195)
PixelCrushers.DialogueSystem.ConversationController:Initialize(ConversationModel, ConversationView, Boolean, EndConversationDelegate) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Controller/ConversationController.cs:150)
PixelCrushers.DialogueSystem.DialogueSystemController:StartConversation(String, Transform, Transform, Int32) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Manager/DialogueSystemController.cs:926)
PixelCrushers.DialogueSystem.DialogueManager:StartConversation(String, Transform, Transform, Int32) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Manager/DialogueManager.cs:436)
PixelCrushers.DialogueSystem.DialogueSystemTrigger:DoConversationAction(Transform) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Triggers/Triggers/DialogueSystemTrigger.cs:950)
PixelCrushers.DialogueSystem.DialogueSystemTrigger:Fire(Transform) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Triggers/Triggers/DialogueSystemTrigger.cs:695)
PixelCrushers.DialogueSystem.DialogueSystemTrigger:TryStart(Transform, Transform) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Triggers/Triggers/DialogueSystemTrigger.cs:677)
PixelCrushers.DialogueSystem.DialogueSystemTrigger:TryStart(Transform) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Triggers/Triggers/DialogueSystemTrigger.cs:663)
PixelCrushers.DialogueSystem.DialogueSystemTrigger:OnUse(Transform) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Triggers/Triggers/DialogueSystemTrigger.cs:509)
UnityEngine.GameObject:BroadcastMessage(String, Object, SendMessageOptions)
PixelCrushers.DialogueSystem.ProximitySelector:UseCurrentSelection() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Triggers/Interaction/ProximitySelector.cs:255)
PixelCrushers.DialogueSystem.ProximitySelector:Update() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Triggers/Interaction/ProximitySelector.cs:219)

I attached the inspector for the player and NPC, perhaps I'm missing some kind of conflict?

Re: ArgumentException: method arguments are incompatible

Posted: Fri Apr 08, 2022 8:43 pm
by Tony Li
Hi,

Check the Dialogue System Events component on Naomiv2 -- in particular, the OnConversationStart() UnityEvent. An item in that UnityEvent may be misconfigured.

Re: ArgumentException: method arguments are incompatible

Posted: Tue Apr 12, 2022 11:42 am
by gblekkenhorst
You were right! There was an empty event there. Removing it fixed everything.

Re: ArgumentException: method arguments are incompatible

Posted: Tue Apr 12, 2022 11:57 am
by Tony Li
Great! I'm glad that fixed it.

Re: ArgumentException: method arguments are incompatible

Posted: Tue Apr 12, 2022 1:37 pm
by gblekkenhorst
I've encountered another issue though, somewhat related - I am triyng to use that OnConversationEnd event, but it is calling it on the first frame of the last line of the conversation, rather than when the dialogue actually finishes - this means our dialogue camera system and character controller lock exits a line too soon, and if the character only has a single line, it looks like it's never entering dialogue mode at all. Is there a different event that triggers when the dialogue UI closes?

Re: ArgumentException: method arguments are incompatible

Posted: Tue Apr 12, 2022 2:27 pm
by Tony Li
The OnConversationEnd event occurs as soon as the final node's Sequence end. If your dialogue UI plays a close animation after that, the close animation will play after the OnConversationEnd event. To know when the dialogue UI's close animation has finished, you can use the dialogue UI's Dialogue Panel > OnClose() event.