# Field

### Introduction

**Field** contains the attributes of an app. With these fields, you can view the Space, maps, or user information, or you can store values for later.

🔒 Fields with this icon are read-only fields that cannot be revised.

<table><thead><tr><th width="207">Name</th><th>Description</th></tr></thead><tbody><tr><td>🔒 spaceHashID</td><td>Outputs the hash value of the Space where the app is installed</td></tr><tr><td>🔒 mapHashID</td><td>Outputs the hash value of the map where the app is installed</td></tr><tr><td>🔒 creatorID</td><td>Calls the ID value of the player who executed the app</td></tr><tr><td>🔒 players</td><td>Calls a list of all players on the map as an array</td></tr><tr><td>🔒 playerCount</td><td>Calls the number of all players on the map where the app is installed</td></tr><tr><td>cameraEffect</td><td>Variable value to set the type of camera effect</td></tr><tr><td>cameraEffectParam</td><td>Range value of camera effect</td></tr><tr><td>displayRatio</td><td>Value to control display zooming</td></tr><tr><td>storage</td><td>App value storage space in the Space (Space limited)</td></tr><tr><td>followPlayer</td><td>Determines if the app’s follow function is enabled</td></tr><tr><td>showName</td><td>Determines if the player's nickname is hidden</td></tr><tr><td>🔒 appHashID</td><td>Calls the hash value of the app</td></tr></tbody></table>

## 📚 API Description and Example

### spaceHashID & mapHashID

{% hint style="info" %}
App.spaceHashID: String App.mapHashID: String
{% endhint %}

This calls spaceHashID and mapHashID of the Space where an app is installed. ([<mark style="color:purple;">Understanding Spaces and Maps</mark>](/zep-script/zep-script-guide/appendix/understanding-spaces-and-maps.md))

**Example**

Display spaceHashID and mapHashID of the map where an app is installed.

```jsx
// Activates function when a player enters
App.onJoinPlayer.Add(function(player){
  // Displays spaceHashID and mapHashID in the chat window
	App.sayToAll(`spaceHashID: ${App.spaceHashID}`); // spaceHashID: Ak42Xz
	App.sayToAll(`mapHashID: ${App.mapHashID}`) // mapHashId: 25g3RQ
})
```

### creatorID

{% hint style="info" %}
App.creatorID: Number
{% endhint %}

This calls the ID value of the player who executed the app.

**Example**

Display the nickname of the player who executed the app.

```jsx
// Activates function when a player enters
App.onJoinPlayer.Add(function(player){
  if(player.id == App.creatorID){
		App.sayToAll(`${player.name} has executed the app.`)
	}
})
```

### players

{% hint style="info" %}
App.players: ScriptPlayer\[]
{% endhint %}

This calls a list of all players on the map as an array.

**Example**

Display the nicknames of all players on the map.

```jsx
// Activates function when q is pressed
// App.addOnKeyDown
App.addOnKeyDown(81,function(p){
	//Displays the nicknames of all players in the chat window via App.players
	let players = App.players;
	for(let i in players){
		let player = players[i]
		App.sayToAll(player.name)
	}
})
```

### playerCount

{% hint style="info" %}
App.playerCount: Number
{% endhint %}

This calls the number of all players on the map where the app is installed

**Example**

Display the number of all players on the map.

```jsx
// Activates function when q is pressed
// App.addOnKeyDown
App.addOnKeyDown(81,function(p){
	// Displays the number of all current players
	App.sayToAll(`the number of all current players: ${App.playerCount}`)
})
```

### cameraEffect & cameraEffectParam1

{% hint style="info" %}
App.cameraEffect: NONE = 0, SPOTLIGHT = 1 \
App.cameraEffectParam1: Number
{% endhint %}

App.cameraEffect: variable value to set the type of camera effect

App.cameraEffectParam1: range value of camera effect

**Example**

Make a function to turn the vignette effect on/off.

