Forum rules - please read before posting.

New Item Menu Overlay

Hello,

I have followed the steps on http://adventurecreator.org/tutorials/creating-you-have-found-item-window and it works great! However I have found that the items will trigger the new item window when i view them and put back in the inventory.
What I was wondering was if there was a way to only trigger this on the First TIME the item is picked up.
I have found that I can do this by setting a variable for EACH item, however it defeats the purpose of having this global event as id have to add for each item.

I thought about adding a Property to each item and labeling it wasFound. However I am not able to change a property value via the ActionList editor.

Any help is much appreciated if anyone has had success with setting something up for this.

Comments

  • Hello! I have this same question. Is there a simple way to prevent an "add new item" box from popping up again once it's initially grabbed from a scene? If I use the item somewhere (ex: a flashlight that is used in multiple scenes), I don't want the pop-up for a new item to appear when it simply gets "put away."

    Thanks for any help!

  • @ghost I completely missed this post. I apologise for the delayed reply. Welcome to the community!

    Yes, a Property should do it. You can change its value by using a Global Boolean variable, and transferring its value over to it.

    Create a new Bool variable named e.g. UsedItem, set it to True, and create a matching Property in the Inventory Manager set to False.

    Then, in your OnInventoryAdd ActionList asset, use the Inventory: Property to variable Action's "Variable To Property" method to set the Property value from the Variable.

    @takealltheadventures Are you removing and re-adding an Item in this situation, or simply selecting/de-selecting? The tutorial relies on the OnInventoryAdd event, which should only fire when adding an item to the Inventory.

  • @ChrisIceBox thanks for the response! I tried what you recommended but for some reason the Variable to Property is not setting the Property value. I wanted to check to see if it was running at all so i flipped from Property to Variable and it seems that this does update the variable value but not vice-versa.
    Any thoughts?

    Additionally how would I do a check on the items Property Value in action list to determine if the new item overlay should be triggered? I am not seeing a Property Check in any of the available options for the action list.

    Thanks again!

  • I tried what you recommended but for some reason the Variable to Property is not setting the Property value.

    Do you have just one instance of each item present in your Inventory, do you get any relevant messages appearing in the Console, and can you share screenshots of the Item, the Variable, and the Action?

    Additionally how would I do a check on the items Property Value in action list to determine if the new item overlay should be triggered?

    You can't check them through Actions directly, but you can check the value of the Variable if you convert the Property to it at the beginning of your ActionList.

  • @ChrisIceBox Hi, to answer your first question, yes, we only have one instance of each item.To answer your second question, I do not see any errors in console, i added a comment to see if the action is running and it looks like it is(see screenshot).

    I am not fully understanding your second answer. How would checking the Variable value help in this case to make the check? Wouldnt this always be set to true?

    I've attached screenshots as requested, but please let me know if you need anything else. Thanks again for your help!

    Screenshots: https://drive.google.com/drive/folders/1rkfsdeMDcWkfipyThCLW35ReudmLNTDA?usp=sharing

  • I am not fully understanding your second answer. How would checking the Variable value help in this case to make the check? Wouldnt this always be set to true?

    What I'm suggesting is to use a Global variable as an interim for getting/setting each Item's wasFound property.

    You can't set an Item's property value directly, but you can transfer it to/from a variable which can be set.

    So essentially, when an item is taken:

    • Use "Inventory: Property to variable" to transfer the Item's wasFound property to the Global variable
    • Use "Variable: Check" to check if this variable's value. If True, the Item has been taken already, so end the ActionList here.
    • If False, use the "Variable: Set" Action to set the variable to True, and use another "Inventory: Property to variable" to pass the updated value back to the Item
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.