Visual Novel Framework, bug with loading saves with Lua code

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Kairos
Posts: 5
Joined: Fri Nov 24, 2023 9:22 am

Visual Novel Framework, bug with loading saves with Lua code

Post by Kairos »

I tried using the save system from the Visual Novel Framework for my game, but the problem is that every time I load the game, it does not assign the respected Lua code. It's fine when I'm playing it continuously, the problem only comes when I try to load my saves. What can I do to fix this?
Attachments
I am assigning them properly here:
I am assigning them properly here:
Lua Code Assignment.png (12.86 KiB) Viewed 416 times
Lua Code Bug.png
Lua Code Bug.png (94.17 KiB) Viewed 416 times
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Visual Novel Framework, bug with loading saves with Lua code

Post by Tony Li »

Hi,

The error message 'Exception has been thrown by the target of an invocation' means your FadeOut() method or MusicFadeIn() method threw an exception.

To allow the Dialogue System to continue functioning even if a user-registered Lua function fails, it reports this error message and continues, instead of stopping execution in your function.

To identify the issue, enable debugging in your code editor. Put a breakpoint at the beginning of each of those methods. Step through to identify what is causing the exception. It's probably a NullReferenceException. For example, a variable in your class may no longer be valid after loading the saved game.
Kairos
Posts: 5
Joined: Fri Nov 24, 2023 9:22 am

Re: Visual Novel Framework, bug with loading saves with Lua code

Post by Kairos »

I figured it out!

Thanks tony!
Last edited by Kairos on Sun Nov 26, 2023 7:20 am, edited 1 time in total.
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Visual Novel Framework, bug with loading saves with Lua code

Post by Tony Li »

Glad to help. I'm glad you figured it out!
Post Reply