I need some help.

Posted by Fabio on Oct. 11, 2011, 9:04 p.m.

My problem is an odd one–when I run the game from the GameMaker client, everything works smoothly. But then, when I try running my level editor from an executable or .app, I get this error:

___________________________________________

ERROR in

action number 1

of Create Event

for object obj_compile:

Error opening file for writing.

I've got no clue why this keeps happening.

Here is a link to my .gmk file. All you need to do before you make a new dungeon is create a folder with your desired dungeon name, and make sure it is in the same folder as your game file. My code is kind of messy… Any help would be so very appreciated, I couldn't even begin to tell you. Just getting back into GameMaker, and I'm struggling my way through to competency again. Thanks!

Comments

Alert Games 13 years, 2 months ago

Does the .lec file exist? you never check for it.

Also it may be more efficient to use only one file instead of 2, or possibly read for a number of lines, checking for an eof.

Castypher 13 years, 2 months ago

I'm assuming GM7.

I tried to have a look at the code the other day, since I've used file I/O quite frequently. But since I don't have GM7 anymore, I thought I'd probably do more damage by trying to mess with it.

Those errors have randomly popped up for me, too. What you have to do is make sure you closed the file in any other operations. A file can't be opened for writing if it's already open. So go through your code, find the times you do the reads and writes, and make sure file_close() is somewhere in there.