I am trying to make a level editor. After a good bit of trouble with the saving I attempted the code for the loading. Needless to say it didn't work. I can't figure out why. I tried putting it inside execute_string (I thought that might work because I made a game a little while ago that used execute_string to change sprites).
Here is my code, if you need to see my saving code just ask.
///Press L event
file = get_open_filename('text files|*.txt','data');
if (file != '')
{
with (obj_player) {instance_destroy();}
with (obj_block) {instance_destroy();}
with (obj_button) {instance_destroy();}
fname = file_text_open_read(file);
if (!file_text_eof(fname))
{
xx = file_text_read_real(fname);
file_text_readln(fname);
yy = file_text_read_real(fname);
file_text_readln(fname);
obj = file_text_read_string(fname);
file_text_readln(fname);
instance_create(xx,yy,obj);
}
if (file_text_eof(fname))
{
file_text_close(fname);
}
}Any assistance would be appreciated! Thank you.M
Edited by MetroidMan347, 02 April 2012 - 03:54 PM.











