4

I'm building a client/server application in Game Maker: Studio 1.4 and need to run two instances of the game for testing. Unfortunately, the IDE's run/debug buttons disable themselves after starting the first copy. Is there a way to configure the IDE to permit two instances to run concurrently?

Opening two complete copies of the IDE sort of works, but seems like a great way to break my game by saving things out of sync.

I'm currently exporting the game every time I make a tiny code change and only debugging on the host instance, which is less than ideal.

Is there a way to configure the IDE to allow multiple instances of the game to run via the run/debug buttons?

QuantumRipple
  • 1,131
  • 11
  • 19
  • Personally, I export every time to test my client-server system. I don't think you can run 2 compiled instances per running gamemaker application. – An intern has no name Jan 17 '17 at 09:40
  • Yes, you can. There is a simple command that you can use to run a second runner (the command should be in the compile log). I'll test this out tonight because I could use this too. There is no way to debug both i think because you can only run 1 debug tool, but it should be easy to run a second instance. This saves a lot of time when debugging multiplayer games. Let me figure this out tonight, I'll keep you posted! – Rob Jan 17 '17 at 13:25

1 Answers1

1

Allright, here's what I have;

When you compile a game from the IDE you'll see a line like this one somewhere in the compile log:

C:\Users\You\AppData\Roaming\GameMaker-Studio\Runner.exe -game "C:\Users\You\AppData\Local\gm_ttt_92729\gm_ttt_68071\GAME.win"

When you execute that script in a command line (START+R) you'll see the game runs just fine.

In order to automate this, I am using the working_directory variable (which returns C:\Users\You\AppData\Local\gm_ttt_92729\gm_ttt_68071.

As GM:S does not support executing shell scripts, I have added this free asset to my game: https://marketplace.yoyogames.com/assets/575/execute-shell

In my game I have added a button which calls this code; ExecuteShell('%appdata%\Roaming\GameMaker-Studio\Runner.exe -game ' + working_directory + "ShootMUp.win",0)

Please note that you'll have to manually edit the .win file name.

But, this works and lets me run multiple instances of the same game without exporting it to .exe or build it again.

Rob
  • 4,653
  • 4
  • 23
  • 40