HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Some Players Say They Can't Hear This Music Played as a Sound? Did I Miss Something?

11-11-2008, 05:05 PM#1
Brash
I have imported some music mp3's and made a sound variable in the sound editor to play them and for the most part they play fine but sometimes when i'm hosting on bnet and have several players try to turn the music on with the commands below, usually one out of 5 say that nothing is playing for them no matter how many times they try to type it. So either they dont know how to turn their speakers on (or maybe lying).. or there may be an actual problem.

Note: this is not played as "music", but played as sound so that even if the player has their music turned off they should be fine so long as they can hear sounds.

I will post all the code related to this below if you want to see. It looks perfect to me and i never have trouble playing it for myself. It is set up to loop 5 tracks.

Trigger:
Initialization
Collapse Events
Map initialization
Conditions
Collapse Actions
Custom script: call DestroyTrigger(GetTriggeringTrigger())
-------- Music --------
-------- SetTracks --------
Set MusicTrack[1] = Track_1_GoStraight <gen>
Set MusicTrack[2] = Track_2_UnderLogic <gen>
Set MusicTrack[3] = Track_3_Smartbomb <gen>
Set MusicTrack[4] = Track_4_Spybreak <gen>
Set MusicTrack[5] = Track_5_Messij <gen>
Sound - Set volume of MusicTrack[1] to 93.00%
Sound - Set volume of MusicTrack[2] to 75.00%
Sound - Set volume of MusicTrack[3] to 85.00%
Sound - Set volume of MusicTrack[4] to 90.00%
Sound - Set volume of MusicTrack[5] to 96.00%
Trigger:
NonLocal Ini
Collapse Events
Map initialization
Conditions
Collapse Actions
Custom script: call DestroyTrigger(GetTriggeringTrigger())
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
-------- Music --------
Trigger - Add to Music On <gen> the event (Player - (Player((Integer A))) types a chat message containing -musicon as An exact match)
Trigger - Add to Music On <gen> the event (Player - (Player((Integer A))) types a chat message containing -music on as An exact match)
Trigger - Add to Music On <gen> the event (Player - (Player((Integer A))) types a chat message containing -music as An exact match)
Trigger - Add to Music On <gen> the event (Player - (Player((Integer A))) types a chat message containing -m as An exact match)
Trigger - Add to Music Off <gen> the event (Player - (Player((Integer A))) types a chat message containing -musicoff as An exact match)
Trigger - Add to Music Off <gen> the event (Player - (Player((Integer A))) types a chat message containing -music off as An exact match)
-------- Music Timer --------
Trigger - Add to MusicTimer <gen> the event (Time - MusicTrack_Timer[(Integer A)] expires)

Trigger:
Music On
Events
Conditions
Collapse Actions
Set MusicBooCheckON[(Player number of (Triggering player))] = True
-------- Find Next Track --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
MusicTrackNum[(Player number of (Triggering player))] Greater than 4
Collapse Then - Actions
Set MusicTrackNum[(Player number of (Triggering player))] = 1
Collapse Else - Actions
Set MusicTrackNum[(Player number of (Triggering player))] = (MusicTrackNum[(Player number of (Triggering player))] + 1)
-------- Stop All Possible Tracks and Play Next --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
LocalPlayer Equal to (Triggering player)
Collapse Then - Actions
Collapse For each (Integer A) from 1 to 5, do (Actions)
Collapse Loop - Actions
Sound - Stop MusicTrack[(Integer A)] Immediately
Sound - Play MusicTrack[MusicTrackNum[(Player number of (Triggering player))]]
Collapse Else - Actions
Do nothing
Countdown Timer - Start MusicTrack_Timer[(Player number of (Triggering player))] as a One-shot timer that will expire in (Length of MusicTrack[MusicTrackNum[(Player number of (Triggering player))]]) seconds

Trigger:
Music Off
Events
Conditions
Collapse Actions
Set MusicBooCheckON[(Player number of (Triggering player))] = False
-------- Stop All Possible Tracks and Turn Off --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
LocalPlayer Equal to (Triggering player)
Collapse Then - Actions
Collapse For each (Integer A) from 1 to 5, do (Actions)
Collapse Loop - Actions
Sound - Stop MusicTrack[(Integer A)] Immediately
Collapse Else - Actions
Do nothing

This is the code for the timer checker to see which one expired but this part i doubt is what screwed it up cuz it wouldn't even reach this point for them since they couldn't even get it to turn on in the first place to even start a timer up for them.
MusicTimer
Code:
function Trig_MusicTimer_Func001Func001Func003Func001Func002C takes nothing returns boolean
    if ( not ( udg_MusicTrackNum[udg_MusicPlayerNum] > 4 ) ) then
        return false
    endif
    return true
endfunction

function Trig_MusicTimer_Func001Func001Func003Func001C takes nothing returns boolean
    if ( not ( udg_LocalPlayer == ConvertedPlayer(udg_MusicPlayerNum) ) ) then
        return false
    endif
    return true
