crap wont save (solved)

M

Misty

Guest
Im using GM 1.4. I have a d3d_model. I run program as admin to allow game maker to modify computer. I put save the working directory to clipboard. Then I have tried putting working directory in front of file name then not in front. And I use Windows search to see for the file, and it doesn't exist. d3d_model_save wont save and I dont know why.

it is a long hard road of game dev and i get no peace even cant even do easy peasy things i hate my life
 

Bart

WiseBart
Not sure about where exactly you want to save that file, but the file system limits still apply because of the file system being sandboxed, regardless of whether you run as admin or not.

To get access to locations outside of the sandbox you have to use get_open_filename and get_save_filename.
 
Z

zendraw

Guest
try saving somthing else that you know it shuld save there
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
Saved files will go into appdata unless whitelisted via dialog - no matter whether you ask to save them into working_directory or program_directory. See the linked page for explanation.

If you do not like this, 2.2.3 has the ability to disable sandbox, or there are GM:S-compatible extensions on marketplace (ranging in price and features).
 
M

Misty

Guest
Here is my code. I paste the clipboard text it makes into Windows Explorer... and the file is not there.

clipboard_set_text(working_directory)
f=file_text_open_write(working_directory+"\test.txt")
show_message(f)
file_text_write_string(f,"string")
file_text_close(f)

And show_message returns 1, true.
 

TheouAegis

Member
Forum Request: Can we get a "Like Title" feature added to the forum? Because the title of this thread just made my day. lol
 
Here is my code. I paste the clipboard text it makes into Windows Explorer... and the file is not there.

clipboard_set_text(working_directory)
f=file_text_open_write(working_directory+"\test.txt")
show_message(f)
file_text_write_string(f,"string")
file_text_close(f)

And show_message returns 1, true.
Omit the backslash, working_directory already includes it.
 
H

Homunculus

Guest
working_directory can point to two places depending on the context, and honestly at this point I think it exists only for background compatibility (and to confuse people). Using just
Code:
f=file_text_open_write("test.txt")
afaik has the same result as your code above.

What you are probably seeing in your output is the "included files" directory, which is where your game will look for files first in read operations. When a file is not found there, or you are trying to save / edit files, it will point to the "writable" storage folder.

Try printing the value of game_save_id to the console and look at that path for your files.
 
I tried it already it doesnt work either. And in the official GM helpfile it says to put a backslash.
In both the help files that I have for 1.4 and 2 (and the online docs) says it's already included.

Just omit working_directory completely then, you don't usually need it.

Windows search won't find the file by default, the folder is under a hidden folder in c:/Users/<UserName>/AppData/Local/<Game Name>
 
Top