```jsx
// Activates function when q is pressed
// Press once to turn the vignetting on and press twice to turn off
// App.addOnKeyDown
App.addOnKeyDown(81,function(p){
	if(App.cameraEffect == 0){
		App.cameraEffect = 1; // 1 = vignette effect
		App.cameraEffectParam1 = 500; // Sets the range of the vignette effect to 500
	}
	else if(App.cameraEffect == 1){
		App.cameraEffect = 0; // Turns off the vignette effect
	}
	App.sendUpdated(); // When the app's Field Value is changed, new values are applied using App.sendUpdated()
})
```

<div align="left"><figure><img src="/files/ND5elgkcpcIv7KlnZ9Th" alt=""><figcaption><p>Figure of the vignette effect range set to 500</p></figcaption></figure></div>

### displayRatio

{% hint style="info" %}
App.displayRatio: Number
{% endhint %}

Value to control display zooming (default value: 1)

**Example**

Bind a zoom function to q to control display zooming.

```jsx
// Activates function when q is pressed
// Press once to zoom in and press twice to return to the original state
// App.addOnKeyDown
App.addOnKeyDown(81,function(p){
	if(App.displayRatio == 1){
		*App.displayRatio = 5;*
	}else{
		*App.displayRatio = 1;
	}
	App.sendUpdated(); //* When the app's Field Value is changed, new values are applied using App.sendUpdated()
})
```

<div align="left"><figure><img src="/files/GsgrHegpKd5fv84LD9ba" alt=""><figcaption><p>When displayRatio is set to 5</p></figcaption></figure> <figure><img src="/files/f7lwMtN5AyYuyhBLT3Fl" alt=""><figcaption><p>When displayRatio is set to 1</p></figcaption></figure></div>

### storage

{% hint style="info" %}
App.storage: String
{% endhint %}

App value storage space in the Space (Space limited)

**Example**

Save a simple text to App storage.

{% hint style="success" %}
Saved values don’t disappear even though the app ends
{% endhint %}

```jsx
// Activates function when q is pressed
// App.addOnKeyDown
App.addOnKeyDown(81,function(p){
	App.storage = "data";
	App.save(); // When the storage value is changed, new values are applied using App.save()
})

// Activates function upon pressing w
App.addOnKeyDown(87,function(p){
	App.sayToAll(App.storage); // Displays the value stored in App storage to the chat window
})
```

### followPlayer

{% hint style="info" %}
App.followPlayer: Boolean
{% endhint %}

This shows whether the app’s follow function is enabled (default value: false)

When normal apps or Mini-Game apps are running, the “follow” function becomes deactivated as followPlayer value is set to false.

**Example**

Make a function to turn the follow function on or off.

```jsx
// Activates function when q is pressed
// Key function that changes the followPlayer value
// App.addOnKeyDown explanation 
App.addOnKeyDown(81,function(p){
	if(App.followPlayer){
		App.followPlayer = false;
	}else{
		App.followPlayer = true;
	*}*
	App.sayToAll(`App.followPlayer: ${App.followPlayer}`)
	*App.sendUpdated(); //* When the app's Field Value is changed, new values are applied using App.sendUpdated()
})
```

***

### showName

{% hint style="info" %}
&#x20;App.showName: Boolean
{% endhint %}

This shows whether the player's nickname is hidden.

When App.showName is set to false, the nickcnames of all players are hidden.

**Example**

```jsx
// Activates function when q is pressed
// Key function that changes the showName value
App.addOnKeyDown(81,function(p){
	if(App.showName){
		App.showName = false;
	}else{
		App.showName = true;
	}
	App.sayToAll(`App.showName: ${App.showName}`)
	App.sendUpdated(); //When the app's Field Value is changed, new values are applied using App.sendUpdated()
})

```

### appHashID

{% hint style="info" %}
App.appHashID: String&#x20;
{% endhint %}

This calls the hash value of the app

**Example**

Display the app's HashID to the chat window.

```jsx
// Activates function when a player enters
App.onJoinPlayer.Add(function(player){
	App.sayToAll(`appHashID: ${App.appHashID}`); 
})
```

### Appendix

[<mark style="color:purple;">Understanding Spaces and Maps</mark>](/zep-script/zep-script-guide/appendix/understanding-spaces-and-maps.md)


---

# 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-api/scriptapp/field.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.
