Jump to content


Photo

Open With...


  • Please log in to reply
8 replies to this topic

#1 remoladen

remoladen

    GMC Member

  • New Member
  • 147 posts

Posted 02 June 2008 - 10:37 PM

You know how you can right click on any file and click Open With... Is there a DLL that lets you open a file in your game/program, like it gives you a file location or something... please help!
  • 0

#2 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • Retired Staff
  • 9314 posts
  • Version:Unknown

Posted 02 June 2008 - 11:23 PM

1) When you open a file with your program, the file's path is sent in parameter_string(1). Use that, no DLL needed.
2) This is the wrong place for this question. Hence, why you've been reported.

-IMP :D :(
  • 0

#3 Sindarin

Sindarin

    Indie Game Developer

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

Posted 03 June 2008 - 04:18 AM

2) This is the wrong place for this question. Hence, why you've been reported.


Don't worry though, the topic will probably be moved.

Here's a code snip to help you:
Place on create Event of a object,
my_sound=parameter_string(1)
sound_replace(sound0,my_sound,3,1)
sound_loop(sound0)

If you open an mp3 with your game then, the sound will be loaded and play.


However I get to ask a question as well.
Does anyone know how I can make every sound I open play in the same game window and not open a new game each time?
(I guess a dll would be needed for this)
  • 0

#4 freaked

freaked

    freak up!

  • New Member
  • 890 posts

Posted 03 June 2008 - 04:20 AM

You'll have to use a dll to check for running copies of your game.
If the game (via a dll) sees that another instance of the game is running, it passes the parameters to the the already older running instance and shuts itself down.
  • 0

#5 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • Retired Staff
  • 9314 posts
  • Version:Unknown

Posted 03 June 2008 - 04:24 AM

You'll have to use a dll to check for running copies of your game.
If the game (via a dll) sees that another instance of the game is running, it passes the parameters to the the already older running instance and shuts itself down.

Such as: http://gmc.yoyogames...amp;hl=instance

That one ;) . Not sure how to pass the parameter over, though, but the best way I can think of (which is not very efficient) is to use a socket DLL like 39DLL and send a message over via the special IP 127.0.0.1.

-IMP :D :(
  • 0

#6 remoladen

remoladen

    GMC Member

  • New Member
  • 147 posts

Posted 03 June 2008 - 08:32 PM

orrr.... u could have the original exe keep checking a file...

have on create event...
if (check if the file is already running or what ever..)
{
file_open_write("C:\temp\123.txt")
file_write_string(parameter_string(1))
file_close()
game_end();
}


in step event:
if file_exsists("C:\temp\123.txt")
{
sleep(100) //give it time to write to the file
file_open_read("C:\temp\123.txt")
openstr = file_read_string()
file_close()
file_delete("C:\temp\123.txt")
}

Edited by remoladen, 03 June 2008 - 08:34 PM.

  • 0

#7 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • Retired Staff
  • 9314 posts
  • Version:Unknown

Posted 03 June 2008 - 11:34 PM

orrr.... u could have the original exe keep checking a file...

have on create event...
if (check if the file is already running or what ever..)
{
file_open_write("C:\temp\123.txt")
file_write_string(parameter_string(1))
file_close()
game_end();
}


in step event:
if file_exsists("C:\temp\123.txt")
{
sleep(100) //give it time to write to the file
file_open_read("C:\temp\123.txt")
openstr = file_read_string()
file_close()
file_delete("C:\temp\123.txt")
}

Notice I didn't say the only way, I just said the best way. Your method would need to read from a text file every step (including opening it, reading it, then closing it). My way only needs to get a message from the client, which works via the DLL so it's much more efficient than an all-GML method.

-IMP :P :P
  • 0

#8 remoladen

remoladen

    GMC Member

  • New Member
  • 147 posts

Posted 04 June 2008 - 05:27 PM

Notice I didn't say the only way, I just said the best way. Your method would need to read from a text file every step (including opening it, reading it, then closing it). My way only needs to get a message from the client, which works via the DLL so it's much more efficient than an all-GML method.

no... it just checks if the file exists every step... therefore it doesn't really do much... I tested it out.. (i fixed up a couple errors in the script) and it worked fine! it didn't even delay my game at all...
  • 0

#9 Caniac

Caniac

    The #1 Caniac

  • New Member
  • 2622 posts

Posted 11 June 2008 - 05:01 PM

there is an easy way to do this in the registry,
I can't find it tho.
I don't have time to google it for you, but I did find it once, a few weeks ago...
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users