# Multiplay Guide

MudBringer was built from the ground up to run multiple characters simultaneously. This guide covers the full multiplay experience â€” from opening your first session, through window management and layout, to advanced dashboard configuration, script sharing, and profile management.

---
## Sessions & Characters
### Opening Sessions

Every character you play runs inside a **session**. MudBringer supports running as many simultaneous sessions as your machine can handle, all within a single application window.

**Opening a new session:**
- Use the **Character Manager** (Ctrl+N) to select a character and connect
- Via script: `/session {Name} {host} {port}`
- Each session gets its own terminal, script engine, and connection

**Session Names vs. Character Names:**
A session has two names:
- **Character Name** â€” The character's identity, tied to the saved character file
- **Session Name** â€” A customizable runtime label for this connection (defaults to the character name)

You can change the session name at any time via the Session Settings without affecting the character file. This is useful for disambiguation when running the same character multiple times.

---
## Window Layout
### Tabbed Interface

All sessions live as **tabs** along the top of the main window. Click a tab to switch between sessions. The active tab's terminal fills the main content area.

**Keyboard shortcuts:**
- **Ctrl+Tab** / **Ctrl+Shift+Tab** â€” Cycle through session tabs
- **Ctrl+Left Click** on a tab â€” Hydrate that session (Focus Mode)
- **Escape** â€” Exit hydration / Return to normal view
### Grid Layout

For a side-by-side multiplay experience, you can **split the main window into a grid** showing multiple sessions at once. This is ideal for monitoring several characters without tab-switching.

The grid is resizable â€” drag the splitters between panes to give more space to your primary character while keeping others visible.
### Multi-Monitor Support

Floating dashboards (see below) can be positioned on **any monitor**, letting you spread your multiplay setup across your entire desktop. Use `/dashpos` to place a dashboard at exact screen coordinates:

```
/dashpos {GroupStats} {1920} {0} {600} {400}
```

This places a dashboard on your second monitor (assuming 1920px wide primary). Dashboards remember their position and restore automatically when you reload your profile.

---
## The Input Bar & Status Bar
### Input Bar

The input bar at the bottom of each session is where you type commands. Every session has its own input bar with command history (Up/Down arrows).
### Status Bar

The **status bar** is a customizable text overlay that displays real-time information. It's built from **bar items** â€” named text slots at specific positions:

```
/baritem {hp} {HP: $hp/$maxhp} {1} {20}
/baritem {mana} {Mana: $mana/$maxmana} {1} {40}
/baritem {gold} {Gold: $gold} {1} {60}
```

**Positioning the status bar:**
```
/statusbar {above}     â€” Above the terminal
/statusbar {below}     â€” Below the terminal (default)
/statusbar {off}       â€” Hide it
```

**Sizing the status bar:**
```
/statusbarsize {2} {80}  â€” 2 lines tall, 80 characters wide
```

Bar items update automatically whenever their embedded variables change, making them perfect for HP/Mana/Gold displays that stay current without any polling.

**Status Bar Wizard:** Right-click the status bar or use the **Tablet** panel to open the Status Bar Wizard for visual configuration.

---
## Focus Mode (Hydration)

Focus Mode is MudBringer's solution to the "I need to quickly do something on another character" problem. Instead of hunting for a tab, hydration **instantly switches your entire view** to a single session with a clean, minimal interface.
### How It Works

```
/hydrate {Baldy}
```
Or **Ctrl+Left Click** on any session tab.

The main window transforms: the tab bar collapses, the terminal expands to fill the screen, and only the input bar and optional dashboards remain visible. It's designed for rapid action â€” glance at the character, type a command, and get back.

**Exiting Focus Mode:** Press **Escape** or click the hydration toggle.
### Hydration-Aware Dashboards

Dashboards can have **separate docking positions** for normal view and hydrated view. For example, a map dashboard might dock to the right in normal view, but switch to floating when hydrated:

```
/dashdock {Map} {Right}
/dashdockhydrate {Map} {Floating}
```

This means your dashboard layout automatically adapts when you focus on a different character.
### The Primary Session

One session is always designated as the **primary** session. This determines which session gets focus when the profile loads:

```
/setprimary
```

The primary session is saved at the profile level and persists across restarts.
### Hydration Options

