Main2 Actions in GameMaker: Studio - dummies

Main2 Actions in GameMaker: Studio

By Michael Rohde

GameMaker: Studio’s Main2 tab has four different sections: Timing, Info, Game, and Resources. This figure shows the sections of the Main2 tab. Here are the tabs and how you can use them to make your game.

The Main2 tab.
The Main2 tab.

Timing actions

Timing Actions, as shown here, are an important part of the game.

Timing Actions from the Main2 tab.
Timing Actions from the Main2 tab.
  • Set Alarm Action: This Action enables you to set 1 of 12 different alarm clocks for any single Instance. You simply select the number of steps you want to occur before the alarm is triggered; then you set which Alarm to trigger.

  • Set Time Line Action: This Action enables you to set which Time Line should run for that Object. You can also set the starting position from within the Time Line, with 0 marking the beginning.

  • Time Line Position Action: You can change the position of the current Time Line. You can use this Action to skip or repeat sections of the Time Line.

  • Time Line Speed Action: This Action enables you to change the speed of the Time Line.

  • Start, Pause, and Stop Time Line Actions: These Actions enable you to set the chosen Action, as well as start, pause, or stop the Time Line.

Info actions

There are two Info Actions, as shown in the next figure:

  • Display Message: Use this Action to make text appear on the screen.

  • URL Open: Use this Action to have the game open a web page of your liking.

    Info Actions from the Main2 tab.
    Info Actions from the Main2 tab.

To start a new line within a Display Message Action, use the # symbol. To get the # symbol to appear, use #.

Game actions

Here are the four different Game Actions, as shown in the next figure.

  • Restart Game: Use this Action to restart the game — say, if the player loses all his lives.

  • End Game: Use this Action to end the game. The End Game Action does not close out tabs or windows for the HTML5 target. But it does end the game.

    If you use the iOS or Windows Phone target, the End Game Action may block the device. It’s strongly recommended that you do not use this Action for these modules. Your final game will be rejected from the corresponding app store if this Action is used.

  • Save Game: Use this Action to enable the player to save her game so that she can load it later. In the Save Game Properties window, there is a field for you to enter the name of the save file. So, if you save the game as AllBasesGone, you’ll want to load the file, AllBasesGone.

    Not all aspects of the game will be saved. For example, if the game is saved while a Particles event is running, the particles will not be saved. Sounds are also not saved.

  • Load Game: Use this Action to enable the player to load a previously saved game. In the field within the Load Game Properties window, type in the name of the file you want to load, such as AllBasesGone, which is the same filename you used to save a game.

    Game Actions from the Main2 tab.
    Game Actions from the Main2 tab.

Resources actions

The Resource Actions, as shown, are all about replacing things like Sprites, Sounds, and Backgrounds.

Resources Actions from the Main2 tab.
Resources Actions from the Main2 tab.
  • Replace Sprite: This Action enables you to replace Sprites from the contents of a file. That way, you don’t have to load all the Sprites into the game code. Instead, you can call that Sprite during the game. But don’t call a Sprite that’s currently in view, or you could get some odd effects.

  • Replace Sound and Replace Background: These Actions work in a similar way to the Replace Sprite Action, in that you can store the files to be called during the game, so they aren’t part of the game program. This helps speed up the loading of your game.

As of this writing, the Resource Actions are still available for use. However, a known bug exists and they should not be used, because they may not work. Please check for updates to see if these Actions are fixed or if they’ve been removed from the software.