Array text to Text Object

I have an array of texts.
A shopping list.

I have a text object called guest01.

I have a helper numeric variable that takes a random value from 0 up to the size of my array.

I need to put the child text of the array in the text of the guest01 object.

I’m not able to do that because the program only gives me the option to fill the last child with the first child. When I choose a number, it gives me the number of the child’s position in the array and not the string I need.

Help!

Can you post a screenshot of your events?

You get the value in an array by using the variableName[number]

List[VariableName]
List[12]

You can use a number, variable or any expression that returns a number.

Note: arrays start at 0. If you choose a random item you need to use the count minus 1.

Here I define that helper = random in the range of my array size = 0 to 14
Then I try to show in the guest01 object the text that is in the List[VariabelAuxiliar] - failed.

Remembering that these events are inside a loop that only executes once.

image
I did it.
But I had to edit the final entry as it wouldn’t let me do it like through the event menus.

Thank you and happy gaming.

1 Like