How to Expose @AddChoice@

Using Naninovel C# APIs: adding custom actor implementations or commands, overriding engine services, integrating with other systems, etc.
Post Reply
RCBrickz
Posts: 4
Joined: 08 Jul 2021 16:51

How to Expose @AddChoice@

Post by RCBrickz »

Hey there Elringus, just a quick question.

I've had to make some changes to make a part of my game work, but now I'm faced with a conundrum.

I need to be able to read the "Goto" in an "AddChoice" Command, so far, here's where I'm At:

CommandScriptLine Liner = (CommandScriptLine)ChoiceButtonLines[SelectedOption];
print(((AddChoice)Liner.Command.).GotoPath);

But I get this error:

InvalidCastException: Specified cast is not valid.

I was wondering what is the correct way to cast and "what" to cast in order to get the "AddChoice"

Thanks a lot.

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

Re: How to Expose @AddChoice@

Post by Elringus »

That's a C# issue; check the official docs: https://docs.microsoft.com/en-us/dotnet ... ew=net-6.0

Post Reply