Page 1 of 1

Error OnExecute

Posted: Thu Aug 08, 2024 8:26 am
by giltar
Hi,
Im not sure when it happened but I think it is the latest version I installed a couple of days back. I have my oun script that is run in Scene-Independent events. It adds a player object (instantiantes...).

But this error sudenly starts to show and somewhat wierdly influences my code (some of my methods just dont end). The behaviour is very peculiar. The player gets added though.

Could you please navigate me to how to get rid of it?

Tx

Code: Select all

Scene OnExecute() event failed on dialogue entry 89:2: Object of type 'UnityEngine.Object' cannot be converted to type 'UnityEngine.GameObject'.
UnityEngine.Debug:LogWarning (object)
PixelCrushers.DialogueSystem.ConversationModel:ExecuteEntry (PixelCrushers.DialogueSystem.DialogueEntry,PixelCrushers.DialogueSystem.CharacterInfo) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:315)
PixelCrushers.DialogueSystem.ConversationModel:GetState (PixelCrushers.DialogueSystem.DialogueEntry,bool,bool,bool) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:266)
PixelCrushers.DialogueSystem.ConversationModel:GetState (PixelCrushers.DialogueSystem.DialogueEntry) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:354)
PixelCrushers.DialogueSystem.ConversationController:OnFinishedSubtitle (object,System.EventArgs) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Controller/ConversationController.cs:309)
PixelCrushers.DialogueSystem.ConversationView:FinishSubtitle () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:437)
PixelCrushers.DialogueSystem.ConversationView:OnFinishedSubtitle () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:444)
PixelCrushers.DialogueSystem.Sequencer:FinishSequence () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs:616)
PixelCrushers.DialogueSystem.Sequencer:Update () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs:608)

Re: Error OnExecute

Posted: Thu Aug 08, 2024 4:46 pm
by Tony Li
Hi,

Inspect the OnExecute() UnityEvent. It's misconfigured. For example, maybe a non-GameObject is assigned but the method expects a GameObject.

Re: Error OnExecute

Posted: Sat Aug 10, 2024 1:47 am
by giltar
Hi, that is definitely not the case. As I write (sry it might be a little badly described), the node that the code is execute on is not the node I have it on.

Ill try the screenshots. This is the one that my OnExcecute should happen on:
Screenshot 2024-08-10 at 7.44.16.png
Screenshot 2024-08-10 at 7.44.16.png (126.52 KiB) Viewed 807 times
But when I run the dialogue, it creates itself empty (as a Scene event this time) on a previous node. See on the screen shot here:
Screenshot 2024-08-10 at 7.47.17.png
Screenshot 2024-08-10 at 7.47.17.png (138.91 KiB) Viewed 807 times

Re: Error OnExecute

Posted: Sat Aug 10, 2024 10:53 am
by Tony Li
Which dialogue entry has ID 2?

Re: Error OnExecute

Posted: Sun Aug 11, 2024 2:20 am
by giltar
The green one on the screen shot.

Re: Error OnExecute

Posted: Sun Aug 11, 2024 9:00 am
by Tony Li
Is the object ("PlayerDialogueA...") that's assigned to that scene event a scene GameObject? Or is it an asset such as a ScriptableObject asset in the Project view?

If it's an asset, you might want to assign it to the non-scene event section instead.

Also, what happens if you assign a GameObject to its parameter field?

Re: Error OnExecute

Posted: Sun Aug 11, 2024 9:51 am
by giltar
I will try to explain it again. The issue is this event should not even be there. It creates itself during runtime (I do not add it there). Sry for not being clear. That is the main issue Im experiencing.

Re: Error OnExecute

Posted: Sun Aug 11, 2024 10:05 am
by Tony Li
Hi,

Are there perhaps two copies of your dialogue database? Maybe you're editing one copy, but an older copy (with the event assigned) is assigned to the Dialogue Manager. If you inspect the database that's assigned to the Dialogue Manager, does it have anything in the UnityEvent at design time in the Dialogue Editor?

Re: Error OnExecute

Posted: Sun Aug 11, 2024 2:14 pm
by giltar
Hi Tony, tx for directing me, the issue was that there really was a scene event but since it was bound to another scene, not my control scene, I did not see it until I ran the game. Thank you for help!

Re: Error OnExecute

Posted: Sun Aug 11, 2024 2:23 pm
by Tony Li
Glad to help!