Jump to content
Sign in to follow this  
zephyrdark

Issue with CfgSounds in config.bin/cpp

Recommended Posts

Currently running into a complete wall of a problem with the config for an addon I am working on.

Currently the config contains:

class CfgSounds{
sounds[] = {sf_1oclock_s};
class sf_1oclock_s
{
	name = "1oclocks";
	sound[] = {"tg_shotfinder\sounds\shot1oclock_2.ogg", 1, 1};
	titles[] = {};
};
};

From what I can tell, I have no syntax errors and the class is basically just a template with the changes I needed to make in the strings and the class name. The issue arises when the the sound is called in a mission, it states that the sound does not exist despite the config saying it should. If it helps, the config.bin/cpp also contains a cfgVehicles, cfgVehicleClasses,CfgRadio, and some rscTitle's.

Share this post


Link to post
Share on other sites

If you're using it for more than one mission just slap it as a .hpp in your addon. Don't compile it with the config though. Then you can call it through the mission in the description.ext. Like this.

#include "\pfx_myaddon\snd\sounds.hpp"

Tada.

Share this post


Link to post
Share on other sites

The issue there is then the mission maker is required to add that to their description. Preferably, I would like all the work to be done for the mission maker in the addon. I have seen pbo's with binarized configs that have cfgSounds in them. Issue is, I don't see any difference in what I have done compared to other addon devs.

Share this post


Link to post
Share on other sites

I think that the sounds[] = {}; array needs to have what is classed as the name. So try this instead.

class CfgSounds{
sounds[] = {1oclocks};
class sf_1oclock_s
{
	name = "1oclocks";
	sound[] = {"tg_shotfinder\sounds\shot1oclock_2.ogg", 1, 1};
	titles[] = {};
};
};

Share this post


Link to post
Share on other sites
I think that the sounds[] = {}; array needs to have what is classed as the name. So try this instead.

class CfgSounds{
   sounds[] = {1oclocks};
   class sf_1oclock_s
   {
       name = "1oclocks";
       sound[] = {"tg_shotfinder\sounds\shot1oclock_2.ogg", 1, 1};
       titles[] = {};
   };
};

No-Joy. Still running into the same issues with cfgSounds not even being registered. Would be great if anybody had any insight on this.

Share this post


Link to post
Share on other sites

Havent played with CFGSounds myself but .....

Where is your CFGPatches ?

You may need it.

class CfgPatches
{
class MyTag_MySound
       {
	units[] = {};
	requiredVersion = 1.00;
	requiredAddons[] = {};
};

};
class CfgSounds{
class Vas_yessir; // inherit an existing sound
   class sf_1oclock_s : Vas_yessir
   {
       name = "1oclocks";
       sound[] = {"tg_shotfinder\sounds\shot1oclock_2.ogg", 1, 1};
       titles[] = {};
   };
};

Untested

Share this post


Link to post
Share on other sites

I already have a cfgPatches, possibly I'm doing something wrong there or elsewhere in the config. He's the full config.cpp as of right now.

class CfgPatches
{
   class tg_shotfinder
   {
       units[] = {};
       weapons[] = {};
       requiredVersion = 1.0;
       requiredAddons[] = {"CAData", "CBA_MAIN", "ACE_MAIN","ACE_SYS_INTERACTION"};
       author[] = {"BlackPython","OPS"};
   };
};


class CfgSounds
{
   sounds[] = {SF 1oclock};
   class oc1
   {
       name = "SF 1oclock";
       sound[] = {"tg_shotfinder\sounds\shot1oclock.ogg", 1, 1};
       titles[] = {};
   };
};

class CfgVehicleClasses
{
   class tg_shotfinder_vc
   {
       displayName = "BoomeRange Objects";
   };
};




class CfgVehicles
{
   class HouseBase;
   class House: HouseBase
   {
       class DestructionEffects;
       class AnimationSources;
   };
   class tg_shotfinder_mast: House 
   {
       vehicleClass="tg_shotfinder_vc";
       icon = "tg_shotfinder\object.paa";
       accuracy = 0.200000;
       scope=2;
       simulation="House";
       camouflage=10;
       Audible=10;
       mapSize=0.2;
       cost=100000000;
       threat[]={1,1,1};
       armor = 1000;
       irtarget=0;
       destrType = "DestructYes";
       lasertarget=0;
       side = 3;
       displayName = "BoomeRange Antenna";
       animated = 1;
       model = "\tg_shotfinder\model\mast.p3d";
   };
   class sf_tripod : tg_shotfinder_mast 
   {
       displayName = "BoomeRange Full Assembly";
       model = "\tg_shotfinder\model\fullassembly.p3d";
   };
   class sf_carrycase : tg_shotfinder_mast
   {
         displayName = "BoomeRange Transport Case";
         model = "\tg_shotfinder\model\case.p3d";
   };
};


class Extended_PostInit_EventHandlers
{
   class tg_shotfinderInit {
       clientInit = "sfnul = [] spawn compile preprocessFileLineNumbers 'tg_shotfinder\SF_clientInit.sqf'";

   };
};

Share this post


Link to post
Share on other sites

class CfgSounds{
class Vas_yessir; // inherit an existing sound
   class sf_1oclock_s : Vas_yessir
   {
       name = "1oclocks";
       sound[] = {"tg_shotfinder\sounds\shot1oclock_2.ogg", 1, 1};
       titles[] = {};
   };
};

requote

Share this post


Link to post
Share on other sites

haha! Thank you GNat! So, looking at it, it was the sounds[]= at the top of the class interfering with everything else, that and the inheriting. (It's working now)

Share this post


Link to post
Share on other sites
sounds[]= at the top of the class interfering with everything else, that and the inheriting.

Yep, that was my guess.

TIP: The ALL-IN-ONE config from DevHeaven will help you read BIS default definitions, then make your own like them.

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  

×