Error when switching localization Language from Settings & spreadsheet issues

The engine is not working as expected? Documentation is wrong or out of date? Let us know here!
Forum rules
We are not providing support via this forum; it's community-driven. For official support see https://naninovel.com/support/#naninovel-support
Post Reply
brunovals
Posts: 3
Joined: 11 Sep 2021 10:13

Error when switching localization Language from Settings & spreadsheet issues

Post by brunovals »

Hi Everyone, i recently use Naninovel and Naninovel Spreadsheet package, but there is something strange that i encounter.
I've downloaded the demo project from naninovel spreadsheet page and used that as the base of installing and using the package.

  1. I created localization resources based on the guide on naninovel page, for test purposes i only created 'ja'. I create it under Assets/Resources/Naninovel/Localization/ja
    Image
  2. I've created an empty spreadsheet to "export" my current scripts with only 1 entry, which did great, the text is exported to my empty spreadsheet, and the column 'ja' is aoutomatically created
    Image
    ====== problem starts here
  3. I filled the 'ja' column with "HOHOHO" in the NN_001 Spreadsheet and HIHIHI and the NN_002 spreadsheet
    Image
  4. I close excel app, and tried to import the xslx spreadsheet, but encouncer an error

    Code: Select all

     Exception: Localization document for `ja` not found. Try re-generating the localization documents. 
    Image
    3.1 i've tried re-generating localization, the problem still exists
  5. Strangely the translation still applied to NN_001 in Resources/Naninovel/Localization/ja/Scripts , except the @goto NN_002 command, which is strange
    Image
    4.1 i've tried to change the translation in the spreadsheet from "HOHOHO" to "not hohoho" , and "HIHIHI" to "not hihihi", import again, but the translation still writes "HOHOHO" and "HIHIHI".
    Image
    Image
    5.Nevertheless, i tried to run the program, it runs well, and the dropdown of "japanese" is created. But when i switch to it, it yielded an error and the engine hangs , the error is as follows :

    Code: Select all

     NullReferenceException: Object reference not set to an instance of an object
    Naninovel.ResourceLoader`1+<LoadAllAsync>d__17[TResource].MoveNext () (at Assets/Naninovel/Runtime/Common/ResourceProvider/ResourceLoader.cs:156) 
    Image

I've tried many things, reimport the naninovel and the spreadsheet tools, none is working. I've tried matching the project structure to the spreadsheet-main example project from the guide site, and everything is the same.

Have anyone encounter this problem before ?
Naninovel version : 1.16 , build July 2021

Elringus
admin
Posts: 521
Joined: 11 May 2020 18:03

Re: Error when switching localization Language from Settings & spreadsheet issues

Post by Elringus »

The example project is updated for Naninovel v1.17 which is currently in pre-release; you can download it on our Discord server after registering a license. If updating to v1.17 won't help, examine the example project closely: afaik, it doesn't have this issue, so probably something is not configured correctly in your case.

brunovals
Posts: 3
Joined: 11 Sep 2021 10:13

Re: Error when switching localization Language from Settings & spreadsheet issues

Post by brunovals »

The configuration is fine, i have tried seeing it side by side with the spreadsheet-main example project for the settings and everything is identical, I'll try join in monday and give you guys the repro project, i really hope you guys could help out

Elringus
admin
Posts: 521
Joined: 11 May 2020 18:03

Re: Error when switching localization Language from Settings & spreadsheet issues

Post by Elringus »

One more thing to check is if you're using the latest version of the spreadsheet extension. You can download the one for v1.17 via #download channel on Discord. If you're going to make a repro, make sure to use Naninovel v1.17 and follow the instructions here: https://naninovel.com/support/#reproduction-project

brunovals
Posts: 3
Joined: 11 Sep 2021 10:13

Re: Error when switching localization Language from Settings & spreadsheet issues

Post by brunovals »

Ah after i did some debug, i found that the "builders" in spreadsheet compositesheet.cs only contains "ja" and "ru" , i wonder why. But then i try to log every step of the way, i found this :

Code: Select all

var directory = Path.GetDirectoryName(spreadsheetPath)

in Import() method in SpreadsheetProcessor.cs .
it makes the game iterate through the root directory of the project.

Ex : if my project in E:/Projects/naniproject and my spreadsheet contained in E:/Projects/nanisheets, eventhough the project specify spreadsheet folder location to E:/Projects/nanisheets, the project will iterate through E:/Projects , and the example project spreadsheet-main is in that folder too, which makes the project recognize it as the localization spreadsheet.

The solution is to change

Code: Select all

var directory = Path.GetDirectoryName(spreadsheetPath)

to

Code: Select all

var directory = spreadsheetPath.Replace("/","\\")

and the problem is gone and the tool work beautifully.

Elringus
admin
Posts: 521
Joined: 11 May 2020 18:03

Re: Error when switching localization Language from Settings & spreadsheet issues

Post by Elringus »

Thank you for reporting and finding the cause of the issue! I've updated the project and the package.

Post Reply