Announcement

Collapse
No announcement yet.

Help with my description.ext for custom music!

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with my description.ext for custom music!

    Hello. I am a new forums member just getting on to ask for a little help. I have been doing mission editing for awhile now and am look for some help. I recently took an interest in adding custom music to my missions. I created a Description.ext file for my mission, and in another folder in the mission directory called "music", placed 3 ogg files containing the custom songs i want to play. in the Description.ext i have the following code:

    Code:
    class CfgMusic
    {
    	tracks[]={Music1, Music2, Music3};
    
    	class Music1
    	{
    		name = "Music1";
    		sound[] = {\music\Music1.ogg, db+25, 1.0};
            };
    
    };
    
    	class Music2
    	{
    		name = "Music2";
    		sound[] = {\music\Music2.ogg, db+25, 1.0};
            };
    
    };
    
    	class Music3
    	{
    		name = "Music3";
    		sound[] = {\music\Music3.ogg, db+25, 1.0};
            };
    
    };

    after adding this i opened my mission in the editor and placed a trigger that activated for any present persons', and in the "on act." box i placed - playmusic "Music1" - . I didnt get any errors when i pressed OK. then i go to preview the mission and it starts up, still no errors. drive over the trigger, no errors, but no sound. not sure why this is happening. I also have this in my startup parameters: -showscripterrors .. And nothing came up with this on either. Any help would be much appreciated. Sorry if i posted this in the wrong area. Feel free to move it.

    -------EDIT-------
    Now I am also getting a new error when i attempt to load the mission in the editor that says: Config : some input after EndOfFile . I get this error after my game crashes when attempting to load the mission via editor. Again any help would be much appreciated.

    -------EDIT AGAIN-------
    updated my code using some more arrays, got rid of the "EndofFile" error, but now i get a new one that says "File C:\Users\Documents\ArmA 2 Other Profiles\ J%2e%20Sosa\missions\air raid.Takistan\description.ext, line 6: Config: '"' encountered instead of '{'


    I am using the following code now-
    Code:
    class CfgSound
    {
    	tracks[]={Music1, Music2, Music3};
    
    	class Music1
    	{
    		name[] = "Music1";
    		sound[] = {"\sound\Music1.ogg", db+25, 1.0};
            };
    
    };
    
    	class Music2
    	{
    		name[] = "Music2";
    		sound[] = {"\sound\Music2.ogg", db+25, 1.0};
            };
    
    };
    
    	class Music3
    	{
    		name[] = "Music3";
    		sound[] = {"\sound\Music3.ogg", db+25, 1.0};
            };
    
    };

  • #2
    Re: Help with my description.ext for custom music!

    Hey No Name, I'm not really an expert on sounds but have managed to get the following working:

    Code:
    // in description.ext
    class CfgSounds
    {
        sounds[] = {cookoff1};
        
        class cookoff1
        {
            name = "cookoff1";
            sound[] = {"sounds\cookoff1.ogg", 3, 1};
        };
    };
    In my init.sqf:

    Code:
    MISSION_ROOT = call {
        private "_arr";
        _arr = toArray str missionConfigFile;
        _arr resize (count _arr - 15);
        toString _arr
    };
    publicVariable 'MISSION_ROOT';
    And then to play the sound (not music I know but I haven't tried music)

    Code:
    playSound3D [MISSION_ROOT + "sounds\cookoff1.ogg", _target, false, getPos _target, 60, 1, 250];
    This seems overly complicated but its the only way I've been able to play custom sounds. Some of the other mission builders may have a neater way.
    sigpic

    Comment


    • #3
      Re: Help with my description.ext for custom music!

      Also, regarding triggers and vehicles...

      When your unit is in the vehicle it will not show as present to the trigger. The only unit present to the trigger is the vehicle and it wont trigger unless you link the trigger to the vehicle. Either test by walking in or else add another condition that will look inside vehicles for more units.
      |TG-189th| Unkl
      ArmA 3 Game Officer
      Dean of Tactical Gamer University
      189th Infantry Brigade Member
      SUBMIT A RIBBON NOMINATION OR CONTACT AN ARMA ADMIN
      "We quickly advance in the opposite direction and take cover in a house on the SW side of town." - BadStache

      Comment


      • #4
        Re: Help with my description.ext for custom music!

        Originally posted by mecharius View Post
        Hey No Name, I'm not really an expert on sounds but have managed to get the following working:

        Code:
        // in description.ext
        class CfgSounds
        {
            sounds[] = {cookoff1};
            
            class cookoff1
            {
                name = "cookoff1";
                sound[] = {"sounds\cookoff1.ogg", 3, 1};
            };
        };
        In my init.sqf:

        Code:
        MISSION_ROOT = call {
            private "_arr";
            _arr = toArray str missionConfigFile;
            _arr resize (count _arr - 15);
            toString _arr
        };
        publicVariable 'MISSION_ROOT';
        And then to play the sound (not music I know but I haven't tried music)

        Code:
        playSound3D [MISSION_ROOT + "sounds\cookoff1.ogg", _target, false, getPos _target, 60, 1, 250];
        This seems overly complicated but its the only way I've been able to play custom sounds. Some of the other mission builders may have a neater way.
        I tried this but it did not fix it. Thank you for the help though.

        Originally posted by Unkl View Post
        Also, regarding triggers and vehicles...

        When your unit is in the vehicle it will not show as present to the trigger. The only unit present to the trigger is the vehicle and it wont trigger unless you link the trigger to the vehicle. Either test by walking in or else add another condition that will look inside vehicles for more units.
        This may be helpful when i can return to opening the mission. Thank you for the advice. But shouldnt it activate (the trigger) if its activation is set to "Anybody"?

        Comment


        • #5
          Re: Help with my description.ext for custom music!

          Originally posted by No Name View Post
          Code:
          class CfgSound
          {
          	tracks[]={Music1, Music2, Music3};
          
          	class Music1
          	{
          		name[] = "Music1";
          		sound[] = {"\sound\Music1.ogg", db+25, 1.0};
                  };
          
          };
          
          	class Music2
          	{
          		name[] = "Music2";
          		sound[] = {"\sound\Music2.ogg", db+25, 1.0};
                  };
          
          };
          
          	class Music3
          	{
          		name[] = "Music3";
          		sound[] = {"\sound\Music3.ogg", db+25, 1.0};
                  };
          
          };
          Take a careful look at the syntax of your description.ext file. You seem to have extra closing braces in between the music classes. Try removing the red highlighted braces.
          sigpic

          Comment


          • #6
            Help with my description.ext for custom music!

            Ya using cfgsounds I've usually been satisfied...
            to be safe just use cfgsounds, but if you found out how to work cfgMusic correctly it would be appreciated if you make a thread about for others future reference
            Yink | Vanilla Pilot | Killer of Stirling | CS GOD | Projects Team

            Comment


            • #7
              Re: Help with my description.ext for custom music!

              Yink's comment also made me realise you have "cfgSound" instead of "cfgSounds" as well!
              sigpic

              Comment


              • #8
                Re: Help with my description.ext for custom music!

                Hey guys thanks for the assist! It's 6am here and I just got back from the hospital due to nearly losing my thumb. This is more than pleasing to come back to. I will try all the fixes out and see what comes up. Again thank you all very much for the input. I am going to drive down and get some coffee and then try this. Thanks

                Comment


                • #9
                  Re: Help with my description.ext for custom music!

                  Hmmm tried all the fixes you guys had for me, but i'm still getting that error about line 6:

                  Code:
                  "File C:\Users\Documents\ArmA 2 Other Profiles\ J%2e%20Sosa\missions\air raid.Takistan\description.ext, line 6: Config: '"' encountered instead of '{'
                  for better refrence i will show you which is line 6:

                  Code:
                  class CfgSounds
                  {
                  	tracks[]={Music1, Music2, Music3};
                  
                  	class Music1
                  	{
                  		name[] = "Music1";
                  		sound[] = {"\sound\Music1.ogg", db+25, 1.0};
                          };
                  line 6 is right under "class Music1". Couldn't find out how to highlight it in red.

                  Comment


                  • #10
                    Re: Help with my description.ext for custom music!

                    Hmm... I think you have the tracks array initialized incorrectly.

                    tracks[] = [Music1, Music2, Music3]; instead of using the {}...

                    Comment


                    • #11
                      Re: Help with my description.ext for custom music!

                      Originally posted by |TG| B View Post
                      Hmm... I think you have the tracks array initialized incorrectly.

                      tracks[] = [Music1, Music2, Music3]; instead of using the {}...
                      Thanks for the input but that still does not solve the issue with line 6.... I don't need help with ANYTHING else in the coding currently EXCEPT line 6. That is the problem here. Not line 4 or 5

                      Comment


                      • #12
                        Re: Help with my description.ext for custom music!

                        No I pointed that out because sometimes syntax errors are caused by what is immediately in front or after or something completely unrelated. It is because of how parsing is done in semantical phase of compiling or interpreting a code. You thought I was picking on you for a small mistakes... Not at all. I am truly trying to help you out... You can be stuck in one line forever just because the error message says so. Yet there are many cases the line number does not point to the real culprit.

                        So I take back what I said about the {} brackets being there (BIS samples). But I believe mecharius is correct. You are closing your cfgsounds class way too early before declare Music1, Music2, Music3 as classes inside that class.

                        Also sounds might be a fixed variable name... Using tracks instead of sounds messes anything up?

                        Another and final guess might be that you have declared the cfgSounds class inside another class... Make sure close any class before the cfgMusic.

                        Here is an example I found on how to declare it with multiple sounds. Anyway, you seem to be getting very irritated. Hope you figure this out.

                        Code:
                        class CfgSounds
                             {
                             sounds[] = { voicesample, voicesample2 };
                        
                             class voicesample
                             {
                                  name = "voicesample";
                                  sound[] = {"voicesample.ogg", db-40, 1.0};
                                  titles[] =
                                  {
                                       0, $STRM_Voice
                                  };
                             };
                             class voicesample2
                             {
                                  name = "voicesample2";
                                  sound[] = {"voicesample2.ogg", db-20, 1.0};
                                  titles[] =
                                  {
                                       0, $STRM_Voice2
                                  };
                             };
                        };

                        Comment


                        • #13
                          Re: Help with my description.ext for custom music!

                          You must spread some Reputation around before giving it to |TG| B again.
                          Nice post B. Hope it works out soon...stick with it No Name...we'll get ya running.
                          |TG-189th| Unkl
                          ArmA 3 Game Officer
                          Dean of Tactical Gamer University
                          189th Infantry Brigade Member
                          SUBMIT A RIBBON NOMINATION OR CONTACT AN ARMA ADMIN
                          "We quickly advance in the opposite direction and take cover in a house on the SW side of town." - BadStache

                          Comment


                          • #14
                            Re: Help with my description.ext for custom music!

                            This normally works for me:

                            Code:
                            class CfgMusic 
                            { 
                            tracks[]={}; 
                            class music1
                            { 
                            	name = "music1"; 
                            	sound[] = {\music\Track08_Harvest_Red.ogg, db+10, 1.0}; 
                            }; 
                            };
                            I would call for the music with: playmusic "music1";
                            TG-189ᵀᴴ ArmaXO TGU Instructor

                            Comment


                            • #15
                              Re: Help with my description.ext for custom music!

                              Originally posted by No Name View Post
                              Hmmm tried all the fixes you guys had for me, but i'm still getting that error about line 6:

                              Code:
                              "File C:\Users\Documents\ArmA 2 Other Profiles\ J%2e%20Sosa\missions\air raid.Takistan\description.ext, line 6: Config: '"' encountered instead of '{'
                              for better refrence i will show you which is line 6:

                              Code:
                              class CfgSounds
                              {
                              	tracks[]={Music1, Music2, Music3};
                              
                              	class Music1
                              	{
                              		name[] = "Music1";
                              		sound[] = {"\sound\Music1.ogg", db+25, 1.0};
                                      };
                              line 6 is right under "class Music1". Couldn't find out how to highlight it in red.

                              take away the "" in sound[] = {"\sound\Music1.ogg", db+25, 1.0};

                              so use this instead {\sound\Music1.ogg, db+25, 1.0};
                              TG-189ᵀᴴ ArmaXO TGU Instructor

                              Comment

                              Connect

                              Collapse

                              TeamSpeak 3 Server

                              Collapse

                              Advertisement

                              Collapse

                              Twitter Feed

                              Collapse

                              Working...
                              X