Kolmain 6 Posted January 29, 2011 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
neokika 62 Posted January 29, 2011 Hi, _round say "PMC_Incoming"; _neo_ Share this post Link to post Share on other sites
Kolmain 6 Posted January 29, 2011 //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
SkaceKachna 52 Posted January 30, 2011 (edited) 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 January 30, 2011 by MEN-X Share this post Link to post Share on other sites
AZCoder 921 Posted January 30, 2011 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
panda123 10 Posted January 31, 2011 An example would be appreciated for non DLC users :) Thanks Share this post Link to post Share on other sites
Kolmain 6 Posted January 31, 2011 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