# Forge Ambient Module

## Overview
The Ambient module provides environmental sound management for the Forge client system. It enables the creation and management of ambient sound effects in the game environment, enhancing the immersive experience for players.

## Dependencies
- forge_client_main

## Authors
- J. Schmidt
- Creedcoder
- IDSolutions

## Features

### Sound Management
1. **Ambient Sound System** (`fnc_ambientSound.sqf`)
   - Creates and manages sound sources in the game world
   - Handles sound effect playback and cleanup
   - Supports timed and continuous sound effects

2. **Sound Source Features**
   - Dynamic sound source creation
   - Position-based sound placement
   - Automatic cleanup of sound sources
   - Support for various sound types and durations

3. **Sound Control**
   - Lifecycle management of sound sources
   - Automatic cleanup when source is destroyed
   - Configurable sound duration
   - Position tracking for moving sound sources

## Event Handlers
The module uses several event handlers for initialization and execution:
- `XEH_preInit.sqf`: Pre-initialization setup
- `XEH_postInit.sqf`: Post-initialization tasks
- `XEH_preStart.sqf`: Pre-start configuration
- `XEH_postInit_client.sqf`: Client-specific post-initialization
- `XEH_preInit_server.sqf`: Server-specific pre-initialization

## Usage
To use the ambient module:
1. Ensure the module is properly loaded in your mission
2. Create sound sources using the ambient sound function:
   ```sqf
   [source, "sfx_sound_name"] spawn forge_client_ambient_fnc_ambientSound
   ```
3. Optionally specify a duration for temporary sounds:
   ```sqf
   [source, "sfx_sound_name", duration] spawn forge_client_ambient_fnc_ambientSound
   ```

## Parameters
The ambient sound function accepts the following parameters:
1. `source`: The object or position where the sound will be played
2. `sfx`: The name of the sound effect to play
3. `time` (optional): Duration in seconds before the sound is removed

## Debugging
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
```cpp
#define DEBUG_MODE_FULL
```

## Version Information
Version information is managed through the main Forge client system configuration.

## Technical Details
- Supports both object-attached and position-based sound sources
- Automatic cleanup of sound sources when source is destroyed
- Configurable sound duration for temporary effects
- Efficient sound source management
- Client-side sound processing 