Forum rules - please read before posting.

PopUp Variable Set

AC is an excellent tool. Good work Chris!

I am trying to implement a popUp variable into the game.
I have created a popup variable calling it Scene[var:2] and I have 3 values in it (9,10,11)
My scene is 9 just for the test.
I tried to pass a value to the popup variable with this script:

AC.SceneInfo newSceneInfo = new AC.SceneInfo();
int currentscene = newSceneInfo.number;
Debug.Log(currentscene); //This has the correct value (9)
AC.GlobalVariables.SetPopupValue (2, currentscene);
//after this the Scene variable has its last value (11)

It seems that nothing changes when I do this.
I always get the last value of the popup variable. (In this case 11)

I can only change its value via action list Variable:Set

Am I making something wrong?
Is there an alternative way with script to give a popUp variable a value?

Basicaly I am trying to store my scene number into a popup variable to use it like switch, so it will be better for the action lists, to skip a lot of nested ifs.

Thank you in advance


  • When setting a PopUp variable's value, you do so by setting it's index number - not the "displayed" value itself.

    For your value of 9, which is the 1st entry of 3, you'd set the variable's value to 0.  Your PopUp values are all strings, even if they're just digits: "9", instead of 9.

    When you try to set the value as 9, it's unable to find a 9th entry in the array, so does nothing.

    It might be easier to just rely on an Integer variable instead.
  • Thank you Chris I just entered all the values in the PopUp variable and it worked!
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.