Page 1 of 1

Save a project where class has no instances and class not visible on re-open [FIXED?]

Posted: Jul 31st, '16, 04:57
by MrSteve
To recreate this:
1) Create a new project
2) Delete the instance of MyClass
3) Save project
4) Try and re-open project

Re: Save a project where class has no instances and class not visible on re-open

Posted: Aug 1st, '16, 14:36
by JohnM
This bug appears to be fixed in v54. Is it?

Re: Save a project where class has no instances and class not visible on re-open [FIXED?]

Posted: Aug 1st, '16, 16:56
by MrSteve
Almost Fixed. So now if I save a project where there are no instances for a class, when I re-open the project the Class name does appear in the list.
But there exists one instance of the class. This is much better behavior, but one would expect if I save with no instances it would open with no instances instead of one. The main problem with opening with one instance, is the costume for that instance will appear on the screen.

Re: Save a project where class has no instances and class not visible on re-open [FIXED?]

Posted: Aug 8th, '16, 00:46
by JohnM
What you're seeing is actually the intended behavior.

The idea is that if you want to try blocks in the palette, as you can do in Scratch, you need an instance to operate on. Thus, when you select a class that has no instances, GP creates one for you. This happens when you open a project and the selected class had no instances when the project was saved. It also happens if you select a class that currently has no instances -- GP makes one for you. Likewise, the clear button doesn't remove all instances, it removes all but one.

Obviously having instances automatically created can get annoying if you don't want them, but there may be a tradeoff here between the needs of the beginner, who may benefit from always having a concrete instance to operate on, and the the more advanced user.

For now, I suggest adding a little script to clear the stage when that's what you want:
ClearStage.png