How to call a custom function into naninovel

Using Naninovel C# APIs: adding custom actor implementations or commands, overriding engine services, integrating with other systems, etc.
Post Reply
sourdough
Posts: 1
Joined: 18 Feb 2023 13:42

How to call a custom function into naninovel

Post by sourdough »

Help

I created a custom function to add dashes after every letter of the player's name minus the last one.

Code: Select all

using UnityEngine;
using System.Collections;
using JetBrains.Annotations;


public static class DashName
{
    public static string DashedName(string name)
    {   
        string nameWithDashes = "";
        char[] charArray = name.ToCharArray();
        for (int i = 0; i < charArray.Length; i++)
        {
            if (i < (charArray.Length - 1))
            {
                nameWithDashes = nameWithDashes + charArray[i] + "-";
            }
            else
            {
                nameWithDashes = nameWithDashes + charArray[i];
            }
        }
        return nameWithDashes;
    }
}

I'm trying to call it in naninovel and it won't let me.

Code: Select all

@set dashedName={DashName.DashedName(MCName)}
I took the quill and proceeded to write my name. I placed it below both of theirs, sounding it out as I wrote. { dashedName }

The error says that in DashName.DashedName the . is an unexpected character.

I've been sitting here for hours trying to figure out how to fix this please help

Post Reply