Hello, I hope you are alive and well. I cant seem to get this to work :O im on the latest gms2.3 version and have used var value = file_dropper_init(); in the create event but it returns 0. only on start does a single async system event occur and never when i drag in a image. (which displays the cancel icon (even tho i also put in file_dropper_set_default_allow(true); ))
If file_dropper_init returns 0, that means that either the DLL didn’t load or Windows API calls failed. You’d be seeing messages about either in your Output.
When you say “latest 2.3 version”, what does that mean? There’s LTS, stable, and beta branches, and that’s assuming that you don’t mean using 2.3.5.xxx for 32-bit games.
glad to hear from you! im using this: i did try and download the example projects from git. had to update them with project tool (does it automatically on loading it) and it said the dlls were missing.
looking in my project tho in the output folder it says:
For the git test project, note that DLLs are not stored in the repository, so you’ll need to either copy it from the download or compile the Visual Studio project.
im downloading the project and opening it in GMS, it says it needs project tool to update. afterwards i try to hit run and it says the dlls were missing. i imported the yymps and replaced the extension and the project runs but gives the same compile error as its not working for me:
LoadLibraryW("C:\Users\Jinda\AppData\Local\GameMakerStudio2\GMS2TEMP\file_dropper_23_45FC0D0A_VM\file_dropper_x64.dll") failed with error code 87 ("The parameter is incorrect.")
I put up a new version (1.1.2a) that no longer depends on having Visual C++ redistributable installed, though I don’t think that’s the error that would give.
If that doesn’t do it, you’ll have to figure out yourself what your computer doesn’t like using Dependencies GUI or alike.
Hello YAL! Big fan of your work! Do you think it would be possible to get the filename/path before dropping the file into the window, while it's still being held? I would like to check the file extension for visual purposes, i.e. changing the cursor effect if it's an invalid filetype. Thanks for everything you do!
I appreciate the response, but from what I can tell file_drag_enter doesn't return the filepath. The only event I can see from your docs that returns filepaths is the file_drop event. If I try to use the filepath it returns as undefined.
I hadn't considered how it would be handled if multiple files are being held, though; I can understand if that complicates things too much.
I copy-pasted it from “file_count” description and forgot to change the opening line, I’ll fix that for the next release (the extension itself is unaffected).
I always get this error when trying to build, even on a blank project:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.ArgumentNullException: Value cannot be null. (Parameter 'path1')
at System.IO.Path.Combine(String path1, String path2)
at GMAssetCompiler.WADSaver`1.WriteExtensions(IList`1 _data, Stream _s, IFF _iff)
at GMAssetCompiler.IFFChunkHandler`1.Save(Stream _stream, IFF _iff)
at GMAssetCompiler.IFF.WriteChunks(Stream _stream, TextWriter _out)
at GMAssetCompiler.WADSaver`1.Save(GMAssets _assets, Stream _stream, List`1 _extraFilenames, Dictionary`2 _extraAttributes)
at GMAssetCompiler.IFFSaver.Save(GMAssets _assets, String _name)
at GMAssetCompiler.Program.CompileProject(GMAssets _file)
at GMAssetCompiler.Program.Reentry(String[] _args)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Igor.Program.ExecuteAssetCompiler(String _args)
at Igor.WindowsBuilder.Compile(Boolean _exe)
at Igor.WindowsBuilder.Deploy(Boolean _exe)
at Igor.WindowsBuilder.Run()
just as a head-up :
The extension started not working for me all of a sudden, the function file_dropper_init() returning 0.
I have no idea why, it worked fine until now, but now I can’t seem to get it to work on my computer anymore, except very rarely. I didn’t change any of the code, even old itch builds of my game that used to work do not now, so this is probably a change on my computer rather that on gamemaker, but I can’t figure out what change caused that to happen. Sometimes it will in fact work randomly but that’s like once every 20 tries.
This is probably not helpful at all to debug but this is all I have :/
EDIT : I fixed it by disabling the option : Start fullscreen
and running windo_set_fullscreen(true) at startup instead.
///File_Dropper_Async_System_Event()
/*
To use this extension, simply call this once at launch:
file_dropper_init();
Then, put the following code in an async -> System event
Object -> Click "Add event"
"Asynchronous" (bottom right)
"System event" (last on the list).
*/
// Check to see what kind of event happened
var eventType = ds_map_find_value(async_load,"event_type");
// If a file was dropped over the window
if eventType == "file_drop"
{
// This is the absolute path
var filePath = ds_map_find_value(async_load,"filename");
// Print it
show_debug_message(filePath);
// Will return the full path, e.g. "C:\Users\user\Documents\Test.txt"
// When multiple files are included, this event will be called
// once per file.
}
← Return to extension
Comments
Log in with itch.io to leave a comment.
Hello, I hope you are alive and well. I cant seem to get this to work :O im on the latest gms2.3 version and have used var value = file_dropper_init(); in the create event but it returns 0. only on start does a single async system event occur and never when i drag in a image. (which displays the cancel icon (even tho i also put in file_dropper_set_default_allow(true); ))
If
file_dropper_init
returns 0, that means that either the DLL didn’t load or Windows API calls failed. You’d be seeing messages about either in your Output.When you say “latest 2.3 version”, what does that mean? There’s LTS, stable, and beta branches, and that’s assuming that you don’t mean using 2.3.5.xxx for 32-bit games.
glad to hear from you! im using this: i did try and download the example projects from git. had to update them with project tool (does it automatically on loading it) and it said the dlls were missing.

