Reset world??
Blitz3D Forums/Blitz3D Programming/Reset world??
| ||
Is there a good way to pretty much delete everything in the world except what is there when you start. I want to delete everything when someone creates a new project so they can start from scratch. |
| ||
ClearWorld |
| ||
ClearWorld |
| ||
Clearworld doesn't clear sounds, type collections, arrays, or images. |
| ||
It does, however, clear the world. |
| ||
thx thats prob the best way. |
| ||
ExecFile("yourfile.exe") End ? |
| ||
hmm. Well i did try the clearworld and thats a bad idea. It deletes everything uncluding my gui and this would cause more work and pain to reload it all over again. The exec file is ok but when they click new it dont just delete everything it actually deleted wat was made in a prev proj and inserts the new terrain that the user defines in the new project window. It works just like making a new project in photoshop or the like. |
| ||
Keep track of everything that is added or have a template to load from. |
| ||
I agree with Jeremy - it is good practice to design your code so that it is easy to keep track of everything that is added (and in some cases removed). (see http://www.blitzbasic.com/Community/posts.php?topic=45478 ) |
| ||
I agree with Jeremy too. Doing what starfox said and just relaunching the exe is the ugliest, laziest, most unprofessional way of doing this. |
| ||
It depends on why you wish to clear everything, and whether it's just entities & sprites or whether you need to reset variables too etc. The following should take care of everything: 1) Have everything that is level-related or whatever 'stored' in custom Types. This way, the Types can be cleared with a simple routine. 2) Parent Everything Level related to a special pivot. make sure the child entities are ENTITYNAMEd like "Mesh_" or "Sprite_, At the moment of CLEARing, free all these entities, and clear the pivot. |
| ||
sweet deal thats wat i will do. It would make for easy undo/reddo also. |