Forum rules - please read before posting.

Prefab Inventory Menu stays open between scenes

edited May 2016 in Technical Q&A
Up-to-date AC! Latest Unity!

Prefab Inventory system based off of the 3D demo (for now). (Same happens using built-in AC engine inventory system)

Menu turns off/on via right-mouse click.

While menu is open, clicking on interaction that invokes "Action Scene" (change scene), and when the new scene loads, the inventory is still open. 

I can see this being useful for some game styles, however for me, I'd like this menu to be closed before the scene change takes place, and adding a "Menu > Change State > Turn Off Menu" action for EVERY single interaction involving navigating to a new scene will be problematic...

Is there any way I can automatically have the menu close between scene changes? Any event hooks, or specific cutscenes (Like an OnSceneChange) that I can tie into?

Also, I don't suppose there's a way to prevent the menu from opening when another menu is open?  I tried making the Inventory system run a script when it "turns on", and just not showing the menu if another menu was open. However, the AC Menu system still believes it's open. Some way I can cancel that?

Thank you!

Comments

  • If you've changed the Menu's Appear type to e.g. Manual, then it ought to stay open until you turn it off, regardless of a scene change.  I will be adding custom events for scene changes in the next update.

    You can use the Menu: Check state Action to run a chain of Actions if a particular Menu is open, however if it's placed in the ActionList when turn on field of the Menu you want to turn off, you may have trouble.  What's the exact sequence of Actions you've tried?
  • Awesome to hear about events for scene changes!

    And as for the menu opening thing... I played around a bit, and I think I have something.

    I made an "extra" Inventory menu named OpenInventory that only reacts to the button press I want it to, then made my original Inventory menu set to open manually. The new OpenInventory has both the Turn On and Turn Off script areas set with the same script. That script first uses Menu: Check state to check if one menu is open, if so, bails. Then moves onto the other menu, checks if THAT one is open, if so, bails, then continues.

    It then checks if my Inventory Menu is open or not. If it isn't open, it opens it, if it is open, it closes it.

    Admittedly, if I have to do that for EVERY Menu/Dialog it's gonna get messy...
  • Smart.  You may find this is a good case for the use of parameters, if you're going to be needing to run similar sets of Actions multiple times.
  • Ah, I meant having to add Menu: Check state's for each menu, if I have a lot of them.  I only need one script.

    Thanks though! And have fun in Unite Europe!
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.