Jump to content


Photo

File Dll


  • Please log in to reply
17 replies to this topic

#1 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 747 posts
  • Version:GM8.1

Posted 10 November 2008 - 04:42 PM

With this dll you can open files (text/binary) without getting annoying "error opening file for reading/writing" game maker errors. This way, you can show your own error message, or for example let the user choose another directory for saving the file.

The dll also has some extra functions, for examle opening or saving entire files at once. These functions are a lot faster than the standard GM functions, because the only way to do this in GM is reading one line at a time and concatenating all these lines. For example, opening a 1MB text file in GM could take several minutes, but with this function it only takes 0.2 seconds.

The dll can open up to 16 files at the same time (+ 1 with the functions that read the entire file at once).

Download: File Dll - ZIP (47.9kb)

The zip file contains the dll, the scripts, a gex file, an example (gmk), and a help file.

New: If you combine this dll with Blijbol's INI data structure extension, you can use this to read and edit INI files, even with files outside the program directory, without getting errors! Here you can find a list of instructions. Or if you don't understand Dutch:
- Import the INI data structure scripts OR extension into your game.
- Import the File Dll scripts OR extension into your game.
- Add the two alternative scripts for loading and saving INI data structures to your game.
- Use the alternative scripts for loading/saving instead of the normal ones.

Edited by Maarten Baert, 27 August 2011 - 08:30 PM.

  • 0

#2 newbie013

newbie013

    GMC Member

  • GMC Member
  • 96 posts
  • Version:GM8

Posted 10 November 2008 - 06:24 PM

Can you add ini support, that would be great.

Edited by newbie013, 10 November 2008 - 06:25 PM.

  • 0

#3 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 747 posts
  • Version:GM8.1

Posted 10 November 2008 - 06:58 PM

Hmm. I can try, but I have to know more about how INI files are formatted. Do the default INI functions also give error messages?

I could also add functions for reading reals, or functions for reading binary files, but I am not sure if anyone would use them. A read_real function might be a good idea because the default function also gives errors if the text is not a valid real.
  • 0

#4 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 747 posts
  • Version:GM8.1

Posted 13 November 2008 - 04:40 PM

UPDATE!

I have added functions for opening binary files, and functions for reading/writing reals to text files.
  • 0

#5 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 15 November 2008 - 03:35 AM

The INI functions used by GM would most likely be the default WinAPI ones. Few errors.
  • 0

#6 Schalk

Schalk

    GMC Member

  • GMC Member
  • 487 posts
  • Version:GM:HTML5

Posted 15 November 2008 - 03:43 AM

The problem I find with Game Maker's build in INI system, is that the INI has to be in the same directory as the exe. I haven't tested if this is true with Game Maker 7 though.
  • 0

#7 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 747 posts
  • Version:GM8.1

Posted 15 November 2008 - 04:50 PM

New: the dll can now be used to read and edit INI files! See first post for instructions.
  • 0

#8 Sindarin

Sindarin

    Indie Game Developer

  • New Member
  • 1644 posts
  • Version:GM:HTML5

Posted 15 November 2008 - 11:52 PM

Hmm, how about reading and writing UTF-8 (no BOM) text files?
  • 0

#9 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 747 posts
  • Version:GM8.1

Posted 23 November 2008 - 08:20 PM

Hmm, how about reading and writing UTF-8 (no BOM) text files?


How do you want to do that? GM strings only supports ascii. If you want to use another charset then you have to write a script to convert it.
  • 0

#10 Konstantine

Konstantine

    GMC Member

  • New Member
  • 93 posts

Posted 13 March 2009 - 09:12 PM

Thanks and congratulations for this great DLL. Its functions are far superior than GM's native functions, and I can say it's better that other DLLs too, even 39dll (in the file-editing aspects, at least). Keep making it better.
  • 0

#11 goofoffjw

goofoffjw

    GMC Member

  • GMC Member
  • 11 posts

Posted 06 February 2011 - 08:59 PM

The download link seems to be dead, sadly.
  • 0

#12 Razon

Razon

    GMC Member

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

Posted 07 February 2011 - 03:56 PM

http://www.mediafire...r93i3cdyn4yd4k3

Edited by Razon, 07 February 2011 - 03:59 PM.

  • 0

#13 orange451

orange451

    GMC Member

  • GMC Member
  • 1101 posts
  • Version:GM8.1

Posted 26 August 2011 - 12:06 AM

Is there a file_bin_seek() equivilant in this dll?
I need it to help my MD2 importing :)
  • 0

#14 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 747 posts
  • Version:GM8.1

Posted 26 August 2011 - 08:17 PM

This is a relatively old DLL, I don't really use it anymore. I created a new DLL for binary files: Buffer DLL. It has a lot more functions and it's a lot faster too.
  • 0

#15 The Legend

The Legend

    Unashamed

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

Posted 26 August 2011 - 09:03 PM

Could you list the functions? Plus your link is busted.
  • 0

#16 orange451

orange451

    GMC Member

  • GMC Member
  • 1101 posts
  • Version:GM8.1

Posted 26 August 2011 - 09:26 PM

This is a relatively old DLL, I don't really use it anymore. I created a new DLL for binary files: Buffer DLL. It has a lot more functions and it's a lot faster too.


how do I read the next byte of data from the buffer?
that bufferdll is a lot more confusing than this one :/

[edit]
can't you just write the seek method for the filedll? It's so much easier to manage...

Edited by orange451, 26 August 2011 - 09:29 PM.

  • 0

#17 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 747 posts
  • Version:GM8.1

Posted 27 August 2011 - 08:49 PM

I've uploaded a new version with a seek function :).
  • 0

#18 orange451

orange451

    GMC Member

  • GMC Member
  • 1101 posts
  • Version:GM8.1

Posted 27 August 2011 - 11:10 PM

Thank you for adding the seek method! but this seems just as fast as the current file_bin functions :/
I can load a MD2 mesh (1.68 mb) in 33 seconds, in both using file_bin functions, and this dll. There's virtually no time difference on my machine.


[edit]
read the help file, they're supposed to be as fast as their gml equivalents.

I hope I can figure out the buffer dll, I really need to cut down these loading times for my meshes.

Edited by orange451, 27 August 2011 - 11:44 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users