[Solved] Variables undefined? Answer: Max 7 Digits deep Variable Structures

undefined

here is how i set the variable:

the action, that sets the name:
change the text of global variable
safe.decks[GlobalVariableString(safe.decks.sel)].sp[Cards.VariableString(School)][Cards.VariableString(Type)][VariableString(deckcheck)].na
set to Cards.VariableString(ID)
the ID´s of the cards is a string (starts with C followed by numbers.

The variable is working (somewhat), i can read it, and the correct card is created, but they behave not like i want to, when i loop thru the children, when i check if a card already is in the deck. it basicly creates 18 childrens, when there is supposed to be 1.

the confusting thing is, i do exactly the same with my creature cards, and that works perfectly. but my spells create undefined values as variables, and i cannot figure out why.

the only difference i see is, that the creature variable structure consists of strings
(safe.decks.1.cre.m.1.na)
and the spell structure has numbers, that i also use as numbers.
(safe.decks.1.sp.1.1.1.na)

Unfortunately, it seems you’ve hit the limit of nesting levels.
Remove ‘safe.decks’ and it should work better.

1 Like

thanks Gruk, that was the issue.
i removed one of the filter options and kept safe.decks for the sake of easy storage, and now it works.

@arthuro555 this can be interresting for your arrays and convert to structure PR!

1 Like

Huh, that’s weird, I don’t remember seeing any sort of nesting limit in the code if gdevelop