Forum rules - please read before posting.

Hotspots labels showing up with Naninovel during conversations

Hi, first message in the forum, and congratulations for such a great extension for Unity. 😊
I have been creating games for a while, but this is my first project in AC. I'm not expert in Unity but I understand the basic concepts. So I have the following problem:
1. I'm using AC with the Naninovel extension (NN). So far so good. Dialogues trigger with the NN action script but...
2. The hotspot label is visible during the Naninovel execution. The NN gives some advices about using the NN with a specific layer so it doesn't mess with AC. (https://naninovel.com/guide/adventure-creator.html#setup)
3. I followed the NN instructions but still, the Hotspot label is visible during the dialogues. I tried to replicate the issue in the demo project the NN creator uploaded, but there it seems to work fine.
4. There is an option in the NN script to "swap cameras" but I couldn't see any difference turning it on/ff.
5. My implementation is a First Person Camera. (following the AC tutorial in Youtube)

https://imgur.com/a/jbqRyFV

Any ideas about how I could fix it, please?

Comments

  • Welcome to the community, @Alatriste.

    What are your AC and Unity versions?

    In your screenshot, both the Hotspot label, and the "Menu" button in the corner, are showing - indicating that your game is in "Normal" mode. For these to become hidden, the game will need to be in "Cutscene" mode.

    You can get a definitive check about this by enabling AC's Status box from the bottom of the Settings Manager. This will detail the game's current state in the Game window at runtime.

    Any ActionList whose When running Inspector field is set to Block Gameplay will automatically place the game in "Cutscene" mode while it is running.

    If the ActionList in your screenshot is already set up like this, then it may be that the NN Action isn't "running" continuously - i.e. it'll trigger the NN dialogue but then end the ActionList in the same frame. You can test this by adding an ActionList: Comment Action to the end of the ActionList and seeing when the text you add to it appears in the Console.

    If this shows up at the same time that the NN dialogue appears, it may be an issue with the Action.

    It's NN who provide the integration with AC, but looking at their Github page it seems like the Action should wait for the NN dialogue to complete before the Action ends. I wouldn't expect "Turn OFF AC" needs to be checked, though, as blocking gameplay should be enough to prevent Hotspot interaction etc.

  • edited August 2023

    Hi Chris, thanks for your answer. I was digging last night to see if I could solve the problem and I found out that it happens when I use the Unity UI Prefab implementation rather than the AC UI implementation. (AC Editor->Hotspot->Source)

    On the other hand, I checked the debug settings and as soon as NN kicks in, the AC debug's panel disappear.

    Do you recommend me to launch the NN dialogues through cutscenes rather than Hotspots interactions? Right now that's how I was playing the dialogue.

    Also, I have noticed other issue, which is how to select the dialogues choices within NN, as my cursor is locked. I was thinking of using the PlayerConstrain (free aiming and cursor lock options disable.) Is this the way to go?

    Thanks a lot!

  • edited August 2023

    By the way, I'm using AC 1.78.0 and Unity 2022.3.2f1
    I also added the comment right after the NN action, and it's displayed right after the NN runs and goes back to AC. So AC is not running at the same time. (There is also a info message from NN reporting that "AC has been turned off" while the NN script is running.)

  • I checked the debug settings and as soon as NN kicks in, the AC debug's panel disappear.

    That'll be expected if you're opting to turn AC off in the Action - is it showing if you uncheck this option?

    Do you recommend me to launch the NN dialogues through cutscenes rather than Hotspots interactions? Right now that's how I was playing the dialogue.

    Sorry for the confusion - there's a bit of a terminology overlap here. A "Cutscene" object in AC is essentially just an ActionList in the scene that isn't tied to a particular Hotspot. "Cutscene" mode refers to the industry term - i.e. gameplay is blocked.

    Any ActionList can block gameplay and place the game in "Cutscene" mode - so running from a Hotspot Interaction should be just fine.

    I was thinking of using the PlayerConstrain (free aiming and cursor lock options disable.) Is this the way to go?

    Normally, AC will unlock the cursor automatically when the player is presented with dialogue choices. If you're using a separate system such as Naninovel, then yes - you'll need to unlock the cursor manually. The "Free-aiming" option won't have an affect here, as it only affects gameplay behaviour - or rather, it won't once the NN is correctly placing the game in "cutscene" mode.

    (A quick aside: it's not strictly necessary to place the game in "cutscene" mode to prevent Hotspot interactions etc. The Engine: Manage systems Action can also be used to disable individual AC systems, such as Interaction and Movement.)

    I also added the comment right after the NN action, and it's displayed right after the NN runs and goes back to AC. So AC is not running at the same time. (There is also a info message from NN reporting that "AC has been turned off" while the NN script is running.)

    "AC has been turned off" will appear if you have the Turn OFF AC? option checked, but this will prevent AC to go into "Cutscene" mode and wait for the Action to complete. When does the comment appear if this is unchecked?

    If it appears at the same moment, i.e. when the Action is run, then it may be an issue with Naninovel itself, as the "waiting" behaviour of the Action looks tied to a callback from Naninovel. I'd suggest contacting NN's developers if this is the case.

  • edited August 2023

    That'll be expected if you're opting to turn AC off in the Action - is it showing if you uncheck this option?

    Sorry for the confusion: When I leave uncheck the NN option "Turn off AC" then the debug AC panel is visible. Current game status: Normal. So it seems to be doing what is expected.

    Any ActionList can block gameplay and place the game in "Cutscene" mode - so running from a Hotspot Interaction should be just fine.

    Understand. Thanks for the clarification. I read it in the manual but now it's clear.

    Normally, AC will unlock the cursor automatically when the player is presented with dialogue choices. If you're using a separate system such as Naninovel, then yes - you'll need to unlock the cursor manually. The "Free-aiming" option won't have an affect here, as it only affects gameplay behaviour - or rather, it won't once the NN is correctly placing the game in "cutscene" mode.

    I found out that I have to let AC to run in the background in order to use the cursor during NN conversations. But the problem is that also the Hotspots are visible.

    I have also noticed that the comment below the NN action script triggers immediately, so AC is not waiting for NN script to finish.
    If I enable "Turn off AC" option, then I cannot recover control over the cursor and I cannot select anything in NN with the mouse.

    Not sure if this is helpful, but when I click while NN is running, I can see in the AC debug panel for just a moment "Current game state: cutscene". After the mouse button is up, then it returns to Normal.

    And I'm triggering the action using the Hotspot option.

  • A bit more info:

    This is the best execution order I found to run NN. Notice that there is a wait action before running NN actions. If I don't add it seems that AC doesn't have time to finish all its stuff and the cursor is still the AC, and Hotspots are still visible.
    With the wait, the cursor is fine and I can select the choice options.
    The comment at the end never runs though. But NN can trigger actions after returning the control to AC, so no problem there.

  • The comment at the end never runs though.

    This'll be expected - as you're turning off AC once the NN Action runs. When AC turns off, so too will the ActionList.

    I have also noticed that the comment below the NN action script triggers immediately, so AC is not waiting for NN script to finish.

    This sounds like an issue with the NN Action - technically, it's this Action that is waiting for the NN script to finish. I would recommend contacting the authors of this Action for advice.

    I found out that I have to let AC to run in the background in order to use the cursor during NN conversations. But the problem is that also the Hotspots are visible.

    You can use the Engine: Manage systems Action beforehand to disable the Interaction system first, and then re-enable it afterwards. If the NN Action is not correctly waiting for the NN script to finish, though, that will need to be addressed first - as otherwise the second Engine: Manage systems Action (set to re-enable Interaction afterwards) will run before the NN script has completed.

  • Thanks, Chris! I'll contact the NN creator to investigate the issue.

  • I'm having the exact issue, I want the AC pause menu to be visible but only want to disable the hotspots but turning off interactions sadly didn;t worked.

    Did you find any solutions ?

  • edited May 20

    Welcome to the community, @alexg558.

    Turning off the Interaction system with the Engine: Manage systems Action will prevent AC's regular Hotspot interactivity.

    Are you using Naninovel as well? The more detail you can share about your situation, the better I can understand the issue.

  • Thanks for the welcome.

    Here's my setup

    A hotspot that disable interaction then play Naninovel and then enable interaction, but the hotspot is still visible.

    Here's the naninovel custom action

    private async void RunAsync ()
    {
    if (string.IsNullOrWhiteSpace(ScriptName))
    {
    Debug.LogError("Can't run Naninovel script from AC action: script name is not specified.");
    asyncCompleted = true;
    return;
    }

            if (TurnOffAC)
                AC.KickStarter.TurnOffAC();
    
            if (!Engine.Initialized)
                await RuntimeInitializer.Initialize();
    
            if (SwapCameras)
            {
                KickStarter.mainCamera.enabled = false;
                Engine.GetService<CameraManager>().Camera.enabled = true;
            }
            var scriptPlayer = Engine.GetService<IScriptPlayer>();
            //await Engine.GetService<IScriptPlayer>().LoadAndPlay(ScriptName);
            await scriptPlayer.LoadAndPlay(ScriptName);
            scriptPlayer.Stop();
    
            asyncCompleted = true;
        } 
    

    I think its probably a Naninovel issue, that it don't wait till the script ends and skip to next action. But i don't know, still fairly new to this stuff.

  • I thinking the only way to do this is to use some sort of function like AC.KickStarter.TurnOnAC (); inside the custom action but just for disabling hotspots only.

    I asked chatgpt for such action but it didn't worked

        private async void RunAsync()
        {
            if (string.IsNullOrWhiteSpace(ScriptName))
            {
                Debug.LogError("Naninovel script name is empty.");
                asyncCompleted = true;
                return;
            }
    
            // Disable all hotspots
            allHotspots.Clear();
            foreach (Hotspot hotspot in Object.FindObjectsOfType<Hotspot>())
            {
                hotspot.gameObject.SetActive(false);
                allHotspots.Add(hotspot);
            }
    
            // Init Naninovel if needed
            if (!Engine.Initialized)
                await RuntimeInitializer.Initialize();
    
            var player = Engine.GetService<IScriptPlayer>();
    
            // Play script and wait until finished
            await player.LoadAndPlay(ScriptName);
    
            // Re-enable all hotspots
            foreach (Hotspot hotspot in allHotspots)
                if (hotspot != null) hotspot.gameObject.SetActive(true);
    
            asyncCompleted = true;
        }
    }
    

    }

  • After trying many methods the gpt has concluded it is an AC issue.

    here was the code for the custom action

    var player = Engine.GetService();

    await player.LoadAndPlay("MyScript");

    // Wait for the script to finish
    await UniTask.WaitUntil(() => !player.Playing);

    // Now it's safe to call Stop or continue with next action
    Debug.Log("Script finished!");

    Here is the explanation

    "" When you write:

    await UniTask.WaitUntil(() => !player.Playing);

    You’re telling Unity:

    “Pause this async method until the Naninovel script has finished playing.”
    

    BUT — Adventure Creator's custom actions system expects the action to finish quickly, or return control to AC via defaultPauseTime.

    If your action awaits something long-running (like waiting for Naninovel to finish), AC doesn't continue the ActionList until that finishes — which is good if you're trying to wait, but...
    ❌ Why this might "freeze" AC:

    -If Adventure Creator is disabled (via KickStarter.TurnOffAC()), the ActionList system is paused.

    -And your custom action is now awaiting !player.Playing, but Naninovel might not be progressing because AC's systems are partially disabled.

    -This causes a deadlock, where nothing progresses: Naninovel is waiting for Unity frames, and AC is paused waiting on Naninovel. ""

  • Can you share the custom Action in full? Your earlier suspicion of it not waiting until it completes is likely correct.

    If it's possible to have the custom Action wait for the duration of the Naninovel sequence, then disabling / re-enabling the Interaction system shouldn't be necessary at all - because AC will be placed in "cutscene" mode and Interactivity will be disabled by default.

  • Yes I have confirmed from my end after many testing that AC doesn't wait for Naninovel script to end, I tried to individually disable hotspot and enabliing them after, blocking the raycast but none of these work as the next action get executed immediately after NN.

    Here is the custom action
    https://paste.ofcode.org/mGHQ3s25eiYQyB3mm7HGrV

    I asked gpt to create another custom action that would wait till the naniscript is running but it put the AC in pause mode using defaultPauseTime. Which again put AC in off mode, disabling the menus and cursors along with everything.

    The code for that action - https://paste.ofcode.org/LUvL8FSBw2CyAv3FyNW2WC

    I then tried to use some of ActionSystemLock code to only disable the interaction system while the NN script is running but that too gave me two errors. Code - https://paste.ofcode.org/gB78kvpuwUbEE9kaFL4aDx

  • edited May 21

    I then tried to use some of ActionSystemLock code to only disable the interaction system while the NN script is running but that too gave me two errors.

    Disabling the Interaction system is a case of calling the SetInteractionSystem function:

    AC.KickStarter.stateHandler.SetInteractionSystem (false);
    

    I asked gpt to create another custom action that would wait till the naniscript is running but it put the AC in pause mode using defaultPauseTime. Which again put AC in off mode, disabling the menus and cursors along with everything.

    AC will go into Cutscene mode while an Action runs if the ActionList's When running field it set to Block Gameplay.

    I'd say this Action variant is the best choice. If you don't want it to enter Cutscene mode, set When running to Run In Background. Even with this option, the Action will still wait until the script has finished, so you can add Engine: Manage systems Actions before/after this Action if you want to disable Interactivity during this time.

  • Oh it worked, haha. Thank you so much Chris.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.