Showing @goto command in console

Using Naninovel C# APIs: adding custom actor implementations or commands, overriding engine services, integrating with other systems, etc.
Post Reply
juan.delcastillo
Posts: 30
Joined: 02 Feb 2021 19:11

Showing @goto command in console

Post by juan.delcastillo »

I'm coverting Nani commands to strings via ToString() and printing them in console. I've noticed that some of this commands are not converted or do not show in console. In my case, I tried to convert @goto and it showed nothing. I want to use ToString() as an if condition. Is there something I'm missing?

juan.delcastillo
Posts: 30
Joined: 02 Feb 2021 19:11

Re: Showing @goto command in console

Post by juan.delcastillo »

I thought I could use the alias instead of the class

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

Re: Showing @goto command in console

Post by Elringus »

Using a tostring of a type in conditionals is not a good idea. Consider using type checking instead: https://docs.microsoft.com/en-us/dotnet ... g-and-cast

juan.delcastillo
Posts: 30
Joined: 02 Feb 2021 19:11

Re: Showing @goto command in console

Post by juan.delcastillo »

Elringus wrote: 08 Feb 2021 19:37

Using a tostring of a type in conditionals is not a good idea. Consider using type checking instead: https://docs.microsoft.com/en-us/dotnet ... g-and-cast

I did but it doesn't work, @goto is never read by IScriptPlayer.PlayedCommand, for some reason

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

Re: Showing @goto command in console

Post by Elringus »

I guess you're looking to check which command is being executed? In this case, use OnCommand event in the player service.

Post Reply