Jump to content
Sign in to follow this  
DestroyerX

Custom music

Recommended Posts

Hi,

I have this in the description.ext:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgSounds

{

sounds[] = {

talk1, talk2, talk3

};

class talk1

{

name = "talk1";

sound[] = {"talk1.ogg", db+290, 1.0};

titles[] =

{

};

};

class talk2

{

name = "talk2";

sound[] = {"talk2.ogg", db+290, 1.0};

titles[] =

{

};

};

class talk3

{

name = "talk3";

sound[] = {"talk3.ogg", db+290, 1.0};

titles[] =

{

};

};

class CfgMusic

{

tracks[]=

{

piano, light, rain

};

class piano

{

name = "piano";

sound[] = {\music\piano.ogg, db+0, 1.0};

};

class light

{

name = "light";

sound[] = {\music\light.ogg, db+0, 1.0};

};

class rain

{

name = "rain";

sound[] = {\music\rain.ogg, db+0, 1.0};

};

<span id='postcolor'>

And the sounds are working but I can't choose the music anymore! And the playmusic "rain"; command doesn't work either.

I had a topic earlier of this and at that moment it worked but now not anymore mad.gifsad.gifconfused.gif

Can anyone help me please?

Share this post


Link to post
Share on other sites

Hmmm. Have you checked that the problem isn't in the music file itself. I had that problem and it was fixed when I converted the ogg file again with 22khz and about 60kbps. Trust me, it could really help.

Share this post


Link to post
Share on other sites

I think its not the files but the description.ext. You see, when I do the music first and after that the sounds, the music will work but the sounds dont smile.gif

Share this post


Link to post
Share on other sites

I tried some other Little things to change it, but nothing seems to work... Does anybody knows?

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (DestroyerX @ April 06 2002,10:31)</td></tr><tr><td id="QUOTE">Hi,

I have this in the description.ext:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgSounds

{

sounds[] =  {

talk1, talk2, talk3

};

class talk1

{

name = "talk1";

sound[] = {"talk1.ogg", db+290, 1.0};

titles[] =

{

};

};

class talk2

{

name = "talk2";

sound[] = {"talk2.ogg", db+290, 1.0};

titles[] =

{

};

};

class talk3

{

name = "talk3";

sound[] = {"talk3.ogg", db+290, 1.0};

titles[] =

{

};

};

class CfgMusic

{

tracks[]=

{

piano, light, rain

};

class piano

{

name = "piano";

sound[] = {\music\piano.ogg, db+0, 1.0};

};

class light

{

name = "light";

sound[] = {\music\light.ogg, db+0, 1.0};

};

class rain

{

name = "rain";

sound[] = {\music\rain.ogg, db+0, 1.0};

};

<span id='postcolor'>

And the sounds are working but I can't choose the music anymore! And the playmusic "rain"; command doesn't work either.

I had a topic earlier of this and at that moment it worked but now not anymore  mad.gif  sad.gif  confused.gif

Can anyone help me please?<span id='postcolor'>

Add another "};" at the end of your description-file.

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">class CfgMusic

{

tracks[]=

{

piano, light, rain

};

class piano

{

name = "piano";

sound[] = {\music\piano.ogg, db+0, 1.0};

};

class light

{

name = "light";

sound[] = {\music\light.ogg, db+0, 1.0};

};

class rain

{

name = "rain";

sound[] = {\music\rain.ogg, db+0, 1.0};

};

};

<span id='postcolor'>

Share this post


Link to post
Share on other sites

The extra "};" at the end, tells OFP that this is the end of the file or something. If you leave it out, then OFP waits for what to come next after the "rain"-class. -Therefore class:"rain" won't work as it is incomplete.

I'm no programmer, but I think this is how OFP uses that file smile.gif

Share this post


Link to post
Share on other sites

Thanks for the suggestion Shadow, but it didn't work  sad.gif.

This is pretty stupid, since I work quite a long time with custom music & sounds...

Share this post


Link to post
Share on other sites

Please! Anyone?!! I tried some things but I still havent figure it out yet! sad.gif

Share this post


Link to post
Share on other sites

Are you sure it isnt just that its playing with to low volume?

when comparing with the sound its waaaaaaay lower smile.gif

Im no mission editor so I dont know... But its what I see from looking at the file.

The fact that you are lacking an end bracket on CfgSounds can also have something to do with it wink.gif

Share this post


Link to post
Share on other sites

No, the deal is: You cant even pick the music-files on the Effects-tab of a trigger.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (DestroyerX @ April 10 2002,18:08)</td></tr><tr><td id="QUOTE">No, the deal is: You cant even pick the music-files on the Effects-tab of a trigger.<span id='postcolor'>

But CfgSounds is incomplete, hence CfgMusic wont work...

Try what I said, if it doesnt work, my wrong.

Share this post


Link to post
Share on other sites

Sorry, but what do you mean exactley with Cfgsounds isnt complete n stuff? Can you be more specific please? confused.gif

Share this post


Link to post
Share on other sites

I never pick my custom music from a list in the editor. I allways use the playmusic-command smile.gif

Share this post


Link to post
Share on other sites

I did what you said about the cfgsounds. And added an end-thingie at the end but the game locks up now.

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgSounds

{

sounds[] =  {

talk1, talk2, talk3

};

class talk1

{

name = "talk1";

sound[] = {"talk1.ogg", db+290, 1.0};

titles[] =

{

};

};

class talk2

{

name = "talk2";

sound[] = {"talk2.ogg", db+290, 1.0};

titles[] =

{

};

};

class talk3

{

name = "talk3";

sound[] = {"talk3.ogg", db+290, 1.0};

titles[] =

{

};

class CfgMusic

{

tracks[]=

{

piano, light, rain

};

class piano

{

name = "piano";

sound[] = {\music\piano.ogg, db+0, 1.0};

};

class light

{

name = "light";

sound[] = {\music\light.ogg, db+0, 1.0};

};

class rain

{

name = "rain";

sound[] = {\music\rain.ogg, db+0, 1.0};

{

};

};

<span id='postcolor'>

Share this post


Link to post
Share on other sites

You did not do what I said biggrin.gif

I said it LACKED an end bracket... You removed the one it had instead smile.gif

change

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">class talk3

{

name = "talk3";

sound[] = {"talk3.ogg", db+290, 1.0};

titles[] =

{

};<span id='postcolor'>

To

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">class talk3

{

name = "talk3";

sound[] = {"talk3.ogg", db+290, 1.0};

titles[] =

{

};

}; //END CLASS TALK3

}; //END CLASS CFGSOUNDS

<span id='postcolor'>

-EDIT- </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">class rain

{

name = "rain";

sound[] = {\music\rain.ogg, db+0, 1.0};

{

};

};<span id='postcolor'>

is also wrong, change to

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">class rain

{

name = "rain";

sound[] = {\music\rain.ogg, db+0, 1.0};

}; //END CLASS RAIN

}; //END CLASS CFGMUSIC

<span id='postcolor'>

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">You did not do what I said  biggrin.gif<span id='postcolor'>

Sorry, must be my English, but i'm gonna blame it on...........Aliens from space......   wink.gif  Ahem,

Pc locks up now

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgSounds

{

sounds[] =  {

talk1, talk2, talk3

};

class talk1

{

name = "talk1";

sound[] = {"talk1.ogg", db+290, 1.0};

titles[] =

{

};

};

class talk2

{

name = "talk2";

sound[] = {"talk2.ogg", db+290, 1.0};

titles[] =

{

};

};

class talk3

{

name = "talk3";

sound[] = {"talk3.ogg", db+290, 1.0};

titles[] =

{

};

}; //END CLASS TALK3

}; //END CLASS CFGSOUNDS

class CfgMusic

{

tracks[]=

{

piano, light, rain

};

class piano

{

name = "piano";

sound[] = {\music\piano.ogg, db+0, 1.0};

};

class light

{

name = "light";

sound[] = {\music\light.ogg, db+0, 1.0};

};

class rain

{

name = "rain";

sound[] = {\music\rain.ogg, db+0, 1.0};

}; //END CLASS RAIN

}; //END CLASS CFGMUSIC

<span id='postcolor'>

Share this post


Link to post
Share on other sites

Never mind, I did cclas instead of class. Thanks! I got it to work now!!

Cheers! biggrin.gif

Share this post


Link to post
Share on other sites

Well, Im glad to have been of help biggrin.gif

I also have a similar stupid (well, yours is not stupid, but obvious wink.gif) problem with my trainscript... One way of coding screws it up (really short way and easy, another makes it work (longer, though not troublesome), but they are exactly the same in principle and function...

Went like this:

Way1:

if(COND1): DoSomethingEasy; ResetCondition

Way2:

if(COND1 and COND2): DoSomething1; ResetCondition

if(COND1 and COND3): DoSomething2; ResetCondition

if(COND1 and COND4): DoSomething3; ResetCondition

if(COND1 and COND5): DoSomething4; ResetCondition

Way2 works. Way1 dont.

But another way, Way3 does:

Way3:

if(COND1 and COND2): DoSomethingEasy; ResetCondition

if(COND1 and COND3): DoSomethingEasy; ResetCondition

if(COND1 and COND4): DoSomethingEasy; ResetCondition

if(COND1 and COND5): DoSomethingEasy; ResetCondition

Any condition can be met, same result, hence it is exactly as Way1... But Way1 will NOT work biggrin.gif (DoSomethingEasy is a merge of ...1-4, I used manual atan instead of atan2...)

Everyone hates coding, dont we? tounge.gif

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
Sign in to follow this  

×