(Solved)How do i look into specific variables in Array Variable?

Again where you made mistake i have no idea
I would assume you have some other event that is adding 1 to it
Cause as you see it works

my array looks like this
image
could that be the problem
because there is no other event to add 1

You have no child vars in your array?
Why you crop screenshot?

No i don’t have any child variable in array
i save using the method shown on gdevelop youtube

i didn’t crop lol i thought it would be easier to navigate

Your array 1st need to have child vars for it to view them

i see
hmm
well thank you so much for all the help.
i learned a lot

Look
Gdevelop does not allow NULL values
Which means like empty

You cannot set text variable to empty text in variable window
However you can set it via events to “” which will return nothing
But value of that var will be “” which translates to nothing
Same as Player.X() does not = in text Player.X() but some number

NOW
Imagine you have array
With two child so 1st is at index 0 and 2nd is at index 2

But you changed text to
MyArray[0]+"
“MyArray[1]+”
"MyArray[2]

Remember you have only TWO child variables
YET you are trying to display 3rd child variable which DOES NOT EXIST
And gdevelop does not allow you to have it like placeholder
So it displays nothing but will display something when that child var will be created
NAH
Instead what gdevelop will do it creates that variable with NULL value or 0 depending if its text or number var

And so when you try to mod(variable) which does not exist
Or add 1 to some number var to browse trough array which have no child vars
You are creating empty variables ONE BY ONE
And that is what you get

If you want to check what your array have
If we are talking about that save/load stuff
You should 1st perform a save and then enable event which change text of text object to display array child

So to this event add condition like
Right mouse button is held
image

And now only press right mouse button AFTER you 1st perform save or when array is populated with child vars

1 Like