Where to save the script during manual initialization

Using Naninovel C# APIs: adding custom actor implementations or commands, overriding engine services, integrating with other systems, etc.
Post Reply
JohnDoe
Posts: 6
Joined: 03 Jan 2022 17:12

Where to save the script during manual initialization

Post by JohnDoe »

If I want to manually initialize and open NaniScript from within a C# script, where should I store NaniScript in the folder?

When the Initializetion Script is on, it is recognized that it is sufficient to set the corresponding Script in the Start Game Script item.
However, when I initialize the game manually, there is a command to select the Script to load, but I don't know where to set the Script.

I use the following command.

Code: Select all

await player.PreloadAndPlayAsync("StartScript");

In that case, I get the following error

Code: Select all

Exception: Failed to load `StartScript` script: The resource is not available.

I'm sorry for the newbie question, but I would appreciate it if you could tell me.

JohnDoe
Posts: 6
Joined: 03 Jan 2022 17:12

Re: Where to save the script during manual initialization

Post by JohnDoe »

I solved it myself.

It seems that the problem was that the NaniScript in question was copied from an external source and brought here.
I created a new Script with the same name in the project, and it worked fine.

By the way, is there any way to recognize the NaniScript copied from outside?

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

Re: Where to save the script during manual initialization

Post by Elringus »

JohnDoe
Posts: 6
Joined: 03 Jan 2022 17:12

Re: Where to save the script during manual initialization

Post by JohnDoe »

Thank you, that was very helpful.

Post Reply