Forum rules - please read before posting.

creating a tutorial popup screen

Hi guys,

my game starts with a little timeline animated cutscene and at the end of it I would like it to show a popup box saying something like "Touch the screen to see all interactable hotspots". Then, only when the player touches the screen (and the hotspots flash) I would like the tutorial popup to close again. I'm unsure what would be the best way to do that in combination with adventure creator, because I can see how I can for example use a signal emitter to start a conversation at the end of the cutscene but I don't see how I can make a UI Canvas / Popup appear exactly at the end of the cutscene.

If there was something like that described in the tutorial videos/manual I'm happy to just be linked to that aswell.

Thanks for any hint or help!

Comments

  • You can place the text inside a Menu, and use the Menu: Change state Action to show the Menu.

    If you want the tutorial text to be dynamic (so that the same Menu can be used for different tutorial messages), store the text in either a String or PopUp Global Variable, and then have your Menu display the variable instead.

    To run the ActionList that show the Menu, you can either create a signal that invokes its "Interact" function, or just add the Action after your Engine: Control Timeline Action, being sure to check Wait until finish? in the latter.

  • edited March 2023

    Hey Chris thank you for your answer,

    I managed to get the menu to come up but I'm unable to get it to close again. I want it to close once the player taps the screen (touchscreen) but I somehow can't find an Input. I was thinking to do it as seen in the screenshot, am I doing something wrong?

    In fact, I would like to menu to close once the payer taps the screen for about 0.8 seconds

    https://ibb.co/m9fHk6L

  • You should be able to use a QTE for this, but the one in your screenshot will only last for 0.5 seconds before ending - so that's the length of time that the player has to tap the screen to "win".

    The next AC release will provide the option for QTEs to run indefinitely. In the meantime, set the Duration field to something very large to have it just wait for the player to tap.

    If you want the player to hold their finger on the screen, set the QTE type to Hold Key, and then Hold duration (s) to 0.8.

  • Hey it's working! There is just one little problem.
    I want the tutorial window to say something like "Tap the screen to flash hotspots". Then I want the player to tap the screen, the Tutorial menu closes and the hotspots flash. The problem is though, that when the tutorial menu pops up and the player taps the screen, the tutorial window closes but the hotspots don't flash. Only when the player now taps again, after the menu is closed, the hotspots flash. Is there a way to make it both work? That the moment when the player taps the screen the tutorial disappears AND the hotspots flash?

  • Ah, sounds about right. The input from a QTE will override regular input.

    One way to get around this would be to have AC simulate the pressing of the FlashHotspots input button, which you can do with the following code line:

    AC. KickStarter.playerInput.SimulateInputButton ("FlashHotspots");
    

    You can call this by creating a new C# script, and placing it in a function inside, i.e.:

    public void ForceFlashHotspots ()
    {
        KickStarter.playerInput.SimulateInputButton ("FlashHotspots");
    }
    

    Attach the script to an empty GameObject, make that GameObject a prefab, and remove from the scene. Then, after the QTE is over use the Object: Call event Action to reference that prefab and invoke its ForceFlashHotspots function.

  • Thank you for your answer! Unfortunately I must be doing something wrong.

    Just to try if the script and object combination would actually make the hotspots flash I have added the gameobject and attached this script:

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using AC;
    
    public class ForceFlashHold : MonoBehaviour
    {
        public void ForceFlashHotspots()
        {
            KickStarter.playerInput.SimulateInputButton("FlashHold");
        }
    }
    

    My Input button is defined as FlashHold, see this image
    https://ibb.co/C9kJFmf

    Still, when I start the game now I would think that the Hotspots would flash constantly but nothing happens.

    Also it seems that VisualStudio is not recognizing the AC commands as it is not coloring them.

    What am I doing wrong?

  • "FlashHold" isn't an AC-recognised input. If you want Hotspots to be flashed by holding an input, you can rely on a custom script to read that input separately. Such a script can be found on the AC wiki here:
    https://adventure-creator.fandom.com/wiki/Hold_input_to_flash_Hotspots

    Because the ForceFlashHotspots function "fakes" an input by simulating it, you need to trigger it externally using the Action I mentioned. It's unaffected by what's defined in your Input Manager.

    Try my earlier comment about placing on a prefab, and using the Object: Call event Action to trigger the function.

  • edited April 2023

    Ah okay I see!

    And how do I invoke the action properly?
    I created the prefab and added the script. Then I removed it from the game. After the QTE I sequenced in the ActionList editor the "Menu Change state Turn Off Menu" and then use the "Object: Call event" to trigger the function.. but nothing happens:

    https://ibb.co/vc8qpDg

    I tried:

    bool enabled
    and
    ForceFlashHotspots ()

    the script I use is this

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using AC;
    
    public class ForceFlashHold : MonoBehaviour
    {
        public void ForceFlashHotspots()
        {
            KickStarter.playerInput.SimulateInputButton("FlashHotspots");
        }
    }
    
  • You'll need to keep it set to "ForceFlashHotspots ()".

    For the input to work, the game will need to be in "gameplay" mode (i.e. outside of a cutscene). If you're calling the function from a gameplay-blocking ActionList, replace the contents of the ForceFlashHotspots function with the following:

    foreach (Hotspot hotspot in KickStarter.stateHandler.Hotspots)
    {
        if (hotspot.highlight)
        {
            if (hotspot.IsOn () && hotspot.PlayerIsWithinBoundary () && hotspot != KickStarter.playerInteraction.GetActiveHotspot ())
            {
                hotspot.Flash ();
            }
        }
    }
    
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.