QuantumRipple
QuantumRipple

Reputation: 1139

How to run multiple debug instances of a GM:S game

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?

Upvotes: 4

Views: 1141

Answers (1)

Rob
Rob

Reputation: 4987

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.

Upvotes: 1

Related Questions