Introduction to Game Logic
Learn the fundamental concepts of making your map interactive with the Action System.
The true power of Game Maker lies in its visual scripting system, which we call the Action System. It allows you to create complex game mechanics, puzzles, and interactive experiences without writing a single line of code.
This system is built on a few core concepts that work together to bring your map to life.
1. Regions
A Region is a defined 3D area within your map. You can create regions of any size, from a single block to a massive zone. Regions are the foundation for location-based logic. You might create a region for:
- A finish line in a race.
- A spawn area where players are protected.
- A secret room that triggers an ambush.
- A pressure plate that activates a trap.
You can create and manage regions in /editmap -> Regions.
2. Events
An Event is a trigger that happens in your game. It's the "when" part of your logic. Game Maker listens for many different Minecraft events and lets you react to them. For example:
- Player Enter Region: When a player walks into a region.
- Player Break Block: When a player breaks a certain type of block.
- Player Interact: When a player right-clicks a block.
- Player Death: When a player dies.
You link actions to these events inside the Events menu for a specific region.
3. Actions
An Action is what happens when an event is triggered. It's the "what" part of your logic. Actions can do almost anything, including:
Teleport Player: Move a player to a specific location.Give Item: Give a player an item.Send Message: Send a message to a player's chat.Change Property: Modify a game variable (like a player's score).
4. Conditions
A Condition is an optional "if" check. It allows a sequence of actions to run only if specific criteria are met. For example:
- An event
Player Enter Regiontriggers. - A Condition checks if the player has a key in their inventory.
- If the condition is true, the
Open Dooraction runs. If false, aSend Messageaction might run telling them "The door is locked."
5. Properties (Variables)
A Property is a variable for your game. It's a way to store, track, and change information. You can create properties to store things like:
- A player's score.
- The number of lives a player has left.
- Whether a door is locked or unlocked (
true/false). - The current round number.
Actions can read and change the values of these properties, allowing you to create dynamic and stateful game mechanics.
Putting It All Together: An Example
Let's imagine you want to create a simple finish line for a race that awards 10 points.
- Create a Property: Go to the
Propertiesmenu and create a Number property calledScorewith a default value of0. - Create a Region: Use
//wandto select the finish line area, then use/region define FinishLinein your map. - Choose an Event: In the
FinishLineregion's menu, select thePlayer Enter Regionevent. - Add Actions: Add a sequence of actions to this event:
- A
Change Propertyaction to Add10to the triggering player'sScore. - A
Send Messageaction to the player saying "You finished! +10 points!". - A
Teleport Playeraction to move them back to the starting line.
- A
Now, whenever any player enters the FinishLine region, those three actions will run in order. This is the fundamental workflow for building logic in Game Maker!