I broke Lua Functions...

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
NicoMozes
Posts: 30
Joined: Sun Jun 05, 2022 4:18 am

I broke Lua Functions...

Post by NicoMozes »

Hey Toni,
Happy Sunday!

As always, I hope you are doing very well.

Need once again your assistance, as somehow I have broken the Lua Functions.

I have used them non stop and now suddenly I'm getting the following error:

Code: Select all

Dialogue System: Lua code 'SendMessageSystem("Spoke", "Claire")' threw exception 'Tried to invoke a function call on a non-function value. If you're calling a function, is it registered with Lua?'
UnityEngine.Debug:LogError (object)
PixelCrushers.DialogueSystem.Lua:RunRaw (string,bool,bool) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Wrapper/Lua Interpreter/Lua.cs:252)
PixelCrushers.DialogueSystem.Lua:Run (string,bool,bool) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Wrapper/Lua Interpreter/Lua.cs:131)
PixelCrushers.DialogueSystem.ConversationModel:ExecuteEntry (PixelCrushers.DialogueSystem.DialogueEntry,PixelCrushers.DialogueSystem.CharacterInfo) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Model/Logic/Model/ConversationModel.cs:296)
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:318)
PixelCrushers.DialogueSystem.ConversationView:FinishSubtitle () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:441)
PixelCrushers.DialogueSystem.ConversationView:HandleContinueButtonClick () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:413)
PixelCrushers.DialogueSystem.ConversationView:OnConversationContinue (PixelCrushers.DialogueSystem.IDialogueUI) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:392)
UnityEngine.Component:SendMessage (string,object,UnityEngine.SendMessageOptions)
PixelCrushers.DialogueSystem.AbstractDialogueUI:OnContinueConversation () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Abstract/Dialogue/AbstractDialogueUI.cs:375)
PixelCrushers.DialogueSystem.AbstractDialogueUI:OnContinue () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Abstract/Dialogue/AbstractDialogueUI.cs:365)
PixelCrushers.DialogueSystem.StandardUIContinueButtonFastForward:OnFastForward () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Effects/StandardUIContinueButtonFastForward.cs:86)
UnityEngine.EventSystems.EventSystem:Update () (at ./Library/PackageCache/com.unity.ugui/Runtime/UGUI/EventSystem/EventSystem.cs:530)
When I activate the Debug in the controller it shows that the function is being registered, and the controller is active when I run the dialogue, so not sure how this happened.

Any clue where I should look?

Thanks in advance!
Nico
Attachments
Register OK.png
Register OK.png (122.36 KiB) Viewed 47 times
User avatar
Tony Li
Posts: 23379
Joined: Thu Jul 18, 2013 1:27 pm

Re: I broke Lua Functions...

Post by Tony Li »

Hi,

Is something unregistering it? Look later in the Console logs for a message like:

Dialogue System: Unregistering Lua function SendMessageSystem
NicoMozes
Posts: 30
Joined: Sun Jun 05, 2022 4:18 am

Re: I broke Lua Functions...

Post by NicoMozes »

Hi Tony,

These 3 functions get unregistered:
RandomizeNextEntry
RandomizeNextEntryNoDuplicate
UpdateTracker

Another odd point is that upon opening the project, the first time I run the dialogue works.

Hit stop, and then Play again, and the error appears again.

Close the project and Open it again, and the same thing happens…
Post Reply