Page 1 of 1

Visual Novel Framework, bug with loading saves with Lua code

Posted: Sat Nov 25, 2023 12:29 am
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?

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

Posted: Sat Nov 25, 2023 9:31 am
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.

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

Posted: Sun Nov 26, 2023 7:20 am
by Kairos
I figured it out!

Thanks tony!

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

Posted: Sun Nov 26, 2023 9:16 am
by Tony Li
Glad to help. I'm glad you figured it out!