monkeybrain

Having a radio or object play music

9 posts in this topic

I've been trying to get a object play a sound, which I have done in editor, but can't get going in game. This is what I have so far

in my initserver.sqf

["Land_BackAlley_01_l_gate_F", [9053.12, 16061.4, 134.402], [-0.961636, 0.274328, 0], [0, 0, 1], true]
];

{
    private _vehicle = (_x select 0) createVehicle (_x select 1);
    _vehicle allowDamage false;
    _vehicle setPosWorld (_x select 1);
    _vehicle setVectorDirAndUp [_x select 2, _x select 3];
    _vehicle enableSimulationGlobal (_x select 4);
    _vehicle setVariable ["ExileIsLocked", -1, true];

    _vehicle ="sam"; //i want to name the object sam, is this how??
    
}

I execute the script below in the init

 

[[while {true} do

              {
                  playSound3D ["A3\music_f\Music\AmbientTrack01a_F.ogg", sam, false, getPos sam, 30, 1, 80];
                  sleep 60;
              }]
              ,"",true,true,false] call BIS_fnc_MP;

Every 60 seconds the song should repeat.  I'm guessing i've just named the object wrong? Thanks

Share this post


Link to post
Share on other sites
Advertisement

thats a great idea! i think about the same just 5 minutes ago.. how cool would it be if traderzone can play music... some of this stuff or something else

 

Share this post


Link to post
Share on other sites

something like this in description.ext

Quote

class CfgMusic
{
sounds[] = {01,02};
class 01
{
 name = "01";
 sound[] = {"music\sound1.ogg", db+10, 1.0};
 titles[] = {0,""};
};
class 02
{
 name = "02";
 sound[] = {"music\sound2.ogg", db+10, 1.0};
 titles[] = {0,""};
};


};

Place this in your description.ext in your documentary>arma3>mission>YOURMISSIONFILE

"Then place your music files in your mission folder in a subfolder named music, so sound1.ogg would be placed "C:\Users\YOURPCNAME\Documents\Arma 3\missions\YOURMISSIONNAME.Stratis\music\sound1.ogg"

Then to trigger the sound create a trigger in the editor, choose effects and music. scroll down to the bottom of the music list and you will see 01 and 02 the names of my music files as defined above, choose which one you want. Then just set your trigger to what ever you want to trigger your sound and preview your mission. You should hear your music files when you activate the trigger. you can adjust the volume of your music by editing the bit in description.ext "db+10".

 

totally "Googled" that

Share this post


Link to post
Share on other sites

I tried this for the sound arrived safe zone:

private["_soundMLG"];
if (alive player) then
     {
      waituntil {!(player getvariable ["ExilePlayerInSafezone",false])};
       {
        playSound selectRandom ["WTTF","EduradSand","Exodus","GivingUpU",
              "Idonkno","Mordor","DreamCome","BurnBrid",
              "FinalEff","Soundwar","RedStro","RoadVic",
              "SadVio","RusAnth","LastBat","TrevWar",
              "USAAnth","VeigPir","RideoftheV","GuilesT",
              "FlyingNow","ATeam","CareingWhisper","Megalovania",
              "SavingWorld","OneLast","HumanHaven","VictorySteps","Umbrella"];
        hint "MLG Musique!!!";
        [] spawn
         {
          _soundMLG = ASLToAGL [0,0,0] nearestObject "#soundonvehicle";
          waitUntil {isNull ExilePlayerInSafezone};
          deleteVehicle _soundMLG;
          hint "Revenez !! Pour d'autre titre!";
         };
       };
     };
 
Don't Work  ??

 

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.