This site requires JavaScript, please enable it in your browser!
Greenfoot back
greenHead
greenHead wrote ...

2014/2/28

issues with "save as"

greenHead greenHead

2014/2/28

#
Hi Everyone, I am just curious if anyone else has problems saving the changes in a different scenario file. Say I have scenario file S1, I move objects around, click Save As "S1V2". Then the file gets created, the scenario appears empty with the compilation required indication (the lines). After compile, S1V2 looks like S1, prior to the position changes. Any ideas? Thanks!
danpost danpost

2014/2/28

#
When you 'Save as', you are making a copy of the currently active scenario and making it active. Do the 'Save as' first, them make the changes. Only the active scenario will acquire those changes (Greenfoot updates the files of the currently active scenario as the changes are being made, so you do not have to tell it to 'Save').
greenHead greenHead

2014/3/2

#
Thanks for the reply. I think I also just have general issues with saving changes. If I create a new scenario and add classes, save the changes, then when I reopen the file those changes are still there. However, if I instantiate the classes and place say two objects from the class in the world window, and try to save the scenario like that (no additional save as copies this time), then when I reopen the file, the instances are gone from the world window. I was following the tutorials and found out something was off when I couldn't keep the changes from moving the rocks around.
danpost danpost

2014/3/2

#
I guess I should have specified -- changes in your code are saved as you make them. If you manually add actors into your world and want to save them, you need to 'Save the World' (from the menubar, 'Controls>Save the World'). After doing this, your world subclass will gain a 'prepare' method with the code for your manual actions and a call to it from the constructor of that world (this code change is saved automatically).
greenHead greenHead

2014/3/2

#
Great! Thanks for the clear explanation in your reply. This makes perfect sense now! Cheers -Edit: Also, the info here really creates that confusion: https://academy.oracle.com/self-study/greenfoot/greenfoot_2_6.html
danpost danpost

2014/3/2

#
Yeah. They missed the step of saving the world after their step 1.
You need to login to post a reply.