Jump to content
Sign in to follow this  
kelgram

Multiple sounds for the one event and overriding AI chatter with my own sounds

Recommended Posts

Tried searching the whole forums but could not find any info for my queries

Question 1

I am trying to implement a Rainbow Six like mission where at the start of the mission HQ will send a message like:

"You're the best of the best, remember that"

-

or

"Let's get back in one piece."

I have been able to play one sound successfully by adding it to my description.ext

class hq_intro_message
{
name = "hq_intro_message"; // Name for mission editor
sound[] = {\sounds\rainbow\gq\hq_message1.wav, 0.8, 1.0};
titles[] = {0, ""};
};

However I want there to be several sounds available and the mission randomly picks one to play.

So I tried this:

class hq_intro_message
{
name = "hq_intro_message"; // Name for mission editor
sound[] = {\sounds\rainbow\gq\hq_message1.wav, 0.8, 1.0};
sound[] = {\sounds\rainbow\gq\hq_message2.wav, 0.8, 1.0};
sound[] = {\sounds\rainbow\gq\hq_message3.wav, 0.8, 1.0};
titles[] = {0, ""};
};

That however just overwrites sound[] to the last assignment which is "hq_message3.wav"

How can I have multiple sounds that ArmA 3 can choose randomly for an event, so I can implement this.

Question 2

I have been able to turn off Radio chatter in the init.sqf file using

enableSentences false;

However I would like to be able to override ArmA 3 AI chatter for certain events but I am not sure how you would do this e.g.

AI spots an enemy --> play sound tangoSpotted.wav

AI kills an enemy --> play sound tangoDown.wav

etc.

Is this possible?

Thanks

Share this post


Link to post
Share on other sites

For Q1, whatever script your using to do the sound simply place the following (fill with your classnames of the sounds):

_sound = ["soundClass1","soundClass2","soundClass3"] call BIS_fnc_selectRandom;

_missionHQ playSound _sound;//this would be whatver your currently using to play the sound.

Share this post


Link to post
Share on other sites
For Q1, whatever script your using to do the sound simply place the following (fill with your classnames of the sounds):

_sound = ["soundClass1","soundClass2","soundClass3"] call BIS_fnc_selectRandom;

_missionHQ playSound _sound;//this would be whatver your currently using to play the sound.

Thanks I done what you said :

class hq_intro_message1
{
name = "hq_intro_message1"; // Name for mission editor
sound[] = {\sounds\rainbow\hq\jcf_gen1.wav, 1.3, 1.0};
titles[] = {0, "Be careful out there."};
};

class hq_intro_message2
{
name = "hq_intro_message2"; // Name for mission editor
sound[] = {\sounds\rainbow\hq\jcf_gen2.wav, 1.3, 1.0};
titles[] = {0, "Lets get back in one piece."};
};

class hq_intro_message3
{
name = "hq_intro_message3"; // Name for mission editor
sound[] = {\sounds\rainbow\hq\jcf_gen3.wav, 1.3, 1.0};
titles[] = {0, "This one is important folks, I'm counting on you."};
};

class hq_intro_message4
{
name = "hq_intro_message4"; // Name for mission editor
sound[] = {\sounds\rainbow\hq\jcf_gen4.wav, 1.3, 1.0};
titles[] = {0, "We've got a lot of people watching this one, don't let me down."};
};

class hq_intro_message5
{
name = "hq_intro_message5"; // Name for mission editor
sound[] = {\sounds\rainbow\hq\jcf_gen5.wav, 1.3, 1.0};
titles[] = {0, "You're the best of the best, remember that."};
};

and in my Trigger

	class Item14
	{
		position[]={20625.744,-0.013357168,19506.025};
		a=5000;
		b=5000;
		activationBy="WEST";
		timeoutMin=4;
		timeoutMid=4;
		timeoutMax=4;
		age="UNKNOWN";
		text="4 proceed";
		expActiv="showChat True; Alpha31 sideChat ""HQ Message""; ";
		class Effects
		{
			_sound = ["hq_intro_message1","hq_intro_message2","hq_intro_message3","hq_intro_message4","hq_intro_message5"] call BIS_fnc_selectRandom; 
		};

However I am not able to play any sound now

Share this post


Link to post
Share on other sites

Forget about defining the class effects for the trigger, that's just over kill, create a script with the information I gave you and execute it as follows in the trigger onAct:

[[[],"scriptName.sqf"],"BIS_fnc_execVM",true,false,false] call BIS_fnc_MP;

Share this post


Link to post
Share on other sites

Ok so I created a script called hqmessage.sqf

With the code you gave

_sound = ["hq_intro_message1","hq_intro_message2","hq_intro_message3", "hq_intro_message4", "hq_intro_message5"] call BIS_fnc_selectRandom;

_missionHQ playSound _sound;//this would be whatver your currently using to play the sound.  

and in a trigger I called it like above

[[[],"\scripts\hqmessage.sqf"],"BIS_fnc_execVM",true,false,false] call BIS_fnc_MP;

However I am getting no sound. What am I doing wrong?

Share this post


Link to post
Share on other sites

With the "\" in front of "scripts" you are looking in the game directory, not the mission directory, try taking that out. And your "hqmessage1" and etc are not defined anymore, you will need to use the sound's directory path and selectRandom from that.

Edited by JShock

Share this post


Link to post
Share on other sites
you will need to use the sound's directory path and selectRandom from that.

I am not sure what you are meaning here, do you mean

_sound ={["\sounds\rainbow\hq\jcf_gen1.wav","\sounds\rainbow\hq\jcf_gen2.wav","\sounds\rainbow\hq\jcf_gen3.wav", "\sounds\rainbow\hq\jcf_gen4.wav", "\sounds\rainbow\hq\jcf_gen4.wav5"] call BIS_fnc_selectRandom, 1.3, 1.0};

Share this post


Link to post
Share on other sites

One is for volume and the other is pitch

sound[] = {\sounds\rainbow\hq\jcf_gen3.wav, 1.3, 1.0};

Share this post


Link to post
Share on other sites

Ok, just the file directory path, not the rest of the stuff. And maybe scratch that anyhow, because I'm a dumba**, do you have your "hqmessage1" etc defined in the description.ext file via CfgSounds? If so you can still use those names, derp, I should have asked first :p.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×