endfunction

function Trig_MusicTimer_Func001Func001Func003C takes nothing returns boolean
    if ( not ( udg_MusicBooCheckON[udg_MusicPlayerNum] == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_MusicTimer_Func001Func001C takes nothing returns boolean
    if ( not ( GetExpiredTimer() == udg_MusicTrack_Timer[GetForLoopIndexA()] ) ) then
        return false
    endif
    return true
endfunction

function Trig_MusicTimer_Actions takes nothing returns nothing
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 12
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        if ( Trig_MusicTimer_Func001Func001C() ) then
            set udg_MusicPlayerNum = GetForLoopIndexA()
            if ( Trig_MusicTimer_Func001Func001Func003C() ) then
                if ( Trig_MusicTimer_Func001Func001Func003Func001Func002C() ) then
                    set udg_MusicTrackNum[udg_MusicPlayerNum] = 1
                else
                    set udg_MusicTrackNum[udg_MusicPlayerNum] = ( udg_MusicTrackNum[udg_MusicPlayerNum] + 1 )
                endif
                if ( Trig_MusicTimer_Func001Func001Func003Func001C() ) then
                    set bj_forLoopAIndex = 1
                    set bj_forLoopAIndexEnd = 5
                    loop
                        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
                        call StopSoundBJ( udg_MusicTrack[GetForLoopIndexA()], true )
                        set bj_forLoopAIndex = bj_forLoopAIndex + 1
                    endloop
                    call PlaySoundBJ( udg_MusicTrack[udg_MusicTrackNum[udg_MusicPlayerNum]] )
                else
                    call DoNothing(  )
                endif
                call StartTimerBJ( udg_MusicTrack_Timer[udg_MusicPlayerNum], false, GetSoundDurationBJ(udg_MusicTrack[udg_MusicTrackNum[udg_MusicPlayerNum]]) )
            else
                call DoNothing(  )
            endif
        else
            call DoNothing(  )
        endif
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
endfunction

//===========================================================================
function InitTrig_MusicTimer takes nothing returns nothing
    set gg_trg_MusicTimer = CreateTrigger(  )
    call TriggerAddAction( gg_trg_MusicTimer, function Trig_MusicTimer_Actions )
endfunction

11-11-2008, 05:31 PM#2
Alevice
Not exactly the answer you might expect but...

Quote:
Note: this is not played as "music", but played as sound so that even if the player has their music turned off they should be fine so long as they can hear sounds.

Why do you (and many otehr people) do this? If I have music turned off, it is for a reason, not because I want some other fucker to put music when I do not want to.
11-11-2008, 11:07 PM#3
Vexorian
Most likely, it has something to do with your LocalPlayer comparison being inside a function.
11-12-2008, 06:05 AM#4
Brash
Quote:
Originally Posted by Alevice
Why do you (and many otehr people) do this? If I have music turned off, it is for a reason, not because I want some other fucker to put music when I do not want to.

1. players usually forget they left their music setting off and wont know if something better is playing since they usually have it off because they specifically dont like war3's music. 2. I dislike having to toggle that setting all the time and wish to be able to listen to my own maps music when i play it without having to bother with options every time.

you could say that about anything. "oh that bastard put something in his map to force me to see or hear"

The whole point of map making is to force people to see your method of expression, else no map maker would bother.

Besides, if you look at my code, the music isn't played until they type a command, and it is played only for that player.

Quote:
Originally Posted by Vexorian
Most likely, it has something to do with your LocalPlayer comparison being inside a function.

This is how i see everyone using localplayer comparisons.
so i'm suppose to only use localplayer in the main condition of the trigger and not in a condition for an "if/than/else"?


edit> hey i just noticed something in my code there.. is that an integer A loop from 1-5 within another integer A loop 1-12? or am i ijust too tired to comprehend what i'm looking at right now? hmm that shouldn't be
11-12-2008, 03:18 PM#5
Alevice
Quote:
Originally Posted by Brash
1. players usually forget they left their music setting off and wont know if something better is playing since they usually have it off because they specifically dont like war3's music. 2. I dislike having to toggle that setting all the time and wish to be able to listen to my own maps music when i play it without having to bother with options every time.

Ctrl+M turns it on off. Most other users put their own music on their favorite media player, and having a forced music on the way isn't ideal. You could just remind your users to press ctrl m if they want.

Quote:
Originally Posted by Brash
you could say that about anything. "oh that bastard put something in his map to force me to see or hear"

The whole point of map making is to force people to see your method of expression, else no map maker would bother.

Music is far more intrusive to the player's will, especially when they have an option to turn it off and you totally disrespect it.

I am all for custom music, don't get me wrong, but forcing it to the user is not appropiate. Plus, it doesn't work well when you pause the game.


Quote:
Originally Posted by Brash
Besides, if you look at my code, the music isn't played until they type a command, and it is played only for that player.
alright, fair enough on that. doesn't help I just skimmed the code. :/