Jump to content


Photo

Dragger Dll


  • This topic is locked This topic is locked
59 replies to this topic

#1 tangibleLime

tangibleLime

    Lunatic

  • GMC Elder
  • 2520 posts
  • Version:GM:HTML5

Posted 20 January 2007 - 07:13 PM

<span style='font-size:12pt;line-height:100%'>Dragger DLL</span>

With this DLL, you can allow users to drag files to the Game Maker window, and have it recognize the files being dropped. You can also figure out how many files are being dropped, and a certain item using the index (0 based). The example (gm6) shows how to use the functions. Look in the scripts to find the arguments and returns.

If you have any problems, please tell me here.

Download: DraggerDLL.zip (~8 KB)

Rock on,
Roach
  • 1
Posted ImagePosted Image

#2 HomerTheDragoon

HomerTheDragoon

    GMC Member

  • GMC Member
  • 823 posts

Posted 20 January 2007 - 07:50 PM

wow sounds fantastic, let me try this.
  • 0

#3 Daniel-Dane

Daniel-Dane

    GMC Member

  • New Member
  • 3581 posts

Posted 20 January 2007 - 08:00 PM

Well, works like a charm and a really nice example.
However, there are already DLL's out here that can do that, and even more (eg. filesize, attributes, etc.).
  • 0

#4 cdm319

cdm319

    C++ Programmer

  • New Member
  • 885 posts

Posted 21 January 2007 - 12:14 AM

it would be good if it recognised what file type it was, eg. PDF file or Word Document
  • 0

Chris Matthews, Co-Leader of Digital X

#5 coolsmile

coolsmile

    Programmer

  • New Member
  • 1346 posts

Posted 21 January 2007 - 12:37 AM

What do you mean? I can drop that type of file...
You probably mean gm could read it?

--Oh well... :P
  • 0

#6 Quimp

Quimp

    Pretzel fanatic

  • New Member
  • 275 posts

Posted 21 January 2007 - 12:53 AM

Very useful functionnality (for me at least), thank you Roach.
  • 0

#7 P-entertainment

P-entertainment

    GMC Member

  • GMC Member
  • 1429 posts

Posted 21 January 2007 - 01:05 AM

This may be just what I'm looking for :P
  • 0

#8 crash2108

crash2108

    GMC Member

  • New Member
  • 148 posts

Posted 21 January 2007 - 02:15 AM

It doesn't work for me.
  • 0

#9 cdm319

cdm319

    C++ Programmer

  • New Member
  • 885 posts

Posted 21 January 2007 - 04:31 PM

no, I mean that when you drop a file into the window, it tells you what type of file you dropped.
  • 0

Chris Matthews, Co-Leader of Digital X

#10 celebraces

celebraces

    GMC Member

  • GMC Member
  • 956 posts

Posted 21 January 2007 - 04:43 PM

I think it's worth noting that you can set the first argument drag_mode to a handle returned by GMWWW's functions; you can set a specific area of a window to receive files.
  • 0

#11 tangibleLime

tangibleLime

    Lunatic

  • GMC Elder
  • 2520 posts
  • Version:GM:HTML5

Posted 21 January 2007 - 06:19 PM

no, I mean that when you drop a file into the window, it tells you what type of file you dropped.

<{POST_SNAPBACK}>

Your wish is my command. I'll include it in the next version.
  • 0
Posted ImagePosted Image

#12 Melari

Melari

    GMC Member

  • New Member
  • 104 posts

Posted 21 January 2007 - 07:14 PM

This is really neat!
  • 0
Posted Image

#13 hanson

hanson

    GMC Member

  • GMC Member
  • 444 posts
  • Version:GM8

Posted 22 January 2007 - 12:35 AM

This is really usefull. Thanks.
  • 0

#14 Smarttart62

Smarttart62

    designFUSION™

  • New Member
  • 2619 posts

Posted 22 January 2007 - 12:40 AM

Finally another one... The last one i saw was more of a hack job...
-Steve
  • 0

#15 IsmAvatar

IsmAvatar

    Good Samaritan

  • GMC Member
  • 2411 posts
  • Version:GM8

Posted 22 January 2007 - 03:26 AM

Slight bug:
drag_num, drag_get, and drag_step
are supposed to return values, but you do not tell the scripts to return; they just call their function. Curious that they still work...

Edited by IsmAvatar, 22 January 2007 - 03:28 AM.

  • 0
Posted Image LateralGM is an IDE for editing GM files on Linux, Mac, and Windows.
We also house the GM File Format Documentation and other projects of that nature.
IsmAvatar.com | Examples | Scripts | Particles | DLLs | Credit Me
Email | Registered