Each character can configure their hydrated experience:
- **Hydrated Font Size** â€” Larger text for quick-glance readability
- **Hydrated Opacity** â€” Semi-transparent backgrounds for overlay-style play
- **Show Hydration Button** â€” Toggle the quick-access hydration button on the tab bar

These are configured per-character in the **Character Manager â†’ Terminal Options**.

---
## The Focus Command

While hydration changes the visual layout, `/focus` provides **programmatic session switching** â€” ideal for scripted workflows:

```
/focus {Baldy}
```

This brings the specified session's window to the foreground and automatically places the cursor in its input bar. It accepts session name, character name, or session ID (case-insensitive).

**Use case:** An action on your main character detects a condition and auto-focuses to the character that needs attention:
```
/action {^Baldy is under attack!} {/focus {Baldy}}
```

---
## Sending Commands Across Sessions
### The /window Command

`/window` sends a command to be executed on another session's script engine:

```
/window {Baldy} {cast heal self}
/window {Blindy} {/var {alert} {Incoming!}}
```

**Important:** Procedures and aliases are evaluated by the **target's** engine. Variables are evaluated by the **sender's** engine. This means `$myhp` in a `/window` command resolves to YOUR HP, not the target's.
### The /showother Command

Need to display a message in another session's terminal without sending it to the server?

```
/showother {Baldy} {--- Group forming at fountain ---}
```

This is purely local â€” the target session sees the text, but nothing goes to the MUD.

---
## Delegation Groups

Delegation groups let you organize sessions into named teams (e.g., Healers, Tanks, Utility) and send commands to everyone in a group at once.

**Setting up groups:**
```
/delegation {Healers,GroupA}     â€” This session joins the Healers and GroupA groups
```

Once groups are configured, use `/window` with a group name to broadcast:
```
/window {Healers} {cast group heal}
```

Every session in the "Healers" group executes the command. Groups are the foundation of the **Poll Suite** and **Cross-Session Data Sharing** â€” see the `/help G_CrossSessionData` guide for details.
### Quick-Send with Alternate Input

You don't have to type `/window` every time. MudBringer provides **alternate Enter shortcuts** that route your input bar command directly to delegation groups:

| Shortcut | Target |
|---|---|
| **Enter** | Normal â€” sends to the current session |
| **Alt+Enter** | Sends to **all** sessions in your delegation groups |
| **Shift+Enter** | Sends to **Delegation Group A** only |
| **Ctrl+Enter** | Sends to **Delegation Group B** only |
| **Ctrl+Shift+Enter** | Sends to **Delegation Group C** only |

This is the fastest way to multiplay. Type `cast heal self` and hit **Alt+Enter** â€” every character in your delegation groups casts the spell. Hit **Shift+Enter** to target just one team. No commands, no aliases, just muscle memory.

**Example workflow:** You're leading a group. You type `follow Baldy` and hit **Alt+Enter**. Everyone follows. You type `cast shield` and hit **Shift+Enter** â€” only the Tanks group buffs up. You type `cast invisibility` and hit **Ctrl+Enter** â€” only the Utility group goes invisible.

---
## Dashboards

Dashboards are MudBringer's most powerful UI feature for multiplay. They're floating or docked panels that display real-time data, buttons, progress bars, and more â€” all scriptable and shareable.
### Creating a Dashboard

```
/dashboard {GroupHP} {10} {10} {0.9}
```

This creates a dashboard named "GroupHP" with a 10Ã—10 grid at 90% opacity.
### Adding Items

Dashboards support several item types:

| Type | Description |
|---|---|
| `button` | Clickable button that executes a command |
| `percentbar` | Progress bar with dynamic min/max/value |
| `textbar` | Single-line text display |
| `textbox` | Multi-line text area |
| `nested` | Embed another dashboard inside this one |

```
/dashadd {GroupHP} {percentbar} {0} {0} {1} {10} {BaldyHP} {0} {500} {Baldy.myhp} {Red:25,Yellow:50,Green:100} {1} {percent} {12.0} {White}
/dashadd {GroupHP} {button} {1} {0} {1} {2} {HealAll} {Heal All}
```
### Docking & Positioning

Dashboards can dock to any edge of the main window or float freely:

