Forum rules - please read before posting.

Actionlists, parameters and local variables

Hi there, just a quick question regarding combining the above. I want to put the actions related to opening/closing a drawer within an action list and using parameters so I can reuse the action list on any drawer.

Currently, I have an actionlist in the scene which tracks whether a drawer is open or shut via a local bool variable and changing its movement (close or open) when the player interacts with it based on this variable.

Is this possible to integrate into an actionlist using parameters? If not, is there another way I can set up an actionlist that will support this functionality?

Thanks very much (again)!

Comments

  • There are a couple of ways:
    1. You can indeed use parameters for this, though you'd still have to create a Local Variable for each Hotspot.  Your ActionList would then have a Local Variable parameter, which is set by the ActionList: Run Action when calling this list.
    2. You could probably also do this by enabling/disabling Hotspot interactions. Have e.g. two "Use" interactions on a Hotspot (one opens, one shuts), and enable/disable them as needed using a combination of the Hotspot: Check interaction enabled and Hotspot: Change interaction Actions.

    This second method would be easier because you wouldn't need to do any extra work (e.g. create a variable) per Hotspot.  The only caveat would be that the Hotspots would need to have the same order of interactions (e.g the first always being open, second being shut).  If your Interaction method is set to Context Sensitive, you'd only need to enable/disable the first interaction - the second would only be active if the first isn't.  I would recommend trying this on one Hotspot before parameterising it.

  • Perfect - I used the second method and no need to track variables. Thanks
  • I see that you already have a solution, but if you want to simplify it even further, using parameters, create an action to check the track position of the drawer: if it's greater than halfway open, close it; if it's less than halfway open, then open it.

    This also lets players interact with the drawer while it's opening/closing, which allows for better-flowing interactions (should you so wish - you can of course negate this effect with a wait action).
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.