#16 tangibleLime

tangibleLime

    Lunatic

  • GMC Elder
  • 2520 posts
  • Version:GM:HTML5

Posted 22 January 2007 - 05:05 AM

I've always done that. It just always works, for some reason.
  • 0
Posted ImagePosted Image

#17 Quimp

Quimp

    Pretzel fanatic

  • New Member
  • 275 posts

Posted 22 January 2007 - 12:58 PM

Game Maker has to return a value (the result can't be void), so it returns the last result it has gathered. Ex: script0: vara = "32"; Creation room event: show_message(script0());
  • 0

#18 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 22 January 2007 - 10:20 PM

I like this, but I've found a bug. When calling drag_get(files_get,"0") the drive letter is missing (it starts at the colon). I can assume it's drive C, but on others' computers it may not be... can this be fixed?

BTW, it works okay with every other index, it only misses the drive letter on index 0....

-IMP :D :)
  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#19 cdm319

cdm319

    C++ Programmer

  • New Member
  • 885 posts

Posted 22 January 2007 - 10:24 PM

about my suggestion roach, you could use GM's function "filename_ext"
  • 0

Chris Matthews, Co-Leader of Digital X

#20 zephroelectro

zephroelectro

    GMC Member

  • New Member
  • 265 posts

Posted 24 January 2007 - 02:00 PM

woot. altho h0bbels stuff already does this, and offers alot more function.

still good tho :)
  • 0

#21 Jax

Jax

    GMC Member

  • New Member
  • 232 posts

Posted 04 February 2007 - 06:55 AM

Wow thats cool! Although some runs it doesn't work and others it does, why is that? Is it my computer, GM, the code, the DLL, or me just doing it wrong?

Edited by Jax, 04 February 2007 - 07:21 AM.

  • 0

#22 metal-games

metal-games

    metal-games

  • New Member
  • 732 posts

Posted 04 February 2007 - 03:33 PM

it doent work a error message comes up
  • 0

#23 theloon

theloon

    GMC Member

  • GMC Member
  • 83 posts

Posted 15 February 2007 - 07:10 PM

Hey, just a heads up:

Dragger tends to interfere with GM mouse events in objects when object_drag uses the STEP event. It works much better if the drag_step() is in BEGIN STEP.

Also. if you use show_message() you must call drag_step() DIRECTLY afterwards for some reason otherwise drag and drop stops working..

If you use the window_set_stayontop() it displays a crossed out circle when you next attempt to drag

Now, all of these quirks could be from me using GM 6.1 and Win 2k. Or, I just didn't RTFM ;)

Really, really cool .DLL :P Thanks!

Edited by theloon, 16 February 2007 - 05:06 PM.

  • 0

#24 SquareWheel

SquareWheel

    Square Wheel Games

  • New Member
  • 851 posts
  • Version:Unknown

Posted 16 February 2007 - 12:14 PM

Just curious, does this support multiple file dragging?
  • 0
Cook Console | Editor Engine | Mass File Namer

All of my examples are publicly available and can be found at

#25 Daniel-Dane

Daniel-Dane

    GMC Member

  • New Member
  • 3581 posts

Posted 16 February 2007 - 01:58 PM

Just curious, does this support multiple file dragging?

<{POST_SNAPBACK}>

With this DLL, you can allow users to drag files to the Game Maker window, and have it recognize the files being dropped. You can also figure out how many files are being dropped, and a certain item using the index (0 based). The example (gm6) shows how to use the functions. Look in the scripts to find the arguments and returns.

<{POST_SNAPBACK}>

Just curious, Are you lazy?
  • 0

#26 SquareWheel

SquareWheel

    Square Wheel Games

  • New Member
  • 851 posts
  • Version:Unknown

Posted 16 February 2007 - 05:09 PM

Ah, sorry. I couldn't download it at the time though.
  • 0
Cook Console | Editor Engine | Mass File Namer

All of my examples are publicly available and can be found at

#27 theloon

theloon

    GMC Member

  • GMC Member
  • 83 posts

Posted 16 February 2007 - 05:13 PM

Just curious, does this support multiple file dragging?

<{POST_SNAPBACK}>


It does. However, it separates the files by a weird character that shows up as a square of sorts. I haven't looked up the manual but I wonder what ASCII character it is?

I usually snip that weird character off immediately after the drag_step() by doing this:
VAR_drag_result = string_copy(VAR_drag_result,0,string_length(VAR_dr
ag_result)-1)

