Forum rules - please read before posting.
Tech questions during the weekend? Drop in on the community Discord channel!

Pop up variables - what are they?

Hi all!

I was wondering if someone can point me in the right direction. I'm trying to understand what pop up variables are and how / where to use them, but it's not clear to me with the info available in the manual and the forums. Is this kind of variable used in any of the tutorials? It would be great to see an example.

Thanks in advance.

Comments

  • edited May 15

    You can think of PopUp variables like a string array or enum - basically, a set of pre-defined strings, e.g.:

    "Green", "Red", "Blue".

    When setting/checking a Popup's value, you're actually dealing with their "index", i.e. which of the pre-set values it currently references. For example:

    Green = 0
    Red = 1
    Blue = 2

    They can be useful if you want a variable's value to be text-based, but don't want to have issues trying to get the name exactly correct when checking them, or be able to accidentally set them to anything.

    They can be used in many situations - even in something as simple as a door, with values "Open", "Closed" or "Locked".

    Something particularly nice about them is that - because the values they can take are pre-determined, you can use the Variable: Popup switch Action to handle all possible outcomes in a single Action.

    It's also possible to define "Popup presets", so that you can have multiple PopUp variables share the same set of values. For example, you could have several doors in your game that all use the same Popup values above using a preset.

  • Wow that was quick! Thank you Chris, I understand now. Very useful!

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.
Do NOT follow this link or you will be banned from the site!