[RESOLVED] Displaying array

Hi, I try my best to show a list of numbers at screen but… I fail every time.
I can show multiples variables at same time on a single text object, but not an array…

I made some tests but let me show you.
in the sample below ; the first text object works perfecly (so my floor.Variable(ID) is an integer and that’s ok)
The DEV2text object only shows “0” at screen, even if I’m supposed to have 1 to 20 numbers in my list… I tried to “insert” the number with array extension, doesn’t work. I tried to manually show Path[0], path[1]… it only show 0 for each index. (remember the first text object shows correctly the ID).
I even tried to write “VariableString(Path)” but it shows me “[array]”… -_- Help

EDIT : If I write “ToString(VariableChildCount(Path))” im my DEV2text object I can see I have many child objects (as long as I stay on the floor instance with my cursor it increases every frame)

if it’s only for you, developer, to see the variables, you could Change the text of ‘textobject’ to ToJSon(yourarrayname). It will make the array structure a string
This is the easiest, but it won’t be necessarily pleasant to read.

Another way would be to use the event For Each Child Variable (of a structure or array). It will allow you to repeat a code for each child of an array. So For each child of your array, you can Change the text of ‘textobject’: add VariableString(childname)

1 Like

It works perfectly and I can display it as I want !

1 Like