we do try to crash-proof the editor as much as possible - so things like missing files etc are checked and caught and handled properly.
from the game side - you and your scripts are responsible for the double checking of files / etc - again we do try to catch things so that you can see what the errors might be, but if you (as an example), delete an object from the world and try to access functions / properties via a handle that doesn't exist anymore - it's your responsibility for checking that this type of thing doesn't happen.
For example:
Object@ myObject = world.GetObject("myObject");
This gets a handle (pointer) to an object in the world. Now this object may or may not exist in the world, and as a result the handle might be null.
If you then call a function on the object, for example:
Vector pos = myObject.GetPosition();
And the handle isn't valid - this is the same as accessing a null pointer. Now, this type of thing 'should' be caught by the engine and generate a fatal script error - but that isn't really an acceptable situation for a game (to effectively 'crash' the script, which pops up error messages etc).
What you SHOULD do prior to accessing the handle, is check to make sure that the handle is valid (ie not null) - and then perform whatever operations that you want to do on it.
This applies to anything that you might be requesting / getting a handle to.
Error checking (in your scripts) is just as crucial as it is in standard programming - and there's nothing that we can do to anticipate / fix this kind of thing from our end (aside from catching the errors and reporting them to you).
So, a proper version of the above would be something like so:
Object@ myObject = world.GetObject("myObject");
if (myObject != null)
{
// do whatever we need to with this object handle
Vector pos = myObject.GetPosition();
}
When accessing / loading files remotely, you can simply call 'DoesFileExist()' prior to loading / accessing the file - but again, the error checking is 100% up to you to do.
The issue with the above / original post really is that the templates / examples simply do not have this kind of error checking (for the sake of being brief and as simple as possible) - and is something that we should double check & fix.
You'll notice that the FPS template does have some checking in the main.gsl file now that checks to see if there is a valid player or not prior to trying to run the game - this kind of thing should be implemented throughout all of the templates so that they are a bit more 'newbie' proof.
I'll do a pass on them to double check and add some basic checking for the templates to try and avoid this in the future.