Stencyl 3.4.0 is now out. Get it now!

is there a way to get a list by name?

designpeg

  • *
  • Posts: 535
I really need a way to define a list attribute by its name with a tex block, anyone have an idea how?

I want to use the "for each item in LIST" block, but want to increment the name of the list in a loop eg. list 1 list 2.

Luyren

  • *
  • Posts: 1371
This is the best I could come up with, based on your description and what it seems you want to do.
Working.

Rimrook

  • *
  • Posts: 241
I guess you could have a list of all of the list names, then use the 'for each item in list' with another for another 'for each item in list' with the 'item' from the previous as the name of the list to retrieve from in the second. That way you could cycle through a list of lists and the items in succession.

Another way is the 'repeat X times' and append the current loop count number as text to the end of a name using the 'text & text' block. For example 'Banana & [current loop count]' would get you 'Banana1' then 'Banana2' and so on until the repeat finishes.

designpeg

  • *
  • Posts: 535
great, Luyren suggestion was what I was looking for.