Forum rules - please read before posting.

actionlist that can hold multiple variables

I have a puzzle game that you have to unlock drawers to obtain a item, to that the player needs to figure out the written password.
So each drawers (20) has:
a hotspot
one interaction to open a menu and to freeze the players movement
one menu with a input and button
one actionlist to run the password
one container to put the item

In each actionlist a variable is selected to be the password

My question is, is there a way to make a actionlist that can hold all the passwords and just select the right one based on the hotspot that was selected? Or should I make a menu for each?

Comments

  • I don't follow what you mean by "running" the password, but you should re-use ActionLists and menus when possible.

    For example, you can use a variable token to update a single Menu's label, rather than duplicating the same Menu and manually changing each one's label.

    For details on tokens, see the Manual's "Text tokens" chapter.

    For ActionLists, you can make use of parameters to modify its Action field values each time its run - allowing you to recycle them for commonly-run logic.

    A tutorial on ActionList parameters can be found here. If you can explain more on how specifically you're looking to use variables, I can try to offer more specific advice.

  • this is the actionlist for the password:

    I want to use this actionlist, menu and input in all my drawers, but I didn't want to make 20 menus.
    I read the parameters tutorial but I am not sure how to do it with menus instead of objects.

  • Your password menu can be independent from the password associated with the drawer - using a single Menu as you have in the screenshot looks like the right way to go.

    The main thing to do here is parameterise the password and Container. Create a String parameter named "Password", and then use it to override the String field in the Variable: Check Action. Then create a GameObject parameter named "Container", and use it to override the Container field in the Container: Open Action.

    When you call this ActionList using ActionList: Run, you can then set these parameter values to suit the drawer in question.

  • All right! It worked! Thank you.

    to anyone who might be interested that's how it went:

    adventurecreator.org/forum/discussion/11396/how-to-make-a-password-to-open-a-container-chest#latest

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.