Game crashed after load game after a Custom Button

The engine is not working as expected? Documentation is wrong or out of date? Let us know here!
Forum rules
To receive direct priority support join our Discord server, register your Naninovel copy and ask in #support channel.
Post Reply
pisanto
Posts: 2
Joined: 24 Dec 2021 23:10

Game crashed after load game after a Custom Button

Post by pisanto »

Hi! I'm not sure is this a bug or what I'm done wrong, here is the situation:

1:Make some custom choice button prefab(put them in Resources/Naninovel)
2:In script like:
@choice "test1" button:btn goto:.1
@choice "test2" button:btn2 goto:.2
@choice "test3" button:btn3 goto:.3
3:Run the game, save game after the choice
4:Restart game, load the save, game crash and this pop up: "Exception: Failed to add custom btn choice button. Make sure the button prefab is stored in a Resources folder or custom loader in choices configuration is set up correctly. Be aware, that when using custom loader, dynamic path values (with expressions) are not supported."

I made a test with pure new project, problem still, any help would be appreciated.

Exception: Failed to add custom btn choice button. Make sure the button prefab is stored in a Resources folder or custom loader in choices configuration is set up correctly. Be aware, that when using custom loader, dynamic path values (with expressions) are not supported.
Naninovel.UI.ChoiceHandlerPanel.LoadCustomButtonPrefab (System.String path) (at Assets/Naninovel/Runtime/UI/ChoiceHandler/ChoiceHandlerPanel.cs:143)
Naninovel.UI.ChoiceHandlerPanel.AddChoiceButton (Naninovel.ChoiceState choice) (at Assets/Naninovel/Runtime/UI/ChoiceHandler/ChoiceHandlerPanel.cs:62)
Naninovel.UI.ChoiceHandlerPanel.DeserializeState (Naninovel.GameStateMap stateMap) (at Assets/Naninovel/Runtime/UI/ChoiceHandler/ChoiceHandlerPanel.cs:173)
Naninovel.UniTaskCompletionSource.Naninovel.Async.IAwaiter.GetResult () (at Assets/Naninovel/Runtime/Common/Async/UniTask/Public/UniTaskCompletionSource.cs:89)
Naninovel.UniTask.GetResult () (at Assets/Naninovel/Runtime/Common/Async/UniTask/Public/UniTask.cs:46)
Naninovel.UniTask+Awaiter.GetResult () (at Assets/Naninovel/Runtime/Common/Async/UniTask/Public/UniTask.cs:213)
Naninovel.StateManager.PerformOnGameDeserializeTasksAsync (Naninovel.GameStateMap state) (at Assets/Naninovel/Runtime/State/StateManager.cs:294)
Naninovel.UniTaskCompletionSource.Naninovel.Async.IAwaiter.GetResult () (at Assets/Naninovel/Runtime/Common/Async/UniTask/Public/UniTaskCompletionSource.cs:89)
Naninovel.UniTask.GetResult () (at Assets/Naninovel/Runtime/Common/Async/UniTask/Public/UniTask.cs:46)
Naninovel.UniTask+Awaiter.GetResult () (at Assets/Naninovel/Runtime/Common/Async/UniTask/Public/UniTask.cs:213)
Naninovel.StateManager.LoadGameAsync (System.String slotId) (at Assets/Naninovel/Runtime/State/StateManager.cs:164)
Naninovel.UniTaskCompletionSource1[T].Naninovel.Async.IAwaiter<T>.GetResult () (at Assets/Naninovel/Runtime/Common/Async/UniTask/Public/UniTaskCompletionSource.cs:237)
Naninovel.UniTask
1[T].get_Result () (at Assets/Naninovel/Runtime/Common/Async/UniTask/Public/UniTask.cs:290)
Naninovel.UniTask`1+Awaiter[T].GetResult () (at Assets/Naninovel/Runtime/Common/Async/UniTask/Public/UniTask.cs:424)
Naninovel.UI.SaveLoadMenu.HandleLoadSlotClicked (System.String slotId) (at Assets/Naninovel/Runtime/UI/SaveLoad/SaveLoadMenu.cs:153)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <00c558282d074245ab3496e2d108079b>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <e7c72e4b0bcb4085b636d7e8921f7453>:0)
UnityEngine.UnitySynchronizationContext.Exec () (at <e7c72e4b0bcb4085b636d7e8921f7453>:0)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at <e7c72e4b0bcb4085b636d7e8921f7453>:0)

idaot
Posts: 91
Joined: 01 Aug 2020 08:25

Re: Game crashed after load game after a Custom Button

Post by idaot »

Which version of Unity and Naninovel are you using?

pisanto
Posts: 2
Joined: 24 Dec 2021 23:10

Re: Game crashed after load game after a Custom Button

Post by pisanto »

idaot wrote: 25 Dec 2021 10:18

Which version of Unity and Naninovel are you using?

Unity vesion: 2021.2.4f1
Naninovel: 1.17(Latest)

idaot
Posts: 91
Joined: 01 Aug 2020 08:25

Re: Game crashed after load game after a Custom Button

Post by idaot »

Strange, normally it shouldn't crash if the asset could not be found. Feel free to send me a repro via dm on discord. The new project should suffice.

https://naninovel.com/support/#naninovel-support

Post Reply