Edited by theloon, 16 February 2007 - 05:19 PM.

  • 0

#28 IsmAvatar

IsmAvatar

    Good Samaritan

  • GMC Member
  • 2411 posts
  • Version:GM8

Posted 16 February 2007 - 05:15 PM

Most likely either a line feed or a carriage return (10 or 13)
  • 0
Posted Image LateralGM is an IDE for editing GM files on Linux, Mac, and Windows.
We also house the GM File Format Documentation and other projects of that nature.
IsmAvatar.com | Examples | Scripts | Particles | DLLs | Credit Me
Email | Registered

#29 tangibleLime

tangibleLime

    Lunatic

  • GMC Elder
  • 2520 posts
  • Version:GM:HTML5

Posted 16 February 2007 - 09:15 PM

13
  • 0
Posted ImagePosted Image

#30 Tag

Tag

    GMC Member

  • New Member
  • 61 posts

Posted 16 February 2007 - 11:48 PM

Do you think it is really necessary for it to freeze the game until the mouse is moved? Try it out because I could REALLY use this!

When the mouse is not moving, the game stops until you start moving it again..
OR until a key is pressed. What can I do to prevent this?

Edited by Tag, 16 February 2007 - 11:51 PM.

  • 0

#31 Ansgar

Ansgar

    OM Studios

  • New Member
  • 333 posts

Posted 10 March 2007 - 09:36 PM

Truly a great DLL, but unfortunately it doesn't work in Game Maker 7. Are you planning to convert it?
  • 0

#32 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 20 March 2007 - 01:24 AM

Roach, you ever fix the driveless 0 Index file bug?

-IMP :P ^_^
  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#33 hypnotoad1579

hypnotoad1579

    GMC Member

  • New Member
  • 12 posts

Posted 07 April 2007 - 06:21 PM

could this work with your embed DLL? like, could I somehow make it so i could drag a window into the game and make it embed into it. ;) that would be the G!!! :GM6: ^_^
  • 0

#34 tdmgames

tdmgames

    GMC Member

  • New Member
  • 1641 posts

Posted 06 July 2007 - 07:47 PM

it didn't work for me, i dragger files onto it released and that was it

It didin't show the amount of files dropepd or nething
  • 0
OH Balls!

Domain change: If any of my links do you not, please PM me and I will send you a working link :)

t3mp3st+Me+BMG = t3mp3st's edited avatar with changing colour effect.

#35 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 06 July 2007 - 08:30 PM

Ah, I fixed the "no drive letter for index 0" bug by writing my own drag_get script. If anyone else gets that bug, here's the fix:

Go into the drag_get script, and replace it all with this:

/*
Script: drag_get
Function: Gets a specific item with a given
          index in the drop list.
          
Arguments: [1]
   0 - string - files dropped string
   1 - string or real - zero based index of the string
  
Returns:
   string - the filename of the given index, or a blank string if the index is larger than the number of files dropped.
*/
var str,pos,p,temp;
str=argument0;
pos=real(argument1);
if (pos>string_count(chr(13),str)) { return ""; }
for (p=0; string_count(chr(13),str)>0; p+=1) {
temp=string_copy(str,1,string_pos(chr(13),str)-1);
if (pos-1==p) { break; }
str=string_delete(str,1,string_pos(chr(13),str));
}
return temp;

You can use it the exact same way you've been using it, and it'll work correctly this time, drive letter and all.

