Discuss Scratch

DadOfMrLog
Scratcher
1000+ posts

Mystery of the vanishing "repeat until" loop...

I've just noticed that a chunk of script in my most recent 3d demo project has vanished - to be replaced by a red “undefined” block:

http://scratch.mit.edu/projects/11397100/

I can easily fix it, but will leave it for now so it can be examined… take a look at the “Render dust from () to ()” custom block script in the “Dust” sprite.
And compare it to the previous version of the project (which doesn't use the experimental 3d render-ordering method):

http://scratch.mit.edu/projects/10143939/

It's the whole “repeat until” loop that's been replaced by “undefined”.
Something's got corrupted somewhere along the line…

Just wondering if anyone on ST can see what might have happened to it, in case it could be something that could cause trouble for others at some point? (And before I fix it…)

(Actually, I'll have a poke around the json, too…)
DadOfMrLog
Scratcher
1000+ posts

Mystery of the vanishing "repeat until" loop...

The json has this for “Render dust from…” block, with the obvious flaw at the "[0]]]" near the bottom where I've indicated:

[19,
467.85,
[[“procDef”, “Render dust from %n to %n”, [“start”, “end”], [1, 1], true],
[“setVar:to:”, “tmp count”, [“*”, 4, [“getParam”, “end”, “r”]]],
[“doIf”,
[“>”, [“readVariable”, “tmp count”], [“lineCountOfList:”, “Dust particles”]],
[[“setVar:to:”, “tmp count”, [“lineCountOfList:”, “Dust particles”]]]],
[“setVar:to:”, “star list pos”, [“-”, [“*”, 4, [“getParam”, “start”, “r”]], 3]],
[“putPenUp”],
[“penSize:”, 1.5],
[“setVar:to:”,
“FwX”,
[“+”,
[“readVariable”, “Original X axis: rotated Z”],
[“+”,
[“*”, [“readVariable”, “Original X axis: rotated X”], [“*”, [“readVariable”, “Camera Horizrot Speed”], 0.03]],
[“*”, [“readVariable”, “Original X axis: rotated Y”], [“*”, [“readVariable”, “Camera Vertrot Speed”], 0.03]]]]],
[“setVar:to:”,
“FwY”,
[“+”,
[“readVariable”, “Original Y axis: rotated Z”],
[“+”,
[“*”, [“readVariable”, “Original Y axis: rotated X”], [“*”, [“readVariable”, “Camera Horizrot Speed”], 0.03]],
[“*”, [“readVariable”, “Original Y axis: rotated Y”], [“*”, [“readVariable”, “Camera Vertrot Speed”], 0.03]]]]],
[“setVar:to:”,
“FwZ”,
[“+”,
[“readVariable”, “Original Z axis: rotated Z”],
[“+”,
[“*”, [“readVariable”, “Original Z axis: rotated X”], [“*”, [“readVariable”, “Camera Horizrot Speed”], 0.03]],
[“*”, [“readVariable”, “Original Z axis: rotated Y”], [“*”, [“readVariable”, “Camera Vertrot Speed”], 0.03]]]]],
[“0”]]], <—– SOMETHING WENT WRONG HERE!!
[448, 1611.85, [[“stampCostume”]]],
[577, 977.85, [[“setPenShadeTo:”, [“\/”, [“readVariable”, “tmpx”], 3]]]],


(Arrrggghhh - that BBCode!)

Last edited by DadOfMrLog (July 17, 2013 13:20:02)

Listwizard
Scratcher
66 posts

Mystery of the vanishing "repeat until" loop...

I noticed a chunk of my script missing in one of my projects before. Luckily, I had a modified version on the same sprite, so I could functionally recover it. It will always haunt me that I will never know if I restored it to the same way it was before that chunk was deleted…
angrybird232
Scratcher
100+ posts

Mystery of the vanishing "repeat until" loop...

I have an undefined block. I found out that they are bad requests of blocks without a difine that destroys scratch! my block(Look in button 3)
DadOfMrLog
Scratcher
1000+ posts

Mystery of the vanishing "repeat until" loop...

This topic is old now, so I'll close it (though it technically has not been resolved…)

Yes, an undefined custom block can cause a red undefined block. But, no, that's not what this is (note that I said it's a whole repeat loop that was missing, as well as noting the corrupted line in the json above, which doesn't happen for undefined custom blocks).

For more info about it, read here.

Quick summary: it's a corruption in loading the project which happens when Flash is struggling on an old slow machine. Most people with relatively modern machines (<5 yrs old, say) are not likely to see it. It only ever happened to me (numerous times) on my old Mac Mini, but would more often result in a total Flash crash.

Powered by DjangoBB