```
/dashdock {GroupHP} {Right}         â€” Dock to the right edge
/dashdock {GroupHP} {Floating}      â€” Float as a separate window
/dashpos {GroupHP} {100} {100} {400} {300}  â€” Position floating dashboard
/dashontop {GroupHP} {1}            â€” Always on top
```
### The Dashboard Wizard

For visual dashboard design, use the **Dashboard Wizard** â€” accessible from the Tablet panel or by right-clicking a dashboard. The wizard provides:

- **Live preview** of your dashboard layout
- **Drag-and-drop** element placement on the grid
- **Property editing** for colors, fonts, and data bindings
- **Layer management** including image layers with opacity
- **Export/Import** to share dashboards with other characters or other players
### Dashboard Opacity

Every dashboard supports transparency (0.0 = invisible, 1.0 = fully opaque):

```
/dashset {GroupHP} {opacity} {0.7}
```

This is perfect for overlay-style dashboards that float on top of other windows without fully obscuring content.
### Showing and Hiding

```
/showdashboard {GroupHP}
/hidedashboard {GroupHP}
```

Dashboards can be shown/hidden via script, making them context-sensitive. Show a combat dashboard when fighting, hide it when exploring.

---
## Script Management
### Script Groups

Every script entity (actions, aliases, events, gags, highlights, macros, substitutes) belongs to a **group**. Groups let you organize and control scripts in bulk:

```
/enablegroup {combat}        â€” Enable all scripts in the "combat" group
/disablegroup {combat}       â€” Disable all scripts in the "combat" group
/killgroup {combat}          â€” Delete all scripts in the "combat" group
```

You can view scripts by group:
```
/groupactions {combat}
/groupaliases {combat}
/groupmacros {combat}
```
### Sharing Scripts Between Characters

Every script wizard (Actions, Aliases, Events, etc.) includes **Export** functionality:

- **Export to Character** â€” Copies a script group directly to another character in your profile. The scripts are merged into the target's file immediately.
- **Export to File** â€” Saves a script group as a portable `.mud` file that can be shared with anyone.

**Import:** Use `/load {filename}` to import a `.mud` file into any session.

This makes it easy to develop scripts on your main character and distribute them to alts â€” or share a complete automation package with other players.
### Dashboard Sharing

The **Share Dashboard** dialog lets you copy an entire dashboard configuration (layout, items, bindings) to other characters in your profile with one click. Combined with the Dashboard Wizard's export feature, you can share dashboards externally as well.

---
## Profile Management
### What's in a Profile?

A MudBringer profile is the top-level container for your entire multiplay setup:

- **Characters** â€” Each with their own scripts, variables, settings, and connection info
- **Window Arrangements** â€” Tab positions, grid layout, and dashboard docking
- **Primary Session** â€” Which character gets focus on load
- **Shared Settings** â€” Anything that applies across all characters
### Saving & Loading

- **Auto-save:** MudBringer auto-saves your session on disconnect and when closing
- **Manual save:** `/save` saves the current session's scripts and settings
- **Profile selection:** On startup, MudBringer presents the Profile Selection screen to choose or create a profile
### Window Arrangement Persistence

Your entire window layout is saved with the profile:
- Which sessions were open and their tab order
- Dashboard positions, docking states, and visibility
- Grid/split configurations
- The primary session designation

When you reload the profile, everything restores exactly as you left it.

---
## The Reference Tablet

The **Tablet** is a collapsible side panel that provides quick access to wizards and script management without leaving your session:

```
/tablet       â€” Toggle the Tablet panel
```

From the Tablet you can launch any wizard (Action, Alias, Dashboard, etc.), view and manage scripts, and access help â€” all without switching windows or losing your terminal view.

---
## Multi-Session Variables Dashboard

The **Variables Dashboard** is a centralized command center for managing data across your entire multiplay setup. From a single interface you can:

- **Browse** variables, lists, and arrays for every active session
- **Inspect** shared (global) and group-scoped data alongside local session data
- **Create, edit, and delete** values across any delegation group or individual session
- **Monitor changes** in real time as scripts update values

The dashboard gives you a bird's-eye view of your multiplay state â€” see every character's HP, inventory counts, and custom tracking variables at a glance, and intervene directly when needed.
### Variable Pickers in Wizards

