There are a number of problems there.
First of all, you wrote
Code: Select all
while(sl) do (...)
wait for dissolve (sl)
Notice that the while loop exits if sl is equal to 0, which gives you the error. If it hit the "break" it wouldn't trigger the error, but it would just be easier to write "wait (80)" there.
And in fact, it can't hit the break, because you wrote "last child (currentroom)" when you meant to write "last child (first child (currentroom))".
Actually, you should not write "if (sl == last child(...)) then (break)". The while loop would stop after the last child, which causes "next sibling" to return false.
The next problem is that if there is even a single child slice that isn't a sprite, then the "sl := next sibling(sl)" line is never reached, and the script enters an infinite loop. If it enters an infinite loop, then waiting for a couple seconds and pressing a key will cause a message to come up.
Finally, you're setting the "automatic" argument to "dissolve sprite" to false, meaning it won't actually animate, it'll just be frozen in place completely non-dissolved.
Here's a fixed script
Code: Select all
script, screen fade out, begin
variable (sl)
hourglass (on)
sl := first child (first child(currentroom)) #The only child of each slice collection is a container that holds the
while(sl) do ( #backdrop and sprites, I'm trying to get the first child of that container
if (slice is sprite(sl)) then (
dissolve sprite (sl, dissolve:random scatter, 80)
)
sl := next sibling(sl)
)
wait (80)
end