The basic facts are: I choose a model, i choose its position and, when I'm ready, I press enter and, in the file "map.txt" it's added a line with the code I need (that will be read, after, in the game, such as CreateModel(x,y,z,name) .
So, if I make a map with 4 objects and the room, it should be a text file with 5 lines:
Now... my camera set it all up.
In the create event of my camera, I wrote:
fail = file_text_open_read("mappa.txt");
Fail is how I read "file", pretend it's ok, nothing about failing XD
In the Enter keyboard press event (that I press when I finish with that model) I wrote:
file_text_write_string(fail,"InstanceCreate(" + string(new_model.x) + "," + string(new_model.y) + "," + string(new_model.z) + "," + string(global.file) + ");"); file_text_writeln(fail);
action number 1
of Key Release Event for <Enter> Key
for object camera:
File is not opened for reading.
What's wrong with it?
The file doesn't even get created.