client/addons/ambient/README.md
Jacob Schmidt 9936d6ddc3
All checks were successful
Build / Build (push) Successful in 28s
feat: Enhance module documentation and features
This commit updates the documentation for several Forge modules, adding comprehensive details about their functionalities, user interfaces, and integration with other systems. Key enhancements include:

- Expanded descriptions for the Admin, Arsenal, Bank, Garage, Interaction, Locker, Medical, Organization, Service, Store, and other modules.
- Added new features such as financial operations, user interface improvements, and integration with organization systems.
- Improved clarity on usage instructions and configuration options across modules.

These changes aim to provide better guidance for users and developers interacting with the Forge client system.
2025-05-25 16:03:03 -05:00

2.4 KiB

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:
    [source, "sfx_sound_name"] spawn forge_client_ambient_fnc_ambientSound
    
  3. Optionally specify a duration for temporary sounds:
    [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:

#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