Forum rules - please read before posting.

Check Current Journal Page in ActionList

Hi all,

Is there a way to check which journal page you are on currently?

I tried looking into the actions, but I wasn't sure if there was an option -- thank you!

Comments

  • Not directly, but a simple custom script can link this value to a Global Integer, which can then be checked with the Variable: Check Action:

    using UnityEngine;
    using AC;
    
    public class LinkPageNumber : MonoBehaviour
    {
    
        public string menuName;
        public string elementName;
        public string variableName;
    
        void Update ()
        {
            int value = (PlayerMenus.GetElementWithName (menuName, elementName) as MenuJournal).GetCurrentPageNumber ();
            GlobalVariables.GetVariable (variableName).IntegerValue = value;
        }
    
    }
    
  • @ChrisIceBox Thank you so much! Would this be attached to a gameobject in the scene or the menu prefab?

  • If you only need to access it while the menu is open, either should be fine.

  • Awesome, thank you so much!! :)

  • Is there a way to trigger a Variable: Check action each time one of the journal buttons is clicked (to navigate left and right in the journal)?

  • The Menu: Click Event can be used to run an ActionList when a given Menu / Element is clicked.

    This can be set up in the Events Editor - a new feature introduced in v1.78. You can access it via the top toolbar, and details can be found in the Manual's "Custom events" chapter.

  • Thank you so much! I'll update and check this out!

  • @ChrisIceBox I just updated AC to v1.78 -- just wondering, might you happen to have the RememberHotspot script handy in the new package?

    I am getting an error in the RememberHotspotEditor which says that showGUI does not exist, and I'm wondering if I may have accidentally deleted something -- thank you so much! :)

  • Have you imported v1.78 fully, without omitting any files for import?

    To be sure you have imported all of AC's scripts, re-download the package - and then in the Import window, uncheck all except the "AdventureCreator/Scripts" folder. That should import all of AC's scripts.

  • Ah yes! Looks like I was just missing something strangely in the RememberHotspot script -- thank you so much!

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.