# Messages

## What are Messages?

{% tabs %}
{% tab title="About" %}

<figure><img src="https://4251931498-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO_j99BJEXK4zHqxgqS%2F-MiUgE0UMqc6_PVnyCXg%2F-MiV3iV1S3lsV7xHdTYo%2FGMA_GitBook_Logic_Messages_Broasdcast.png?alt=media&#x26;token=ac3b1d59-e4da-4ee0-b8e2-9720caa030bd" alt=""><figcaption></figcaption></figure>

### Messages

Messages are signals used to create a flow of logic between players, objects, and quests. An action triggers a message to be sent, leading to one or more outcomes.

Behaviours and components are bundled logic designed to listen for and broadcast messages.&#x20;

**Example:**

A player's action of pressing the **E** key in front of a door sends the message *Interact*, and the door opening is the outcome.

### Tags

Tags are identifiers attached to objects, making it easy to send a message precisely when needed.

**Example:**

Say you want to change the weather to a specific setup, but have multiple weather objects in the same area that are listening for the same message. Set the message to go to **SpecificTagsInRange**, add the tag you want to send it to, and apply the tag to the Weather Switcher object you want to receive the message.

### Using Messages <a href="#using-messages" id="using-messages"></a>

Some behaviours and components listen for one or several messages to be received. Some allow one or several messages to be sent.

<figure><img src="https://4251931498-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO_j99BJEXK4zHqxgqS%2F-MiUgE0UMqc6_PVnyCXg%2F-MiV5nVMLUADIdGzCtqw%2FGMA_GitBook_Logic_Messages_SentReceived.png?alt=media&#x26;token=5b4df379-f14c-4dbf-a1db-3c04b843f652" alt=""><figcaption></figcaption></figure>

There are many ways to use Game Maker's logic tools to create one or more outcomes from an action. You can create short or long strings of events, and you can also create branching logic that gives players more choice or includes random events that influence other outcomes.
{% endtab %}

{% tab title="Default Messages" %}

### Default Messages  <a href="#default-messages" id="default-messages"></a>

Pressing the **E** key when standing next to an object sends the default message *Interact*.

<figure><img src="https://4251931498-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO_j99BJEXK4zHqxgqS%2F-MiUgE0UMqc6_PVnyCXg%2F-MiUjWyo1srRPhm_Hs5Z%2FGMA_GitBook_Logic_Messages.png?alt=media&#x26;token=d661baf7-baf9-469e-a705-3780385b75b3" alt=""><figcaption></figcaption></figure>

When you apply a Door behaviour to an object, by default the object will listen for the message *Interact* and plays an open animation as an outcome.&#x20;

<figure><img src="https://4251931498-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO_j99BJEXK4zHqxgqS%2F-MiUgE0UMqc6_PVnyCXg%2F-MiUy87euGivd3ZKl4re%2FGMA_GitBook_Logic_Messages_Door.png?alt=media&#x26;token=3aa303f0-d1a4-44d2-9ff9-6cd88c6021ed" alt=""><figcaption></figcaption></figure>

If you open the **Message required** dropdown list in any behaviour or component, you'll see there are other default messages that exist in every Experience you create.

Some of these defaults are automatically bundled into an object's properties (along with default tags) when a behaviour or component is applied. This allows for fast functional gameplay.&#x20;

Default tags and messages can be changed to create customised interactions and unique gameplay mechanics.

**Example:**

You can create factions of soldiers fighting in a battle by changing their **Tags to Attack** and applying the same tag on every object considered to be their enemy.

{% hint style="info" %}
Some default messages will need to be changed to customise your Experience logic.
{% endhint %}
{% endtab %}

{% tab title="Special: Transitions/Controls" %}

### Special Messages with Arguments

Special messages with arguments are used to transition light, sound, and camera effects.

In the message dropdown box of a behaviour or component, select a special message with arguments (yellow text). A parameter will appear to customise the timing, colour, etc.

#### [Play Sound](/en/creator/game-maker/docs/components/audio/play-sound.md) Component

{% hint style="warning" %}
Uploading custom content for use with Video and Audio Streaming behaviours is limited to The Sandbox and select partners. These features are in development for public use.
{% endhint %}

<mark style="color:yellow;">**Audio Pause**</mark> - Fade the audio it is playing to pause.\ <mark style="color:yellow;">**Audio Play**</mark> - Fade the audio it is **NOT** playing to play.\ <mark style="color:yellow;">**AudioStop**</mark> - Fade the audio it is playing to stop.\ <mark style="color:yellow;">**SoundVolume**</mark> - Set audio volume for an object to blend audio.

#### [Light](/en/creator/game-maker/docs/components/display/light.md) Component

<mark style="color:yellow;">**LightColor**</mark> - For a target object with Light Behaviour, fade between the current light setting to a colour chosen in the message's arguments.

