that is not true !!
gm will give you the path of the gmd with the exe extencion in working_directory variable
Don't you think I tried it BEFORE I posted - unlike someone else?
You should not expect the working_directory variable to be a constant. I have found a way, by accident, to have that variable change. I'm starting to learn that in the world of GM, nothing is a constant...
Anyway, it's a good rule of thumb that you should ALWAYS pass the filepath along with a filename when pointing to a file's location. Just passing a filename and hopeing it fills in the correct filepath may lead to unexpected errors.
EDIT: Actually, the working_directory should point to the "local" directory when you use debug mode. However, it could be changing due to your DLL (dll's can change that variable without realizing it). I recommend storing the working_directory into another variable on runtime, before initializing your DLL. Then you know the variable won't suddenly change.
Also, the filepath of parameter_string(0) is what your thinking about tsg1zzn. If you use that to get the "working directory" then you will get a different path if your debugging or running from EXE.
My dll does not change anything. You've found a way to change the working directory variable you said? I have always thought the working directory changed when you saved files to a different location. This is untested though.
I'm sorry to say this - but I'm afraid I'm more right than you. I'll show you why in 10 easy-to-follow programming-explained-like-I-was-three-years-old steps.
1. Start Game Maker 5.0 (which this dll was designed for)
2. You will have an empty game
3. Add a new room
4. In the room properties window, go to the "settings" tab
5. Click "creation code"
6. Type in: show_message(working_directory);
7. Close the code editor by clicking the green checkmark
8. Press the green arrow on the MDI parent's tool bar to run the game
9. Wait for the progress bar to finish and the game window creates
10. Look at the contents of the message box
I almost hear you thinking: "It's not my fault that retarded guy use 5.0". Well, the behaviour is the same for 6.0, except the message box pops up before the game window shows.
Also, the behaviour is the same when you view the variable in debug mode, and this also applies to 6.0.
parameter_string(0) returns: C:\DOCUME~1\Trond\LOKALE~1\Temp\gm_ttt_15169\game.exe
working_directory returns: C:\DOCUME~1\Trond\LOKALE~1\Temp\gm_ttt_15169
Edited by tsg1zzn, 02 May 2005 - 07:48 PM.