Forum

> > CS2D > Scripts > Round Sound Bad Working
Forums overviewCS2D overview Scripts overviewLog in to reply

English Round Sound Bad Working

3 replies
To the start Previous 1 Next To the start

old Re: Round Sound Bad Working

Rainoth
Moderator Off Offline

Quote
Maybe because it's badly timed, the author screwed up or because one sound is made on round start and the other on round end. So round ends and one song begins then round starts while first song still playing and you hear two sounds.

Use code like :
1
2
3
function startround_hook(mode)
	timer(12000,"parse","sv_sound \"MonsterBattlefield2D/NAMEofSONG.ogg\"")
end
this to delay the start of the begining song for sometime that you need.

old Re: Round Sound Bad Working

Remulux
User Off Offline

Quote
Where to add this, i'm bad in scripting
(I have 2 songs for zombies and 2 for people)

1
2
3
function startround_hook(mode)
     timer(12000,"parse","sv_sound \"MonsterBattlefield2D/NAMEofSONG.ogg\"")
end

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
addhook("endround", "end_of_round")

function ctwin()
     a = math.random(1,2)
parse(string.format("sv_sound \"misc/win_humans%d.ogg\"", a))
end

function twin()
     a = math.random(1,2)
parse(string.format("sv_sound \"misc/zombie_win%d.ogg\"", a))
end

function end_of_round(mode)
     if mode==1 then --Regular T win
          twin()
     elseif mode==2 then --Regular CT win
          ctwin()
     elseif mode==60 then --All humans infested; Zombies win
          twin()
     elseif mode==61 then --Humans survived; Humans win
          ctwin()
     end
end

old Re: Round Sound Bad Working

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
addhook("endround", "end_of_round")
addhook("startround", "start_of_round")

function start_of_round(mode)
	makesound(3) -- Starting Sound
end

function makesound(who) -- Who won ? Who's next ? YOU DECIDE ! just kidding...
	a = math.random(1,2) -- Random Zombie Win song
	b = math.random(3,4) -- Random Survivor Win Song
	if who == 1 then
		parse("sv_sound \"folderNAME/NAMEofSONG"..a..".ogg\"") -- Define Path for Zombies Win Sound
	elseif who == 2 then
		parse("sv_sound \"folderNAME/NAMEofSONG"..b..".ogg\"") -- Define Path for Survivor Win Sound
	elseif who == 3 then
		timer(12000,"parse","sv_sound \"folderNAME/NAMEofSONG.ogg\"") -- Define Path for Round Start Sound and name of starting sound
	end
end

-- IMPORTANT !!! You have to rename your songs into your name of song + 1,2,3,4 where sounds 1,2 are zombie win and 3,4 are survivors win.
-- Example "RainingMammoths/music/sound1.ogg\"
-- Example "RainingMammoths/music/sound2.ogg\"
-- Example "RainingMammoths/music/startsound.ogg\"

function end_of_round(mode)
     if mode==1 then --NOTE : Zombies can't win regulary, only when they infect everybody, therefore this part is not needed. Same for normal CT.
          makesound(1)
     elseif mode==2 then
          makesound(2)
     elseif mode==60 then --All humans infested; Zombies win
          makesound(1)
     elseif mode==61 then --Humans survived; Humans win
          makesound(2)
     end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview