Jump to content
Sign in to follow this  
Kolmain

PMC Mortar Whistle?

Recommended Posts

So I've got ambient mortar fire across zargabad via script. My question is how i can play this mortar whistle sound (identified as "PMC_Incoming" from the mission description) while its randomly generating it around the city, and if you're not close enough, you cant hear it. If you're at base way down south of zargabad city, you should hear the whistle of a mortar shell hitting the center :p So heres my code snipet on the arty. maybe we could use a publicvariable to store the location of the shell, check to see if the player is x meters from the variable, or maybe theres a play 3d sound command im not aware of? Thanks for the help!

//arty.sqf
//origional created by I44 team
if(!isServer) exitWith{};
private ["_trg", "_round", "_alpha", "_bravo", "_loc", "_delay"];
_trg = mortar1;
_round = "ARTY_Sh_81_HE";
_alpha = ((triggerArea _trg) select 0);
_bravo = ((triggerArea _trg) select 1);
_loc = getPos _trg;
while {true} do {
_round createVehicle [(_loc select 0) + _alpha - random (_alpha * 2),(_loc select 1) + _bravo - random (_bravo * 2), 600];

_delay = 25 - random 5;
sleep _delay;
};

Share this post


Link to post
Share on other sites

//arty.sqf
//origional created by I44 team
if(!isServer) exitWith{};
private ["_trg", "_round", "_alpha", "_bravo", "_loc", "_delay"];
_trg = mortar1;
_round = "ARTY_Sh_81_HE";
_alpha = ((triggerArea _trg) select 0);
_bravo = ((triggerArea _trg) select 1);
_loc = getPos _trg;
while {true} do {
_round createVehicle [(_loc select 0) + _alpha - random (_alpha * 2),(_loc select 1) + _bravo - random (_bravo * 2), 600];
[color=#000000][font=Courier New][color=#0000bb]_round say [/color][color=#dd0000]"PMC_Incoming"[/color][/font][color=#007700][font=Courier New];  [/font]
[/color][/color] _delay = 25 - random 5;
sleep _delay;
};

now theres no mortars at all :(

Share this post


Link to post
Share on other sites

First notice, that "ARTY_Sh_81_HE" already whistling (not so loud, but still)

if(!isServer) exitWith{};
private ["_trg", "_round", "_alpha", "_bravo", "_loc", "_delay"];
_trg = mortar1;
_round = "ARTY_Sh_81_HE";
_alpha = ((triggerArea _trg) select 0);
_bravo = ((triggerArea _trg) select 1);
_loc = getPos _trg;
while {true} do {
_rnd = _round createVehicle [(_loc select 0) + _alpha - random (_alpha * 2),(_loc select 1) + _bravo - random (_bravo * 2), 600];
_rnd say3D "PMC_Incoming";  
_delay = 25 - random 5;
sleep _delay;
};

- right code, but it still won't work.

You must add sound into your description.ext:

class CfgSounds
{
 sounds[] = {};
 class PMC_Incoming
 {
  name = "bombing1";
  sound[] = {"falling_bomb1.wss", 1, 1};
  titles[] = {};
 };
};

I didn't manage to locate sound absolute ("falling_bomb1.wss"), so to use my code, you must extract it to mission folder. You can find it in <GAME FOLDER>\Common\mission_pmc_data.pbo\sounds\

Edited by MEN-X

Share this post


Link to post
Share on other sites

The sounds are called "PMC_Incoming1" and "PMC_Incoming2". If you have the PMC DLC loaded, then you don't need to add it to description.ext. However if you want the sounds for non DLC users, then you'll have to do as MEN-X wrote, copy the sound files and pop them in description.

Share this post


Link to post
Share on other sites

Right here:

//Arty.sqf
if(!isServer) exitWith{};
private ["_trg", "_round", "_alpha", "_bravo", "_loc", "_delay"];
_trg = mortar1;
_round = "ARTY_Sh_81_HE";
_alpha = ((triggerArea _trg) select 0);
_bravo = ((triggerArea _trg) select 1);
_loc = getPos _trg;
while {true} do {
_rnd = _round createVehicle [(_loc select 0) + _alpha - random (_alpha * 2),(_loc select 1) + _bravo - random (_bravo * 2), 600];
_rnd say3D "PMC_Incoming"; 
_delay = 25 - random 5;
sleep _delay;
};

//Description.ext - 
class CfgSounds{  sounds[] = {};  class PMC_Incoming  {   name = "bombing1";   sound[] = {"falling_bomb1.wss", 1, 1};   titles[] = {};  };};

You can find the sound in in <GAME FOLDER>\Common\mission_pmc_data.pbo\sounds\

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  

×