looking in my project tho in the output folder it says:
For the git test project, note that DLLs are not stored in the repository, so you’ll need to either copy it from the download or compile the Visual Studio project.
im downloading the project and opening it in GMS, it says it needs project tool to update. afterwards i try to hit run and it says the dlls were missing. i imported the yymps and replaced the extension and the project runs but gives the same compile error as its not working for me:
LoadLibraryW("C:\Users\Jinda\AppData\Local\GameMakerStudio2\GMS2TEMP\file_dropper_23_45FC0D0A_VM\file_dropper_x64.dll") failed with error code 87 ("The parameter is incorrect.")
I put up a new version (1.1.2a) that no longer depends on having Visual C++ redistributable installed, though I don’t think that’s the error that would give.
If that doesn’t do it, you’ll have to figure out yourself what your computer doesn’t like using Dependencies GUI or alike.
Hello YAL! Big fan of your work! Do you think it would be possible to get the filename/path before dropping the file into the window, while it's still being held? I would like to check the file extension for visual purposes, i.e. changing the cursor effect if it's an invalid filetype. Thanks for everything you do!
There’s already a file_drag_enter event
I appreciate the response, but from what I can tell file_drag_enter doesn't return the filepath. The only event I can see from your docs that returns filepaths is the file_drop event. If I try to use the filepath it returns as undefined.
I hadn't considered how it would be handled if multiple files are being held, though; I can understand if that complicates things too much.
Added those, and you may decide for yourself what status should be shown if only some of the dragged items are acceptable.
I think you forgot the "filename" in the docs for the drop event
I copy-pasted it from “file_count” description and forgot to change the opening line, I’ll fix that for the next release (the extension itself is unaffected).
Is there a way to force window focus when dragging a file over the game window? This way the game can react to mouse position while holding the file.
It’s a Sunday afternoon and I have electricity this time, so you can even have a more proper solution.
Oh my god. Thank you!
I always get this error when trying to build, even on a blank project:
That’s a GameMaker bug - it corrupts most of my extensions on load now. I recommend rolling back the IDE to 2023.8 for now
just as a head-up : The extension started not working for me all of a sudden, the function file_dropper_init() returning 0. I have no idea why, it worked fine until now, but now I can’t seem to get it to work on my computer anymore, except very rarely. I didn’t change any of the code, even old itch builds of my game that used to work do not now, so this is probably a change on my computer rather that on gamemaker, but I can’t figure out what change caused that to happen. Sometimes it will in fact work randomly but that’s like once every 20 tries. This is probably not helpful at all to debug but this is all I have :/
EDIT : I fixed it by disabling the option : Start fullscreen and running windo_set_fullscreen(true) at startup instead.
Helper script:
Nice! Very easy to use.