Every script wizard (Actions, Aliases, Events, Dashboards, etc.) includes integrated **variable pickers** that are aware of shared, group, and cross-session data. When building a dashboard or writing an action, you can browse and select variables from:

- Your local session's variables, lists, and arrays
- Shared (`$shared.*`) global variables
- Group-scoped variables (`@GroupVar`)
- Other sessions' variables (`$SessionName.*`)

This eliminates guesswork â€” no need to remember exact variable names or syntax. Pick from a live list and the correct reference is inserted for you.

---
## Multi-Session Automapper Tracking

MudBringer's Automapper is fully multi-session aware. When running multiple characters, the map tracks **every character's position simultaneously**, giving you a real-time tactical overview of your entire group.
### What You See

- **Your position** is shown with the standard marker
- **Other sessions** appear as labeled markers on the same map, each identified by their session name
- Move any character and their marker updates in real time on every other session's map view

This means your healer can see exactly where the tank is, your scout can see if the group has caught up, and your leader can monitor everyone's position without asking.
### MMCP Friend Tracking

Multi-session tracking extends beyond your own characters. With **MMCP (MudBringer Multi-Client Protocol)** chat connections, you can see the positions of **friends running their own MudBringer instances** on the same MUD â€” even on different machines.

Connected MMCP peers who are playing on the same server and have the same map loaded will appear as markers on your map, just like your own characters. Coordinate raids, plan rendezvous points, and track your party across the world â€” all without third-party tools.

---
## Quick Reference
### Session Commands
| Command | Description |
|---|---|
| `/session {name} {host} {port}` | Open a new session |
| `/focus {name}` | Switch focus to a session |
| `/hydrate {name}` | Enter Focus Mode for a session |
| `/setprimary` | Set current session as primary |
| `/window {name} {cmd}` | Execute a command on another session |
| `/showother {name} {text}` | Display text in another session's terminal |
| `/delegation {groups}` | Set this session's delegation groups |
| `/close` | Close the current session |
### Layout Commands
| Command | Description |
|---|---|
| `/statusbar {above\|below\|off}` | Position the status bar |
| `/statusbarsize {lines} {width}` | Resize the status bar |
| `/tablet` | Toggle the Reference Tablet |
| `/baritem {name} {text} {pos} {len}` | Add a status bar item |
### Dashboard Commands
| Command | Description |
|---|---|
| `/dashboard {name} {r} {c} {opacity}` | Create a dashboard |
| `/dashadd {dash} {type} {r} {c} ...` | Add an item to a dashboard |
| `/dashdock {dash} {mode}` | Dock a dashboard |
| `/dashdockhydrate {dash} {mode}` | Set hydrated docking |
| `/dashpos {dash} {x} {y} {w} {h}` | Position a floating dashboard |
| `/dashontop {dash} {1\|0}` | Toggle always-on-top |
| `/dashset {dash} {prop} {val}` | Modify dashboard properties |
| `/dashtext {dash.item} {text}` | Update dashboard text |
| `/dashgrid {dash} {def}` | Custom grid scaling |
| `/showdashboard {dash}` | Show a dashboard |
| `/hidedashboard {dash}` | Hide a dashboard |
| `/dashboards` | List all dashboards |
| `/dashstatus` | Technical dashboard summary |
### Keyboard Shortcuts
| Shortcut | Action |
|---|---|
| **Ctrl+Tab** | Next session tab |
| **Ctrl+Shift+Tab** | Previous session tab |
| **Ctrl+N** | Character Manager |
| **Ctrl+Left Click** (tab) | Hydrate session |
| **Escape** | Exit Focus Mode |
| **Up/Down** | Command history |
| **Alt+Enter** | Send to all delegation groups |
| **Shift+Enter** | Send to Delegation Group A |
| **Ctrl+Enter** | Send to Delegation Group B |
| **Ctrl+Shift+Enter** | Send to Delegation Group C |
### Related Guides
| Guide | Topic |
|---|---|
| `/help G_CrossSessionData` | Variables, polling, and data sharing across sessions |
| `/help commands` | Full command catalog |
| `/help procedures` | Full procedure catalog |
