XGM Forum
Сайт - Статьи - Проекты - Ресурсы - Блоги

Форуме в режиме ТОЛЬКО ЧТЕНИЕ. Вы можете задать вопросы в Q/A на сайте, либо создать свой проект или ресурс.
Вернуться   XGM Forum > Warcraft> Академия: форум для вопросов> Jass
Ник
Пароль
Войти через VK в один клик
Сайт использует только имя.

Ответ
 
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
DragonSpirit
у - уходи
offline
Опыт: 22,625
Активность:
1)У тебя есть JNGP?
2)
constant string FIGHT_MUSIC = "3circles.mp3"
constant string NORMAL_MUSIC = "Medieval.mp3"
Пропиши тут пути к свом музыкальным файлам
Старый 13.09.2009, 21:03
master5

offline
Опыт: 559
Активность:
DragonSpirit:
1)У тебя есть JNGP?
2)
constant string FIGHT_MUSIC = "3circles.mp3"
constant string NORMAL_MUSIC = "Medieval.mp3"
  1. Да есть.
  2. Указал и не играет музыку (играетца токо игровая музыка).
    constant string FIGHT_MUSIC = "Sound/Music/mp3Music/War2IntroMusic.mp3"
    constant string NORMAL_MUSIC = "Sound/Music/mp3Music/PH1.mp3

Отредактировано master5, 14.09.2009 в 16:29.
Старый 13.09.2009, 22:08
Ответ

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы можете скачивать файлы

BB-коды Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход



Часовой пояс GMT +3, время: 11:04.