This should give me a result of “34”
(3 children in the array and 4 in the structure)
But it gives me a result of “14”
(1 child in the array and 4 in the structure)
I’m still undecided with the concept although I can see where it could reduce the number of variables in the other variable screens.
I think it would be nice with looping events like repeat, for each each child and for each object.
I wouldn’t want to over utilize it. There’s probably a slight decrease in efficiency with constantly adding and deleting variables but it would be good for setting up things and lighter events.
I wasn’t aware of local variable, and they’re something I could do with quite a bit.
What happens if you add a child to the structure variable? Does it return “11”? Or “15”? If the latter, then it suggests an inconsistency in application and maybe bug?
In my example. I have 2 children setup for the array. It doesn’t recognize them but it does work with children added through events. The variable exists otherwise I couldn’t add to it but unless I’m missing something it doesn’t seem to be working. They seem to have trouble with structures and arrays. It took them awhile to get things right when they simplified it the last time.
I agree. It would be nice for loops. It keeps the variable closer to the event and makes it easier to see what the values are and tweak them.
So that we don’t lose time investigating and debugging something that might not be a bug, please share a minimal project created from scratch showing the bug
Something that has a few events using a local variable with an array, pushing something/modifying the array and then displaying it on a text for example. We’ll then take a look if there is something wrong. Thanks!
My original post has a screenshot of the events and variable setup. I simply declared a local array and tried to read the number of children. I also tried getting the value of variable[0]. It gave me 0 children and 0 for the child’s value. It didn’t matter if the array was a number, string or boolean.
Afterwards, I tried adding the variable with the action. That part works but the array only contained the child that I added and not the values on the setup screen.
The same technique using a structure variable works fine.
If you want a project, I’ll try to remember the next time I’m at my PC. But it’s just like 5 events.
I know this is just 5 events, but this allows us to just open it, verify in 1 minute there is a bug and then fix it often very fast.
We’ve observed in many cases that when asked, the reporter of the issue finds that the issue is slightly different and this allows to save time for the development team (no context switching, spend time working on new features rather than trying to reproduce the bug reports)
Are there any updates on this? I just tested it with the online version. Default values do not get added to the array. You can add items to the array with actions but the initial values do not appear to be added or accessible.