#### [Post Process Effects](/en/creator/game-maker/docs/behaviours/visual/post-process-effects.md) Behaviour

<mark style="color:yellow;">**PostProcessFade**</mark> - For a target object with Post Process Effects Behaviour, fade between the current effects setting to the target object's setting.

#### [Weather Switcher](/en/creator/game-maker/docs/behaviours/visual/weather-switcher.md) Behaviour

<mark style="color:yellow;">**WeatherFade**</mark> - For an object with Weather Switcher Behavour, fade between the current weather setting to the target object's setting. Weather changes override defaults set in the [Gameplay](/en/creator/game-maker/docs/build-menus/top-bar/gameplay.md#ambiance) tab of the Gameplay menu.
{% endtab %}

{% tab title="Special: Buffs/Debuffs" %}

### Buff/Debuff Messages with Arguments

There are five default messages available with blue text that are special messages with arguments that trigger buffs/debuffs:

* <mark style="color:blue;">**Attack Power**</mark>
* <mark style="color:blue;">**Damage Resistance**</mark>
* <mark style="color:blue;">**Health**</mark>
* <mark style="color:blue;">**Oxygen**</mark>
* <mark style="color:blue;">**Speed**</mark>

Use positive or negative numbers to increase or decrease these values. Note that these do not stack, and oxygen and health do not exceed the maximum value.

{% hint style="danger" %}
Game Maker 0.9's new buff/debuff system replaced **Heal** and **Damage** messages.
{% endhint %}
{% endtab %}

{% tab title="Custom Messages with Arguments" %}

### Custom Messages with Arguments

Any new message can be created as a normal message or a message with arguments. If you create an argument, you can send additional information with the message, set in the logic from which you send the message. You can also name the argument.

**Example: Collectable Objects Awarding Points** [**(Collect Points Rules Preset)**](/en/creator/game-maker/creative-guides/game-rules-guide/collect-points.md)

The message triggers a rule that awards players points, and each collectable object can specify a different amount of points in the argument to add to your score when the items are collected.
{% endtab %}
{% endtabs %}

{% hint style="info" %}
Messages can be directed in a variety of ways to customise logic. [**Learn more**](/en/creator/game-maker/docs/using-assets-and-objects/behaviour-and-component-parameters.md#creating-custom-messages)
{% endhint %}

## Managing Messages <a href="#creating-custom-messages" id="creating-custom-messages"></a>

{% hint style="info" %}
By default, setting the message to ‘*none*’ is the same as setting a message to empty.
{% endhint %}

{% tabs %}
{% tab title="Use Existing" %}

## Use an Existing Message  <a href="#use-an-existing-message" id="use-an-existing-message"></a>

To use an existing Message in a behaviour or component's logic, click the **Message Required** dropdown and begin typing in the name of the message you wish to use. The list will populate with all the existing related messages. Click a message in the list to select it.

<figure><img src="https://4251931498-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO_j99BJEXK4zHqxgqS%2F-MiUgE0UMqc6_PVnyCXg%2F-MiVEqwNn-JHbKcEgp5N%2FGMA_GitBook_Logic_Messages_ExistingMessage.png?alt=media&#x26;token=1c345702-9643-4cd1-88a3-13bf3720fc34" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Create Custom" %}

## Create a Custom Message  <a href="#creating-custom-messages" id="creating-custom-messages"></a>

To create a new message to use in a behaviour or component's logic, click **ADD+** if no message is applied yet or click on the existing message.&#x20;

This will open a dropdown list of existing messages. Begin typing the message you wish to add. Click the green text <mark style="color:green;">**ADD 'your message'**</mark> to apply it.

<figure><img src="https://4251931498-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO_j99BJEXK4zHqxgqS%2F-MiUgE0UMqc6_PVnyCXg%2F-MiV7O4cTVV5vAdBtBZd%2FGMA_GitBook_Logic_Messages_AddMessage.png?alt=media&#x26;token=05249415-1bd2-4821-90ab-61845a876fbe" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Remove from Object" %}

## Remove a Message from an Object's Logic  <a href="#delete-a-message" id="delete-a-message"></a>

To remove a message from a behaviour or component, click the **X** to the right of the message.

<figure><img src="https://4251931498-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO_j99BJEXK4zHqxgqS%2F-MiUgE0UMqc6_PVnyCXg%2F-MiV9HulZzfMDQYLS7fJ%2FGMA_GitBook_Logic_Messages_DeleteMessage.png?alt=media&#x26;token=1ca6ed41-d82e-4a21-8a58-a892f40fa505" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Delete from List" %}

## Delete a Message from the Experience's Message List

In the top right corner of Game Maker, click on the gear icon to open **Settings**. There you will be able to access a list of all messages included in your Experience and delete any custom messages you've created.
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sandbox.game/en/creator/game-maker/docs/using-assets-and-objects/messages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
