master5
offline
Опыт:
559Активность: |
Проблема с триггером
Уминя вопрос к Jass'ерам.
Етот триггер не работает хотя все норм ошыбок 0. Он должен играть музыку обычною и при аттаке юнита вчьом причина скажыте плиз? Зрание спс. Вот триггер: library MusicSystem initializer Setup_Music globals
private string current = null private timer t constant string FIGHT_MUSIC = "3circles.mp3" constant string NORMAL_MUSIC = "Medieval.mp3" private real fightTime = 0. private real normalTime = 0. endglobals These must have the data of the various songs you use.
private function SetMusicRestart takes string s returns nothing if s == FIGHT_MUSIC then set fightTime = ModuloReal(fightTime + TimerGetElapsed(t), 620.) elseif s == NORMAL_MUSIC then
set normalTime = ModuloReal(normalTime + TimerGetElapsed(t), 245.) endif
endfunction This must have the correct returns for the various songs you use.
private function GetMusicRestart takes string s returns real if s == FIGHT_MUSIC then return fightTime elseif s == NORMAL_MUSIC then return normalTime else return 0. endif endfunction private function StartMusicEx takes nothing returns nothing
call StopMusic(false) if current != null then call PlayMusic(current) call SetMusicPlayPosition( R2I( GetMusicRestart(current)*1000 ) ) call TimerStart(t, 99999., false, null) endif call DestroyTimer(GetExpiredTimer()) endfunction function StartMusic takes string s returns nothing
call ClearMapMusic() if s != null then call SetMapMusic(s, false, 0) endif if current != null then call StopMusic(true) call SetMusicRestart(current) if s != null then call TimerStart(CreateTimer(), 2., false, function StartMusicEx) This time is to allow time for fade out. Reduce it to make the new music come in faster. endif else call StopMusic(false) if s != null then call PlayMusic(s) call SetMusicPlayPosition( R2I( GetMusicRestart(s)*1000 ) ) call TimerStart(t, 99999., false, null) endif endif set current = s endfunction private function Setup_Music takes nothing returns nothing
set t = CreateTimer() endfunction endlibrary
|
13.09.2009, 19:55 | #1
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
DragonSpirit
у - уходи
offline
Опыт:
22,625Активность: |
1)У тебя есть JNGP? 2) Пропиши тут пути к свом музыкальным файлам |
13.09.2009, 21:03 | #2
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
master5
offline
Опыт:
559Активность: |
DragonSpirit:
Отредактировано master5, 14.09.2009 в 16:29. |
13.09.2009, 22:08 | #3
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|