• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Unit Sounds not Playing when Camera is too Far Away

Status
Not open for further replies.
How do I make it so that when a player zooms out in my map (it's not even that far, like distance 50.0 or 60.0 at max) it doesn't making everything go silent? I hate how when I want to see more units at once I can't hear their fighting because the sound just cuts off...

JASS:
//--------------------------------------------------------------------------------------------------
// Sound
//
// - A specific sound index within the sound list may be specified.
//   Using c_soundIndexAny will choose a sound either sequentially or randomly,
//   based on the sound data.
//
// - Use a "null" playergroup to play the sound for all players.
//
// - 3d sounds are only played for players who currently have vision of the sound position.
//
// - Volumes are expressed as a percent (0-100) of maximum volume.
//--------------------------------------------------------------------------------------------------
const int c_soundIndexAny = -1;

// Sound Info
native soundlink SoundLink (string soundId, int soundIndex);
native string SoundLinkId (soundlink soundId);
native int SoundLinkAsset (soundlink soundId);

// Sound
native void SoundPlay (
    soundlink link,
    playergroup players,
    fixed volume,
    fixed offset
);
native void SoundPlayAtPoint (
    soundlink link,
    playergroup players,
    point inPoint,
    fixed height,
    fixed volume,
    fixed offset
);
native void SoundPlayOnUnit (
    soundlink link,
    playergroup players,
    unit inUnit,
    fixed height,
    fixed volume,
    fixed offset
);

// - SoundPlayScene attempts to synchronize unit animations with the sound duration
native void SoundPlayScene (
    soundlink link,
    playergroup players,
    unitgroup units,
    string animProps
);
native void SoundPlaySceneFile (
    soundlink link,
    playergroup players,
    string sceneFile,
    string camera
);

native sound    SoundLastPlayed ();

native void     SoundPause (sound s, bool pause);
native void     SoundStop (sound s, bool fade);
native void     SoundStopAllModelSounds ();
native void     SoundStopAllTriggerSounds (bool fade);

native void     SoundSetVolume (sound s, fixed volume);
native void     SoundSetPosition (sound s, point position, fixed height);

const int c_soundOffsetStart    = 0;
const int c_soundOffsetEnd      = 1;

native void     SoundSetOffset (sound s, fixed offset, int offsetType);
native void     SoundWait (sound s, fixed offset, int offsetType);
native void     SoundAttachUnit (sound s, unit u, fixed height);

// Sound Lengths
// - Note: Since sound files are localized and potentially different for each player,
//         a network query must be sent to all players, and all results must be
//         received before a synchronous result can be accessed.
//
//         SoundLengthQuery     - Initiate a network query for the given sound
//
//         SoundLengthQueryWait - Pause the current thread until all outstanding sound length
//                                query results have been synchronized
//
//         SoundLengthSync      - Retrieve the synchronized sound length result for the given
//                                sound
//
native void     SoundLengthQuery (soundlink info);
native void     SoundLengthQueryWait ();
native fixed    SoundLengthSync (soundlink info);

// Sound channels
native void     SoundChannelSetVolume (playergroup players, int channel, fixed volume, fixed duration);
native void     SoundChannelMute (playergroup players, int channel, bool mute);
native void     SoundChannelPause (playergroup players, int channel, bool pause);
native void     SoundChannelStop (playergroup players, int channel);

// Other properties
native void     SoundSetReverb (string inReverbLink, fixed inDuration, bool inAmbient, bool inGlobal);
native void     SoundSetFactors (fixed distance, fixed doppler, fixed rolloff);

native text     SoundSubtitleText (soundlink link);

//--------------------------------------------------------------------------------------------------
// Soundtracks
//--------------------------------------------------------------------------------------------------
const int c_soundtrackCueAny = -1;
const int c_soundtrackIndexAny = -1;

native void     SoundtrackDefault (playergroup players, int category, string soundtrack, int cue, int index);
native void     SoundtrackPlay (playergroup players, int category, string soundtrack, int cue, int index, bool makeDefault);
native void     SoundtrackPause (playergroup players, int category, bool pause, bool fade);
native void     SoundtrackSetContinuous (playergroup players, int category, bool continuous);
native void     SoundtrackSetDelay (playergroup players, int category, fixed delay);
native void     SoundtrackStop (playergroup players, int category, bool fade);
native void     SoundtrackWait (string soundtrack);
 
Last edited:
try raising the cutoff distance for 3D sounds.

You're being much too vague here. Where & how do I do this? I've looked around the data manager and don't seem to see what could help. D:

The only function that seems to be relevant doesn't work for me the way I use it:
JASS:
native void     SoundSetFactors (fixed distance, fixed doppler, fixed rolloff);

BTW: I'm not trying to create a specific sound
I'm trying to make ALL UNIT SOUNDS played in the map
not cut off when I get too far away with the camera.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
I do not know how sounds work in SC2. Try altering fields in Reverb Effects catalog entry that your environment uses to see if that makes a difference.

It might also be that SC2 tries a realistic sound model were the further you are away the quiter sounds become so try raising the overall volume of a sound to see if it can then be heard.
 
Status
Not open for further replies.
Top