-IMP :P :(

Edited by IceMetalPunk, 06 July 2007 - 08:31 PM.

  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#36 cdm319

cdm319

    C++ Programmer

  • New Member
  • 885 posts

Posted 08 July 2007 - 12:21 PM

IMP - get_environment_variable("HOMEDRIVE");
  • 0

Chris Matthews, Co-Leader of Digital X

#37 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 08 July 2007 - 06:22 PM

IMP - get_environment_variable("HOMEDRIVE");

<{POST_SNAPBACK}>

But the file may not be on the home drive, i.e. it may be from a USB drive, CD, floppy, etc.

-IMP :D -_-
  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#38 mxturkcom

mxturkcom

    GMC Member

  • New Member
  • 24 posts

Posted 17 July 2007 - 09:33 AM

thanks roach.it is very useful
  • 0

#39 mrsmes

mrsmes

    GMC Member

  • GMC Member
  • 1506 posts
  • Version:GM:Studio

Posted 19 August 2007 - 03:23 AM

Dragger DLL

With this DLL, you can allow users to drag files to the Game Maker window, and have it recognize the files being dropped. You can also figure out how many files are being dropped, and a certain item using the index (0 based). The example (gm6) shows how to use the functions. Look in the scripts to find the arguments and returns.

If you have any problems, please tell me here.

Download: DraggerDLL.zip (~8 KB)

Rock on,
Roach

<{POST_SNAPBACK}>

tanks roach.
  • 0

Assuming I helped you out in a questions and answers topic won't you return the favour by helping me with one my coding problems, or recommend some one who can chat to me over pms about helping and how to overcome my obstacles, after all lets just say I did help you or them or many people with similar problems, in that topic.

Here i have a topic for those of you struggling with type writer text and mugshots in your games especially if it is a rpg see the link below for more info

http://gmc.yoyogames...howtopic=619103

almost no code needed, only uses two events.

click here for the l8est version of feed the alien pizza, it has some major polished up features.


#40 mr 3d

mr 3d

    GMC Member

  • New Member
  • 2 posts

Posted 24 October 2007 - 08:00 AM

Broken link...
  • 0

#41 ashsashs

ashsashs

    GMC Member

  • New Member
  • 240 posts

Posted 26 October 2007 - 12:20 PM

corropted
  • 0

#42 benoit.rouleau

benoit.rouleau

    GMC Member

  • GMC Member
  • 1637 posts
  • Version:GM:Studio

Posted 18 November 2007 - 01:04 AM

The link isn't broken, just read Roach's signature. You can download it here: http://wowthatsaweso.../DraggerDLL.zip

However it doesn't work for me, nothing happens when I drop the file on the window. Uhm lol. ::lmao::

Edited by benetonmovie, 23 November 2007 - 11:48 PM.

  • 0

#43 sinkhead101

sinkhead101

    sinkhead.net

  • New Member
  • 483 posts

Posted 19 November 2007 - 08:10 PM

Has anyone got a fix for this?

Thanks
  • 0

#44 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4935 posts
  • Version:GM8

Posted 22 November 2007 - 04:58 AM

Your link is broken. Here is the new one :D

http://wowthatsaweso.../DraggerDLL.zip
  • 0

#45 posva

posva

    GMC Member

  • New Member
  • 610 posts
  • Version:GM8

Posted 13 December 2007 - 04:38 PM

please update othe link or if someone can send me it do it! thanks!
  • 0

#46 may0004

may0004

    GMC Member

  • New Member
  • 221 posts

Posted 14 December 2007 - 07:13 AM

I've always done that. It just always works, for some reason.

<{POST_SNAPBACK}>

not any more the scripts don't work unless you add return to them here
are the new scripts
  • 0
If you want help adjusting or optimizing your code, comment it so i can tell what you are trying to do at all times!!!!!
If I Helped You At Any Time Please Post A Review Of My Music Composition Software Which Is Being Made In Game Maker



<span style='font-size:8pt;line-height:100%'>Fully-Featured Sci-Fi Tactical Real Time Strategy Game</span>

#47 hiro-niro

hiro-niro

    GMC Member

  • New Member
  • 707 posts

Posted 01 February 2008 - 11:51 PM

Doesn't work.

Edited by hiro-niro, 01 February 2008 - 11:58 PM.

  • 0
Permanently left the Game Maker Community.

#48 Games

Games

    GMC Member

  • Banned Users
  • 2968 posts

Posted 02 February 2008 - 10:29 PM

Few things to say after messing around with this dll for a bit..

It is very easy to understand, and to use. However, a few things bug me.

First of all, if the mouse is moving, I receive a constant 30 fps, but I cannot add files with a moving mouse. When the mouse stays still, and I just let go of a file, it gets read every time without fail, but for something such as a media player which has those visual effect, you can't have it so jumpy.

So, to all of you wondering, it does work, however, the mouse can't be moving when a file is added. Also, when the mouse is moving, you will appear to get 0 fps, which is deadly for most games and media players.
Click to visit Toydaker.com
For Sale: 3 Editables, 40 dollars (demo on site above). Click to purchase.

#49 Botyto

Botyto

    GMC Member

  • GMC Member
  • 1252 posts

Posted 25 August 2008 - 09:25 AM

I have problem - the link is broken!
  • 0

#50 Dmaster270

Dmaster270

    GMC Member

  • New Member
  • 1736 posts

Posted 25 August 2008 - 10:55 PM

You would be able to use it if you checked his signature. Simply change technosoftnet.com to wowthatsawesome.com and it will work.

I fixed it.
-- kc

Edited by KC LC, 26 August 2008 - 12:50 AM.

  • 0
PM me with an email for a Lockerz invite.