Jump to content
person2611

[TUTORIAL] Speaker/PA announcements

Recommended Posts

TUTORIAL

Author:  Grumpy Old Man

Modified by: Person2611

Difficulty: Easy

Preview

 

I want to thank Grump Old Man for the code to make PA or Speaker announcements. I know there is one currently for the Purge event but this one is simply for placing speakers in towns of police stations etc. I have tested this and it does work in 5.0 so it will most likely work in lower releases Let's start.

 

1. Create a new folder called scripts in your main mission file and create a new sqf file and name it loudspeaker.sqf and paste this:

GOM_fnc_baseLoudspeakers = {

	params ["_loudspeakers","_sounds"];

	GOM_fnc_basePlaySounds = true;

	while {GOM_fnc_basePlaySounds} do {

		sleep random [300,600,900]; //Amount of random time it will take to play in seconds. I recommend you keep it, currently set at 5 minute, 10 minute and 15 minute random intervals

		{

			_sound = selectRandom _sounds;

			if (alive _x) then {

				[_x,_sound] remoteExec ["say3D",0];

			};

		} forEach _loudspeakers;

	};

};

//to call it:

_loudspeakers = [speaker1,speaker2]; //Object variable name change this to suit your needs. If you wish to add more than two simply continue with a , after the name
_sounds = ["sound","sound1"]; //Name of the sound file replace to suit your needs.

_play = [_loudspeakers, _sounds] spawn GOM_fnc_baseLoudspeakers;

 

Now save the file in your scripts folder if you haven't done it already

2. Open your description.ext and under CfgSounds create a new class. Like so:

    class sound {
        name = "sound";
        sound[] = {"\sounds\sound.ogg", 14.0, 1};
        titles[] = {};
    };

Replace the word sound to the name of the sound file you intend to use.

3. Go to the init.sqf in the main mission file and add the following:

[] execVM "scripts\loudSpeaker.sqf"

Now save  and close

4. Go into the editor of ARMA 3 and place some loudspeakers to where you want them and name them speaker1 etc or what you want to name them

5. Add the .ogg files to your sounds folder.

All done!

This is working perfectly for me exactly as it is set out above if you have problems then you've likely screwed up somewhere so go back and study it, not being bothered to check is not an excuse to reply with an easily fixed problem.

Edited by person2611
  • Like 2

Share this post


Link to post
Share on other sites
3 hours ago, TulparHAN said:

Hello there
  How do I add this script to the Admin menu?
  How can I increase the distance of the speaker distance?

1. Add a button to the admin menu, look how they do ignore and model it

2. I have told you this multiple times now, in the numbers one is for volume, others for distance.

  • Like 1

Share this post


Link to post
Share on other sites
22 hours ago, Deadlesszombie said:

1. Yönetici menüsüne bir düğme ekleyin, nasıl görmezden geldiklerini görün ve modelleyin

2. Size bunu defalarca söyledim, bir sayı için hacim, diğerleri mesafe için.

Hi I did it like you told me.
Sound level is rising very beautiful
The distance of sound is not rising.
Sound speed is rising.
Sorry.

Share this post


Link to post
Share on other sites
1 hour ago, TulparHAN said:

Hi I did it like you told me.
Sound level is rising very beautiful
The distance of sound is not rising.
Sound speed is rising.
Sorry.

3rd nUmber is distance, it is an optional value for the array

in theory the 999 should mean sound plays 999 meters away

class sound {
        name = "sound";
        sound[] = {"\sounds\sound.ogg", 14.0, 1, 999};
        titles[] = {};
    };

 

  • Thanks 1

Share this post


Link to post
Share on other sites
On 5/16/2018 at 5:59 AM, TulparHAN said:

Hello there
  How do I add this script to the Admin menu?
  How can I increase the distance of the speaker distance?

Sorry I haven't been on in a while, this was made specifically for just a certain area I'm not sure why you would want it in the admin menu, unless you wanted the purge event. But I'm glad you got an answer to what you were looking for.

Share this post


Link to post
Share on other sites
7 ชั่วโมงที่ผ่านมา ToxicRageTv

เป็น loudspeaker.sqf ในโฟลเดอร์ของคุณคือติ

1.png.a4d2bb422b3e363b1c6f0c0bd1aec0ee.png

I put this on, but it just does not find the file.

Edited by warutsansuk112

Share this post


Link to post
Share on other sites
1 minute ago, Deadlesszombie said:

คุณคาดหวังว่าจะช่วยได้อย่างไรหากไม่สามารถให้บันทึกได้

I'm looking for a simpler prototype.

Share this post


Link to post
Share on other sites
On 21/10/2561 at 5 นาฬิกา 28 นาที, Deadlesszombie said:

ถ้าคุณไม่ทราบวิธีการค้นหาไฟล์ rpt ของคุณไม่ได้ทำเซิร์ฟเวอร์

http://forums.unitedoperations.net/index.php/topic/24674-how-to-find-your-local-rpt-output/

13:32:06 Warning Message: Script scripts \ loudspeaker.sqf not found
13:32:06 [35075,21.4477,991.169,0.132,[civ_1],"C_man_polo_1_F",[5810.5,11381.9,18.4442]]
13:32:06 Group C Alpha 1-1 (0xc2efae80) - network ID 2:2315
13:32:06  - no main subgroup
13:32:06 Network simulation, time = 0.132
13:32:06 Group C Alpha 1-1 (0xc2efae80) - network ID 2:2315
13:32:06  - no main subgroup

Share this post


Link to post
Share on other sites
6 hours ago, warutsansuk112 said:

13:32:06 Warning Message: Script scripts \ loudspeaker.sqf not found
13:32:06 [35075,21.4477,991.169,0.132,[civ_1],"C_man_polo_1_F",[5810.5,11381.9,18.4442]]
13:32:06 Group C Alpha 1-1 (0xc2efae80) - network ID 2:2315
13:32:06  - no main subgroup
13:32:06 Network simulation, time = 0.132
13:32:06 Group C Alpha 1-1 (0xc2efae80) - network ID 2:2315
13:32:06  - no main subgroup

Please pastebin the full RPT you got that from. Based on the text, you may have spaces in the middle of the execVM string.

Share this post


Link to post
Share on other sites
13 hours ago, warutsansuk112 said:

You have two spaces in the middle of the string for execVM and you forgot the ";" at the end it seems:

14:09:45 Error in expression <

[] execVM "scripts \ loudspeaker.sqf"
StartProgress = false;


if(isDedicated >
14:09:45   Error position: <StartProgress = false;


if(isDedicated >
14:09:45   Error Missing ;
14:09:45 File mpmissions\__CUR_MP.lossantos\init.sqf, line 9
14:09:45 Warning Message: Script scripts \ loudspeaker.sqf not found

 

Edited by imthatguyhere

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.