Jump to content

Recommended Posts

OK, I found myself putting the Muslim prayer sound on every minaret in every mission that I made. So I decided to work out how to automate the process and here's what I came up with:

  1. Place a Game Logic in the centre of the map and name it "centre".
  2. Place the Functions Module on the map.
  3. Add the following to your init.sqf:
     [true]execVM "scripts\initMinarets.sqf"; //use [false] if you don't want debug markers on the minarets


  4. Create a file in your scripts folder called initMinarets.sqf and paste the following:
     if (!isServer) exitWith {};
    
    
    waituntil {!isnil "bis_fnc_init"};
    
    
    _debug = _this select 0;
    
    
    possibleMinarets = ["Land_A_Minaret_Porto_EP1","Land_A_Mosque_big_minaret_2_EP1","Land_A_Minaret_EP1"];
    
    
    includedMinarets = [];
    
    
    {
       includedMinarets = includedMinarets + (getPos centre nearObjects[_x,10000]);
    }forEach possibleMinarets;
    
    
    _i = 0;
    {
       call compile format ["
       if (_debug) then {
           _m%1 = createMarker[""myMinaret%1"",[position _x select 0,position _x select 1]];
           _m%1 setMarkerShape ""ICON"";
           _m%1 setMarkerType ""mil_triangle"";
           _m%1 setmarkercolor ""colorred"";
           _m%1 setmarkerDir direction _x;
       };
    
       _t%1 = createTrigger[""EmptyDetector"",getPos _x];
       _t%1 setTriggerArea [0, 0, 0, false ];
       _t%1 setTriggerActivation [""NONE"", ""PRESENT"", false];
       _t%1 setTriggerStatements [""true"", """", """"];
       if (random 1 < 0.5) then {
           _t%1 setSoundEffect [""$NONE$"", """", """", ""Muslim_prayer1""];
       } else {
           _t%1 setSoundEffect [""$NONE$"", """", """", ""Muslim_prayer2""];
       };
       ",_i];
       _i = _i + 1;
    }forEach includedMinarets;
    


I haven't got it to work with minarets created by the Town Generator.

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

×