Home   Help Search Login Register  

Author Topic: Call To Prayer...  (Read 3532 times)

0 Members and 1 Guest are viewing this topic.

Offline Shadow.D. ^BOB^

  • Members
  • *
Re: Call To Prayer...
« Reply #15 on: 31 Dec 2008, 22:27:04 »
Will look at doing that Hoz.

Just found a little bug.  Although the script works fine, the last prayer time (19:00) plays the sound file repeatedly.  Everyother specified time is correct, playing it only once.

This is so close to being complete now, it definatly gives the map much more immersion.

Cheers...

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Call To Prayer...
« Reply #16 on: 31 Dec 2008, 22:40:30 »
change
Code: [Select]
if (dayTime > (_times_to_play select 4)) then

by
Code: [Select]
if (dayTime > ((_times_to_play select 4) + 0.1)) then

Offline Shadow.D. ^BOB^

  • Members
  • *
Re: Call To Prayer...
« Reply #17 on: 01 Jan 2009, 01:30:30 »
Sorted...  Thanks again guys, this definatly adds a nice element.  Will get a template etc. done for the depot.  Will give full credit to Mandoble and everyone here :)

Catch u soon.

Offline Landdon

  • Members
  • *
Re: Call To Prayer...
« Reply #18 on: 17 Jan 2009, 14:59:32 »
Hello,

I'm am attempting to do the exact same thing, but I have not been successful as of yet.  I have tried my best to follow the thread and attempted to reconstruct it properly.

I have the falling in my description file.

Code: [Select]
// ================================================================================

class CfgSounds
{
sounds[] = {Adhan};

class adhan
{
name = "Adhan";
sound[] = {"Adhan.ogg", db+0, 1.0};
titles[] = {0,""};
};
};;

//================================================================================

I have the Adhan.ogg file within a folder called "Sound" which is where I understand it is suppost to be located.
I have created a SQF file called "prayer" and within, it contains the following code:

Code: [Select]
_gamelogic="logic" createVehicleLocal [0,0,0];
_times_to_play = [5, 12, 15, 18, 19];
_played_times = [0, 0, 0, 0, 0];
_i = 0;
while {true} do
{
   _i = 0;
   {
      if (abs (dayTime - _x) < 0.05) then
      {
         if ((_played_times select _i) == 0) then
         {
            _played_times set [_i, 1];
            _gamelogic say "Adhan";
         };
      };
      _i = _i + 1;
   } forEach _times_to_play; 

    if (dayTime > ((_times_to_play select 4) + 0.1)) then
   {
      _played_times = [0, 0, 0, 0, 0];
   };

   Sleep 10;
};


In my init.sqf file, I have the following:

Code: [Select]

[]execVM "prayer.sqf";


So is my coding valid?  I have not recieved an error from the game when loading it.  But I'm not getting a sound as of yet.  I would like the sound to come from a couple of Minarets.  Is that possiable?  How would I go about making the sound come from a specfic minaret?  That for your help! 

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Call To Prayer...
« Reply #19 on: 17 Jan 2009, 15:46:04 »
Hi,

 first thing would be
 
Code: [Select]
_gamelogic="logic" createVehicleLocal [0,0,0];
 create near you or the minarete instead.
 to get pos of minarette , place a cone or something near it in mission ,save , open mission.sqm . get co-ordinates of cone.
remember convert data from .mission .sqm which is x,z,y  to setpos which is z,y,z .

 also
 If i recall correctly ,for say to work your ogg. must be recorded in mono  @ 44100 ,120kbps .ogg

 the programme to fo this can be found in the excellent sound tutorial in the turorial sections of this site , the software is called goldwave.
« Last Edit: 17 Jan 2009, 15:49:16 by DeanosBeano »
I love ofp

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Call To Prayer...
« Reply #20 on: 17 Jan 2009, 19:05:01 »
Deano, I you meant to type:
Quote
remember convert data from .mission .sqm which is x,z,y  to setpos which is x,y,z .

To get the position of any object in-game, you can put this in the init:
Code: [Select]
player sideChat format ["%1 at %2", typeOf this, getPos this];
Though this means you need to copy the value visually from the screen, rather than copy-and-paste from a file. This is possibly a lot easier if you have a lot of the same type of object in the mission and it would be hard to work out which one you want from the mission.sqm (in this case, if you only have one minaret on the map, it would be easy enough to look at the mission.sqm as Deano suggested).
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Landdon

  • Members
  • *
Re: Call To Prayer...
« Reply #21 on: 22 Jan 2009, 19:51:21 »
THANKS ALL!  I COULDN'T HAVE GOT IT TO WORK WITHOUT YOUR HELP!!! :good: :good: :clap: