(SOLVED) Initializing Lists and Default Values

Creis

  • Posts: 102
Hello, sorry if i'm asking too many questions lately.

So far as I know, to use a list you first must initialize it by setting it to "create new list", but that seems to make it an empty list. What if I want it to have predefined values? How to avoid erasing them when initializing?

« Last Edit: August 22, 2014, 08:48:17 am by Creis »

LIBERADO

  • *
  • Posts: 2659
Predefined values? Do you want to set values ​​before initializing the list?
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

Creis

  • Posts: 102
Predefined values? Do you want to set values ​​before initializing the list?

Well yes, what else is this part for?

LIBERADO

  • *
  • Posts: 2659
Ok, but... once you have your predefined values, and if you don't want to erase them, why do you want to re-initialize the list?
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

Creis

  • Posts: 102
If I try to  get a value from those default values, it returns null. Apparently that is a common trouble, and it is necessary to "initialize" the list first by setting it to 'create new list', which, as I said, deletes the default values.

LIBERADO

  • *
  • Posts: 2659
If I try to  get a value from those default values, it returns null. Apparently that is a common trouble, and it is necessary to "initialize" the list first by setting it to 'create new list', which, as I said, deletes the default values.
After setting my predefined values, I also have that problem. Then I press the keys CONTROL+R (to reload), but the problem persists. Then, I close and reopen my game, and the problem disappears: no need to initialize the list, and I can get the predefined values. ;)

« Last Edit: August 20, 2014, 08:08:16 pm by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

rob1221

  • *
  • Posts: 9424
Default values work only for non-hidden attributes.  Setting the list to "create new list" is only needed for hidden attributes.

Creis

  • Posts: 102
Default values work only for non-hidden attributes.  Setting the list to "create new list" is only needed for hidden attributes.

After checking this and a little testing, I have determined that attributes created in the "events" tab of the scene designer (that is, outside a behaviour) are hidden by default, and since they don't have a checkbox for hidden when in events, cannot be made unhidden, causing this problem since hidden lists need to be initialized. Maybe the Stencylpedia should mention this, it doesn't mention "create new list" at all, although it appears in one of the pictures.

Thanks for your help Rob, you are always answering questions =)

sdieters

  • Posts: 2068
he didn't get the master tag for nothing hehe
My new profile is TheIndieStation.
When you see a recent post with this name, i'm probably using my phone. So dont mind any typo's =p