# TileEffectType Detailed Explanation

This page explains how to use Tile Effects (TileEffectType) when using the function `Map.putTileEffect`. For more information on Tile Effects, please refer to the link provided below.

:fire: [<mark style="color:purple;">**Tile Effects**</mark>](broken://pages/mLgIqpsZNwnpWkSA5B7A)

## 📗 Basic Tile Effects

### TileEffectType.NONE

A tile effect that has no effect.

**Example**

```jsx
//Erases tile effects on the specified coordinates
Map.putTileEffect(x, y, TileEffectType.NONE);
```

### **TileEffectType.IMPASSABLE**

A tile effect that does not allow users to pass.

**Example**

```jsx
//Sets an IMPASSABLE tile effect on the corresponding coordinates
Map.putTileEffect(x, y, TileEffectType.IMPASSABLE);
```

### **TileEffectType.SPAWN**

A tile effect that spawns users to a coordinate when the user enters the map.

**Example**

```jsx
//Sets the SPAWN tile effect on the corresponding coordinates
Map.putTileEffect(x, y, TileEffectType.SPAWN);
```

## 🌀 Portal Tile Effects

### TileEffectType.PORTAL

A tile effect that moves users to a **different specified location area** or a **different map within the space**.

**Parameter**

<table><thead><tr><th width="163.33333333333331">Name</th><th width="99">Type</th><th>Description</th></tr></thead><tbody><tr><td>type</td><td>Number</td><td>When the type is 0, can set a portal tile that allows players to another map within the Space.<br>When the type is 1, can set a portal tile that allows players to move to another specific location within the map.</td></tr><tr><td>targetMapID</td><td>String</td><td>The MapID value of the target map</td></tr><tr><td>label</td><td>String</td><td>The text value to display over the portal</td></tr><tr><td>triggerByTouch</td><td>Boolean</td><td>When true: activates when contact is made<br>When false: activates when f is pressed</td></tr><tr><td>invisible</td><td>Boolean</td><td>When true: hide the default portal image<br>When false: show the default portal image</td></tr><tr><td>locationName</td><td>String</td><td>Value of the target location’s name (If type is 1, this value is a required field.)</td></tr></tbody></table>

**Example**

{% code overflow="wrap" %}

```jsx
// when type: 0
// Installs a portal tile that leads to another map in the Space
Map.putTileEffect(x, y, TileEffectType.PORTAL, {
	type: 0, // Required 
	locationName: "TEST",  // Optional
	targetMapID: "gyV1N2", // Required 
	label: "PORTAL-TYPE0", // Optional
  triggerByTouch: true // Optional, "false" is default
});

// If type: 1
// Installs a portal tile that leads to a target area in the same map
Map.putTileEffect(x, y, TileEffectType.PORTAL, {
	type: 1, // Required 
	label: "PORTAL-TYPE1",  // Optional
	locationName: "TEST", // Required 
	invisible: true, // Optional, hiding the default portal image
	triggerByTouch: true  // Optional, "false" is default
});
```

{% endcode %}

### TileEffectType.SPACE\_PORTAL

A tile effect that moves participants to another Space.

**Parameter**

<table><thead><tr><th width="171.33333333333331">Name</th><th width="124">Type</th><th>Description</th></tr></thead><tbody><tr><td>label</td><td>String</td><td>The text value to display over the portal</td></tr><tr><td>targetMapID</td><td>String</td><td><p>The SpaceID value of the target Space</p><p>https://zep.us/play/[Space ID]</p></td></tr><tr><td>locationName</td><td>String </td><td>Value of the target location’s name</td></tr><tr><td>triggerByTouch </td><td>Boolean </td><td>When true: activates when contact is made<br>When false: activates when f is pressed</td></tr><tr><td>invisible</td><td>Boolean</td><td>When true: hide the default portal image<br>When false: show the default portal image</td></tr></tbody></table>

**Example**

```jsx
// Installs a portal tile that leads to another Space
Map.putTileEffect(x, y, TileEffectType.SPACE_PORTAL, {
	label: "SPACE_PORTAL",  // Optional
	targetMapID: "zydmYD", //Required 
	locationName: "SPACE1",  // Optional
	invisible: true,  // Optional, "false" is default
	triggerByTouch: true,  // Optional, "false" is default
});
```

## 🌐 Embed Tile Effects

### TileEffectType.EMBED

A tile effect that opens a web link in a new window.

**Parameter**

<table><thead><tr><th width="164.33333333333331">Name</th><th width="111">Type</th><th>Description</th></tr></thead><tbody><tr><td>link</td><td>String</td><td>Value of the web URL</td></tr><tr><td>align2</td><td>String</td><td>Location where to show the window<br>’popup’, ‘sidebar’, ‘top’, ‘topleft’, ‘topright’, ‘middle’, ‘middleleft’, ‘middleright’, ‘bottom’, ‘bottomleft’, ‘bottomright’</td></tr><tr><td>label</td><td>String</td><td>The text value to display over the portal</td></tr><tr><td>triggerByTouch</td><td>Boolean</td><td>When true: activates when contact is made<br>When false: activates when f is pressed</td></tr><tr><td>invisible</td><td>Boolean</td><td>When true: hide the default portal image<br>When false: show the default portal image</td></tr></tbody></table>

**Example**

<pre class="language-jsx"><code class="lang-jsx">// Installs a portal effect that opens a web link in a new window
Map.putTileEffect(x, y, TileEffectType.EMBED, {
	link: "https://zep.us/", // Required
	align2: "top", // Required
<strong>	label: "ZEP-SCRIPT-EMBED",  // Optional
</strong>});
</code></pre>

### TileEffectType.WEB\_PORTAL

A tile effect that opens a web link in a new tab.

**Parameter**

<table><thead><tr><th width="119.33333333333331">Name</th><th width="113">Type</th><th>Description</th></tr></thead><tbody><tr><td>link</td><td>String</td><td>Value of the web URL</td></tr><tr><td>label</td><td>String</td><td>The text value to display over the portal</td></tr><tr><td>invisible</td><td>Boolean</td><td>When true: hide the default portal image<br>When false: show the default portal image</td></tr></tbody></table>

**Example**

```jsx
// Installs a tile effect that opens a web link in a new tab.
Map.putTileEffect(x, y, TileEffectType.WEB_PORTAL, {
	link: "https://zep.us/", // Required
	label: "ZEP-SCRIPT-WEB-PORTAL", // Optional
	invisible: true, // Optional, "false" is default
});
```

### TileEffectType.TILE\_EMBED

A tile effect that embeds a web URL in a designated area.

**Parameter**

<table><thead><tr><th width="135.33333333333331">Name</th><th width="126">Type</th><th>Description</th></tr></thead><tbody><tr><td>link</td><td>String</td><td>Value of the web URL</td></tr><tr><td>width</td><td>number</td><td>Width of the designated area (number of tiles)</td></tr><tr><td>height</td><td>number</td><td>Height of the designated area (number of tiles)</td></tr></tbody></table>

**Example**

```jsx
// Installs a web in a designated area
Map.putTileEffect(x, y, TileEffectType.TILE_EMBED, {
	link: "https://zep.us/", // Required 
	width: 5, // Required 
	height: 5, // Required 
});
```

## 💠 Utility Tile Effects

### TileEffectType.PRIVATE\_AREA

A tile effect that has a private area effect.

**Parameter**

<table><thead><tr><th width="136.33333333333331">Name</th><th width="103">Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>Number</td><td>ID Value of the private area</td></tr><tr><td>impassable</td><td>Boolean</td><td>When true: sets the private area "impassable"</td></tr><tr><td>param1</td><td>String</td><td>When param1 is "true", only one person is allowed per tile</td></tr></tbody></table>

**Example**

```jsx
// Installs a private area in the designated coordinates
Map.putTileEffect(18, 15, TileEffectType.PRIVATE_AREA, {
		id: 3, // Required
		impassable: false,  // Optional, "false" is default
		param1: "true",   // Optional, "false" is default
	});
```

### TileEffectType.LOCATION

A tile effect for a map location.

**Parameter**

<table><thead><tr><th width="132.33333333333331">Name</th><th width="144">Type</th><th>Description</th></tr></thead><tbody><tr><td>label</td><td>String</td><td>The text value to display over the tile</td></tr><tr><td>name</td><td>String</td><td>Name of the map location</td></tr><tr><td>width</td><td>number</td><td>Width of the designated area (number of tiles)</td></tr><tr><td>height</td><td>number</td><td>Height of the designated area (number of tiles)</td></tr></tbody></table>

**Example**

```jsx
// Installs a map location in the designated coordinates
Map.putTileEffect(x, y, TileEffectType.LOCATION, {
	label: "LOCATION",  // Optional
	name: "zep-script-location", // Required 
	width: 3, // Required 
	height: 2, // Required 
});
```

### TileEffectType.AMBIENT\_SOUND

A tile effect for ambient sound.

**Parameter**

<table><thead><tr><th width="177.33333333333331">Name</th><th width="141">Type</th><th>Description</th></tr></thead><tbody><tr><td>link</td><td>String</td><td>Name of the sound file to play (included in the ZIP file)</td></tr><tr><td>activeDistance</td><td>Number</td><td>Radius of ambient sound (number of tiles)</td></tr><tr><td>triggerByTouch</td><td>Boolean</td><td>When true: activates when contact is made<br>When false: activates when f is pressed</td></tr></tbody></table>

**Example**

```jsx
Map.putTileEffect(x, y, TileEffectType.AMBIENT_SOUND, {
	link: "ring.mp3", // Required 
	activeDistance: 1, // Required
	triggerByTouch: false, // Optional
});
```


---

# 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.zep.us/zep-script/zep-script-guide/appendix/tileeffecttype-detailed-explanation.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.
