0 (zero) in the first cell of an array doesn't initialise
-
@Deeeds this array works normally for me. I can get the array value at index 0 and it returns 0. In json form the array shows as ["0"]; it's treating the 0 as a string,
Here's a screenshot:
The text input returns the get array value output and the json form of the array.
-
@Jack8680 Same exact thing, I get
<null>
-
@Jack8680 I've found a solution to part of this, that I only casually observed in the first part of this post, setting that first indexed item to something other than 0, and then back to zero.
Having done that, it's found and initialised the array and I can use 0 in that location.
But the first time, each time, 0 isn't working.
I've also found that the first time I attempt to access an array with a new Get Value from Array behaviour, I need to restart hyperPad before it will work at all. Before the restart it's as though it cannot find the array.
It could simply be that constantly overwhelming the cocos2D drawing of hyperPad behaviours causes all sorts of interesting issues with everything in hyperPad, but I'm only noticing it within arrays because that's what I'm using most of the time, for most everything.
Force quitting and then restarting hyperPad has become my new normal.
When that's no longer beneficial and performance really degrades, I hard restart the iPad and get a solid boost back to 60fps.
-
This is working fine for me as well. Could it be that you're not actually setting it back to zero?
-
@Hamed In the first screen shot I've shown in this thread, I'm manually creating the array, and manually creating a cell, then entering zero in the first cell.
The first time I try to access this array, in any way, it's returning null.
On some attempts to access existing and populated arrays, I'm also getting null returns.
The only fix, for me, is to restart hyperPad, then the exact same code, untouched, begins to operate correctly.
This is much the same as the thread on negative numbers not working in an array. These are issues that seem to be happening as a result of the extended durations of my usage of hyperPad. I am often working in it for a few hours at a time, fiddling with graphics and physics settings, adding new functionality and game features, and then figuring out something I want to do with an array, at which point these things happen that are very weird.
-
@Deeeds so doing the following returns <null> in your text input?
-
@Jack8680 Not in a new project, and not in a new work session.
But after a while, yes.
And... all other newly created access to ALL pre-existing arrays will also return null, once that problem starts occurring.
And all sorts of other issues rear up and become a nightmare of uncertainty, too.
There is a cumulative degradation in the way hyperPad operates, this is one of those.
The first time I saw this was the weirdness in the report regarding negative numbers in arrays.
As previously noted, restarting hyperPad, and the iPad, clears this up, and many other undesired or otherwise wrong activity.
As also previously noted, I'm mostly noticing these degradations and gibberish in Arrays, but have also seen it with conditionals.
-
@Deeeds it's weird that you're getting all these bugs; I don't think I've ever had a bug in a game that was fixed by restarting hyperPad, other than visual bugs in the editor. Is your device jailbroken?
-
@Jack8680 No, not jailbroken.
But my project is large. Build times are anywhere from 10 seconds to 20 seconds, which is much longer than it was...
I've just pruned it... gotten rid of all of the iterative "scenes", and still having problems.
-
You should try reinstalling, in a.l honesty.