Jump to content
Sign in to follow this  
ricki

Subfolders in config.cpp

Recommended Posts

Hi

I defined some sounds in my config like:

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

class CfgSounds

{

  sounds[] = {};

  class firstsound

  {

     name = "firstsound";

     sound[] = {"\RCK_SOUND\sounds\first.ogg", db+10, 1.0};

     titles[] = {};

  };

};

Config.cpp went to a folder called RCK_SOUND as usual and pbo'ed.

When I want to "_unit say firstsound" it says:

"firstsound not found"

Whats wrong with my config ?

Tried several versions:

\RCK_SOUND\sounds\first.ogg

RCK_SOUND\sounds\first.ogg

\sounds\first.ogg

sounds\first.ogg

\first.ogg

first.ogg

Sick now of restarting Arma again and again.

Can someone tell me how it's done correctly ?

regards

rocko

edit : SOLVED, see my third post

Share this post


Link to post
Share on other sites

have you tried

_unit say "yoursound"

works for me with same config as yours , as long as the code is from within the addon itself, not sure if your asking the sound to be played from a mission ?

justincase my cpp

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

{

class mysound01

{

name = "mysound01";

sound[]={"\ofp2_sounds\sounds\mysound.wss",db+10,1};

titles[] = {0, $STRM};

};

};

Share this post


Link to post
Share on other sites

I am sorry.

It should say <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">playsound "firstsound" instead of

Quote[/b] ]"_unit say firstsound"
.

The playsound comand is the right which is in a script that comes with the addon.

Share this post


Link to post
Share on other sites

then i can only think you have named your subfolder "sound" instead of "sounds" because i made that mistake once and it killed me lol.

but like i say mine works fine and i have done exactly as you ,except .wss which has no bearing here .

good luck sry if i havent helped.

Share this post


Link to post
Share on other sites

thx for helping man.

sound folder is called the same like in the config.

<s>this drives me crazy</s>

------------------------------------------------------------

edit: ok, solved

i removed the line that says

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">sounds[] = {};

sound is playing now.

Share this post


Link to post
Share on other sites

Why does removing that line make that work??

I wish to understand. There has got to be a logical reason for that.

If I understand I can apply the same logic else where because I every now and then I have pathing problems such as these.

Share this post


Link to post
Share on other sites

its exactly what it is it says there are no sounds.

its similar in any situation like for example in the vehicle and unit config ,some people converted from ofp with default [] ={}

and all weapons were lost for soldiers.

Share this post


Link to post
Share on other sites

Maybe if it had read:

sounds[] = {"firstsound"};

or maybe:

sounds[] = {firstsound};

(whichever works)

it might have worked ok.

Planck

Share this post


Link to post
Share on other sites

However, I have many config.cpp that uses lines of code like...

sounds[] = {};

And the sounds work.

So I am at a loss here.

Share this post


Link to post
Share on other sites

lol

then its random !

guys, i dunno why this works without that line, but it does work. thats all what i wanted biggrin_o.gif

but ofp2's explanation sounds logical to me.

Viper, can you please add a working example of your configs.

I'd like to see that, or whats the difference to my config.

regards

rocko

Share this post


Link to post
Share on other sites

I'm having a somewhat similar problem adding images to my GrenadierPack mod. Here's the setup:

Inside the .pbo I have the config.cpp, and a folder named "Images" that contains the .paa files for the images. In my config.cpp, how do I reference the image files? Just by name? I tried referencing them by \S63_GrenadierPack\Images\image.paa but I got an error when attempting to view the image inside the ammobox.

Should the first part of the path be the proper name of the mod (i.e. the Classname that is in the config.cpp) or the actual name of the PBO file (which, in my case, is S63_GrenadierPack_Cfg)???

Suggestions???

Share this post


Link to post
Share on other sites

can you post an example segment of your config regarding the images ?

edit:

name the path after the name of your .pbo !!

if it's S63_Grenadier_Pack_CFG then name all paths like that.

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

class CfgPatches

{

class ROCKO_somewhat

{

has nothing to to with path when i call my .pbo "ROCKO_whatsome.pbo"

wink_o.gif

edit2: regard the .pbo as your "start"-folder (but packed), so you would start referring by that at first.

regards

rocko

Share this post


Link to post
Share on other sites
lol

then its random !

guys, i dunno why this works without that line, but it does work. thats all what i wanted biggrin_o.gif

but ofp2's explanation sounds logical to me.

Viper, can you please add a working example of your configs.

I'd like to see that, or whats the difference to my config.

regards

rocko

config.cpp of MOD version of Mando Missiles v2.2

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

class CfgPatches

{

class Mando_Missiles

{

units[] ={};

weapons[] ={};

requiredAddons[] = {};

requiredVersion = 1.08;

version = 2.2;

};

};

#include "\mando_missiles\mando_missile.h"

// [... code removed for brevity ...]

//**************************************

class CfgSounds

{

sounds[] = {};

// Mando Sounds

// Needed for Mando Missile ArmA

#include "\mando_missiles\mando_sounds.h"

};

Now the "\mando_missiles\mando_sounds.h" is as follows...

Quote[/b] ]

class mando_missile1

{

name = "mando_missile1";

sound[] = {"\mando_missiles\sounds\mando_missile1.ogg", db-0, 1.0};

titles[] = {0};

};

class mando_radar1

{

name = "mando_radar1";

sound[] = {"\mando_missiles\sounds\mando_radar1.ogg", db-0, 1.0};

titles[] = {0};

};

class mando_radar2

{

name = "mando_radar2";

sound[] = {"\mando_missiles\sounds\mando_radar2.ogg", db-0, 1.0};

titles[] = {0};

};

class mando_target1

{

name = "mando_target1";

sound[] = {"\mando_missiles\sounds\mando_target1.ogg", db-0, 1.0};

titles[] = {0};

};

class mando_noammo1

{

name = "mando_noammo1";

sound[] = {"\mando_missiles\sounds\mando_noammo1.ogg", db-0, 1.0};

titles[] = {0};

};

class mando_noammo2

{

name = "mando_noammo2";

sound[] = {"\mando_missiles\sounds\mando_noammo2.ogg", db-0, 1.0};

titles[] = {0};

};

class mando_radaron

{

name = "mando_radaron";

sound[] = {"\mando_missiles\sounds\mando_radaron.ogg", db-0, 1.0};

titles[] = {0};

};

class mando_radaroff

{

name = "mando_radaroff";

sound[] = {"\mando_missiles\sounds\mando_radaroff.ogg", db-0, 1.0};

titles[] = {0};

};

class mando_lockedon

{

name = "mando_lockedon";

sound[] = {"\mando_missiles\sounds\threatnewus.ogg", db-0, 1.0};

titles[] = {0};

};

class mando_scud

{

name = "mando_scud";

sound[] = {"\mando_missiles\sounds\mando_scud.ogg", db+50, 1.0};

titles[] = {0};

};

And again I do not pretend to understand this. I just learn from what I see other great scripters do. And this is working for me. I agree what has been said earlier in this thread makes sense but then why is my code working?? I scratch my head while waiting for a GURU to explain

Share this post


Link to post
Share on other sites

uuh, there is a mod version of this script huh.gif???

nice, gotta look for it.

but thanks for the config, man.

gonna wait for a Guru to explain, too. huh.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  

×