Sounds

» Siedler Map Source Forum » Siedler DEdK Script Forum » Sounds

Seiten: 1

SH
#1
03.04.2020 12:52
Beiträge: 127

Sounds

Hello
I want to play the sound Sounds.VoicesHero2_HERO2_Yes_rnd_07. But

 Sound.PlayGUISound(Sounds.VoicesHero2_HERO2_Yes_rnd_07, 100) 

plays a random one of Sounds.VoicesHero2_HERO2_Yes_rnd_x . How to play exactly that sound?

____________________
Sorry for my German

Play4FuN
#2
03.04.2020 18:19
Beiträge: 703

As far as I know you cannot choose which sound to play exactly. I'd like to learn better though.

____________________
LG Play4FuN

Siedler DEdK Mapping + Scripting Tutorials

SH
#3
03.04.2020 18:31
Beiträge: 127

Okay, thank you for the answer

____________________
Sorry for my German

SH
#4
03.04.2020 20:20
Beiträge: 127

I made it!
Based on function StartSpeech:

function PlaySound(_key)

		if _key ~= nil then
	
			local tablePos = string.find(_key, "/")
	
			Stream.Start("Sounds\\"..string.sub(_key, 1, tablePos-1).."\\"..string.sub(_key, tablePos + 1, -1)..".wav", 127)

		end

end

I changed Voice into Sounds and .mp3 into .wav and it works, but I must enter another key ( / instead of _ ).

 PlaySound("VoicesHero2/HERO2_Yes_rnd_07") 



____________________
Sorry for my German

Play4FuN
#5
03.04.2020 20:41
Beiträge: 703

Hah, nice job let's see if this works for all other random voices as well, workers and so on.

____________________
LG Play4FuN

Siedler DEdK Mapping + Scripting Tutorials

Seiten: 1

SiteEngine v1.5.0 by nevermind, ©2005-2007
Design by SpiderFive (www.siedler-games.de) - English translation by juja

Impressum