Variables & Containers - QtFRED Help

# Variables & Containers

Opens via Editors › Variables.

Declares named variables and containers that SEXPs can read and write during the mission. Variables hold a single value; containers hold collections of values. Both are referenced in SEXPs by name and can be used throughout the event system to track state, accumulate data, and communicate between events.

## Variables tab

The main list shows all variables in the mission with their name and default value. String type variables are colored blue while numeric type are color orange. The list is filterable. Use Add, Copy, and Delete to manage entries. Double-click a variable's name or value to edit it inline.

### Variable properties

Field | Description
--- | ---
Name | The identifier used to reference this variable in SEXPs.
Default value | The value the variable starts with at the beginning of the mission.
Type | Number or String. Variables are explicitly typed and the type cannot be changed at runtime.

### Persistence

Controls when a variable's value is saved between missions. The Eternal checkbox (only available when a persistence mode is selected) controls where it is saved: unchecked saves to the campaign file (value is scoped to the current campaign); checked saves to the player's pilot file (value persists across all campaigns and is always available).

Setting | Description
--- | ---
No persistence | The variable exists only for the duration of this mission. Its value is reset each time the mission starts. Eternal is not available.
Save on Mission Completed | The variable's value is saved when the player accepts the mission outcome in the debriefing. If the player quits without accepting, the value is not saved.
Save on Mission Close | The variable's value is saved whenever the mission closes, whether the player accepted, quit, or restarted.

### Network variable

When checked, the variable's value is broadcast to all players whenever it is modified during a multiplayer mission, keeping it synchronized across the session.

## Containers tab

Containers hold collections of values. The upper list shows all containers in the mission and is filterable. List containers are colored blue while map containers are colored orange. Use Add, Copy, and Delete to manage containers. Double-click a container's name to edit it inline. Containers have the same persistence and network settings as variables.

### Container type

Type | Description
--- | ---
List | An ordered sequence of values, all of the same type (Number or String). Items can be added, removed, and iterated in SEXPs.
Map | A collection of key-value pairs where each key maps to a value. Keys and values each have their own type (Number or String, independently). For example, a map with string keys and number values can associate ship names with scores, or a map with string keys and string values can work like a set of named labels. SEXPs access map entries by key.

### Container contents

The lower box shows the contents of the selected container and is also filterable. Use Add, Copy, and Delete to manage entries, and the arrow buttons to reorder them. Double-click a key or value to edit it inline. For Map containers, the Swap button exchanges a key and its value.