View Issue Details

IDProjectCategoryView StatusLast Update
0000690Spring engineGeneralpublic2007-12-09 23:05
Reporterlurker Assigned ToKDR_11k  
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Summary0000690: [patch] get play_sound: gives the ability to play sounds from cob that aren't heard by everyone
Description1) Adds a new get call, PLAY_SOUND, to play a sound that can be heard only by allies, enemy, in los, etc.
2) changes get health to allow a unit ID to be passed
3) adds a call to create() at the end of ReloadCOB
Additional InformationGET PLAY_SOUND(sound number, volume, who hears the sound, where to play the sound)

To set up sounds to use with GET PLAY_SOUND, put a function like this near the top of your bos:
Sounds()
{
    play-sound ("movement", 10);
    play-sound ("pew", 10);
    play-sound ("reporting", 10);
}
The sound number is based on the order the sounds appear, staring from 0. To call the songs by name, add #defines like this:
Sounds()
{
    play-sound ("movement", 10);
    #define movement 0
    play-sound ("pew", 10);
    #define pew 1
    play-sound ("reporting", 10);
    #define reporting 2
}

To actually call the sound, you use a line such as this:
    GET PLAY_SOUND (pew, 655360);

1) sound number - as above

2) volume - similar to the volume for play-sound, more affecting the distance where it is audible than actual volume
        - given as a float multiplied by 65536

3) who hears the sound
    0 = anyone with the unit in ALOS
    1 = anyone with the unit in LOS
    2 = anyone with the unit in ALOS or radar
    3 = anyone with the unit in LOS or radar
    4 = everyone
    5 = the unit's allies
    6 = the unit's team
    7 = the unit's enemies

4) where to play the sound
        - if 0, the sound is played from the unit's position
        - if 1, the sound is played directly from the speakers, the same way unit replies are
TagsNo tags attached.
Attached Files
play_sound.patch (Attachment missing)
play_sound_fixed.patch (Attachment missing)
get_play_sound_demo.sd7 (Attachment missing)
Checked infolog.txt for Errors

Activities

lurker

2007-11-20 16:23

reporter   ~0001451

oops. forgot to remove the logOutput.

KDR_11k

2007-12-09 23:05

reporter   ~0001486

committed in r4974

Issue History

Date Modified Username Field Change
2007-11-20 16:19 lurker New Issue
2007-11-20 16:19 lurker File Added: play_sound.patch
2007-11-20 16:23 lurker Note Added: 0001451
2007-11-20 16:23 lurker File Added: play_sound_fixed.patch
2007-11-20 16:35 lurker File Added: get_play_sound_demo.sd7
2007-12-06 19:43 tvo Summary get play_sound: gives the ability to play sounds from cob that aren't heard by everyone => [patch] get play_sound: gives the ability to play sounds from cob that aren't heard by everyone
2007-12-09 23:03 KDR_11k Status new => assigned
2007-12-09 23:03 KDR_11k Assigned To => KDR_11k
2007-12-09 23:05 KDR_11k Status assigned => resolved
2007-12-09 23:05 KDR_11k Resolution open => fixed
2007-12-09 23:05 KDR_11k Note Added: 0001486