Jump to content


Photo

Open File With Game


  • Please log in to reply
3 replies to this topic

#1 ZoSo

ZoSo

    GMC Member

  • New Member
  • 9 posts
  • Version:GM6

Posted 23 July 2013 - 03:29 PM

is it possible to open file with game, made with game maker. like jpg is opened with paint. i want INI file to be opened with game maker. 


  • 0

#2 frolacosta

frolacosta

    GMC Member

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

Posted 23 July 2013 - 03:35 PM

ini_open(filename);

 

That function is the one used to open ini files within the game. If the file doesn't exist Game Maker will create one once you write data to the file, it won't create a blank .ini file containing nothing.

 

Check the help file(F1) under the INI Files section for all the functions concerning .ini filmes


  • 0

#3 dannyjenn

dannyjenn

    GMC Member

  • GMC Member
  • 2692 posts
  • Version:Mac

Posted 23 July 2013 - 06:07 PM

I think he means he wants it so when you double click an ini file that it opens in his program instead of Notepad or whatever.

 

 

To do that, you need to mess with values in the registry.  I don't know the specifics on how to do it though.

 

Then after that, there is a function (I forget what it's called, sorry) to get the command line arguments when the game starts up.  You'd use that to get the filepath of whatever ini file the person tried opening.

 

After that you'd use one of the file opening functions (such as ini_open()) to open it and display it or do whatever you want to do.


  • 0

#4 ZoSo

ZoSo

    GMC Member

  • New Member
  • 9 posts
  • Version:GM6

Posted 24 July 2013 - 08:22 AM

I think he means he wants it so when you double click an ini file that it opens in his program instead of Notepad or whatever.

 

 

To do that, you need to mess with values in the registry.  I don't know the specifics on how to do it though.

 

Then after that, there is a function (I forget what it's called, sorry) to get the command line arguments when the game starts up.  You'd use that to get the filepath of whatever ini file the person tried opening.

 

After that you'd use one of the file opening functions (such as ini_open()) to open it and display it or do whatever you want to do.

yes i mean exactly that. problem is i know how to set my game as default program for opening the file, but i dont know how to automatically open the INI i have clicked, when the game is started. thanks anyway


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users