Jump to content
fiercedrummer117

Mod that replaces another mod's audio? SOLVED

Recommended Posts

Good day all,

 

I've recently had an interest in sound modding for Arma 3, though after looking through a few examples and giving it my best go for a few hours I've decided that I am in a bit over my head and could use some community help. My knowledge base of Arma's coding language is beginner level at best so please assume that I have no idea what you're talking about before you start throwing pseudo code at me.

What I'm trying to accomplish:
I wanted to start out easy and make a simple mod that replaces the AR15 reloading sounds for RHSUSAF, as well as have the ability to expand on this concept as I learn.

What I have so far:

1x Addon with the following contents:

      - Addons folder

        - MyMod.PBO

           - bin file (config)

           - Sound Folder

 

config code:

class CfgPatches
{
	class New_RHS_Reloads
	{
		units[]={};
		weapons[]={};
		requiredVersion=0.1;
		requiredAddons[]=
		{
			"rhsusf_weapons"
		};
		version="1";
		projectName="New_RHS_Reloads";
		author="Drummershocked";
	};
};
class CfgAddons
{
	class PreloadAddons
	{
		class CONFIG_SOUNDS_CLASS
		{
			list[]=
			{
				"New_RHS_Reloads"
			};
		};
	};
};

class CfgWeapons {

class Rifle_Base_F;	// External class reference

class rhs_weap_m4_Base: Rifle_Base_F	
{
	reloadMagazineSound[]=
	"\Sounds\Reloads\M4_reload.ogg",
	1,
	1,
	15
};

Issues that I'm having:

I'm not gonna lie folks... It straight up doesn't work, game doesn't throw me any errors and my sound doesn't play when reloading any of the RHS AR15 type weapons. If there is some sort of in-game debug console I'm not sure how to access it either.

 

What I am asking for:

Any sort of guidance is welcome.


Thank you all in advance!

 

Share this post


Link to post
Share on other sites

Well for a start the path to your new reload sound looks broken, unless of course your new PBO is called Sounds.pbo (which it isn't as you say its called 'MyPBO' in your above file structure). Also the syntax for your code looks wonky.

Try:

class rhs_weap_m4_Base: Rifle_Base_F	
{
	reloadMagazineSound[]={
	"\MyPBO\Sounds\Reloads\M4_reload.ogg",
	1,
	1,
	15};
};

Notice I enclosed the sound information in {} and put a ; at the end, that correctly defines it in an array.

Share this post


Link to post
Share on other sites
Quote

Well for a start the path to your new reload sound looks broken, unless of course your new PBO is called Sounds.pbo (which it isn't as you say its called 'MyPBO' in your above file structure). Also the syntax for your code looks wonky.

Try:

Quote

Notice I enclosed the sound information in {} and put a ; at the end, that correctly defines it in an array.

 

Thank you for the input, yea I know it all looks like an eye sore, apologies. Though i can't seem to convert my config (bin file) back to a bin file, it throws me an error stating:

line 41: /CfgWeapons/: missing '}'
Error reading config file

So it's telling me to close that bracket, which line 42 should've done. Thoughts?

Share this post


Link to post
Share on other sites
6 hours ago, fiercedrummer117 said:

So it's telling me to close that bracket, which line 42 should've done. Thoughts?

Looks like you just need another }; at the very end of the config to close out cfgWeapons

 

Spoiler

class CfgPatches
{
	class New_RHS_Reloads
	{
		units[]={};
		weapons[]={};
		requiredVersion=0.1;
		requiredAddons[]=
		{
			"rhsusf_weapons"
		};
		version="1";
		projectName="New_RHS_Reloads";
		author="Drummershocked";
	};
};
class CfgAddons
{
	class PreloadAddons
	{
		class CONFIG_SOUNDS_CLASS
		{
			list[]=
			{
				"New_RHS_Reloads"
			};
		};
	};
};

class CfgWeapons 
{
	class Rifle_Base_F;	// External class reference

	class rhs_weap_m4_Base: Rifle_Base_F	
	{
		reloadMagazineSound[]=
		"\Sounds\Reloads\M4_reload.ogg",
		1,
		1,
		15
	};
};

 

 

Share this post


Link to post
Share on other sites

Well good news is, I managed to correct the syntax and convert to BIN. Bad news is, still doesn't work. The RHS M4s are still playing the original reload sound.

Code below: 

class CfgPatches
{
	class New_RHS_Reloads
	{
		units[]={};
		weapons[]={};
		requiredVersion=0.1;
		requiredAddons[]=
		{
			"rhsusf_weapons"
		};
		version="1";
		projectName="New_RHS_Reloads";
		author="Drummershocked";
	};
};
class CfgAddons
{
	class PreloadAddons
	{
		class CONFIG_SOUNDS_CLASS
		{
			list[]=
			{
				"New_RHS_Reloads"
			};
		};
	};
};

class CfgWeapons 
{
	class Rifle_Base_F;	// External class reference

	class rhs_weap_m4_Base: Rifle_Base_F	
	{
		reloadMagazineSound[]=
		{
			"\Sounds\Reloads\M4_reload.ogg",
			1,
			1,
			15
		};
	};
};

 

Share this post


Link to post
Share on other sites

rhsusf_weapons is an addon which has only model. You need to provide corrected required addons. RHS mods have loadoders addons which can be used to load your addon after all RHS configs - for RHSUSF it is rhsusf_main_loadorder

  • Like 1

Share this post


Link to post
Share on other sites
Quote

rhsusf_weapons is an addon which has only model. You need to provide corrected required addons. RHS mods have loadoders addons which can be used to load your addon after all RHS configs - for RHSUSF it is rhsusf_main_loadorder

Ah okay, good info thank you!

One step further now, the old reload isn't playing anymore so that's good. however no sound at all is playing now. Ill continue to dive deeper into why. As always, any and all help appreciated and thank you for getting me this far everyone!

Code so far:
 

class CfgPatches
{
	class New_RHS_Reloads
	{
		units[]={};
		weapons[]={};
		requiredVersion=0.1;
		requiredAddons[]=
		{
			"rhsusf_main_loadorder"
		};
		version="1";
		projectName="New_RHS_Reloads";
		author="Drummershocked";
	};
};
class CfgAddons
{
	class PreloadAddons
	{
		class CONFIG_SOUNDS_CLASS
		{
			list[]=
			{
				"New_RHS_Reloads"
			};
		};
	};
};
class CfgWeapons
{
	class Rifle_Base_F;
	class rhs_weap_m4_Base: Rifle_Base_F
	{
		reloadMagazineSound[]=
		{
			"\Sounds\Reloads\M4_reload.ogg",
			1,
			1,
			15
		};
	};
};

 

Share this post


Link to post
Share on other sites
On 2/5/2022 at 11:55 AM, Jackal326 said:

 


class rhs_weap_m4_Base: Rifle_Base_F	
{
	reloadMagazineSound[]={
	"\DONT_FORGET_YOUR_PBO_NAME_NEEDS_TO_GO_HERE_MINUS_PBO_EXTENSION\Sounds\Reloads\M4_reload.ogg",
	1,
	1,
	15};
};

 

See my previous reply regarding the fact you haven't referenced the PBO in your path.

 

In your original code, the game is looking for a pbo called 'Sounds', which doesn't exist...

This error is on me as I originally fixed that for you, and then posted broken code without the fix in it when I closed cfgWeapons for you. D'oh! :face_palm:

Share this post


Link to post
Share on other sites
1 hour ago, Jackal326 said:

See my previous reply regarding the fact you haven't referenced the PBO in your path.

 

In your original code, the game is looking for a pbo called 'Sounds', which doesn't exist...

This error is on me as I originally fixed that for you, and then posted broken code without the fix in it when I closed cfgWeapons for you. D'oh! :face_palm:

Nah you're good brother, it happens. On the bright side everything works now! Thank you for all the help.

 

Final Code:

class CfgPatches
{
	class New_RHS_Reloads
	{
		units[]={};
		weapons[]={};
		requiredVersion=0.1;
		requiredAddons[]=
		{
			"rhsusf_main_loadorder"
		};
		version="1";
		projectName="New_RHS_Reloads";
		author="Drummershocked";
	};
};
class CfgAddons
{
	class PreloadAddons
	{
		class CONFIG_SOUNDS_CLASS
		{
			list[]=
			{
				"New_RHS_Reloads"
			};
		};
	};
};
class CfgWeapons
{
	class Rifle_Base_F;
	class rhs_weap_m4_Base: Rifle_Base_F
	{
		reloadMagazineSound[]=
		{
			"\New_RHS_Reloads\Sounds\Reloads\M4_reload.ogg",
			1,
			1,
			15
		};
	};
};

My final question is on how to expand this script to apply to the other RHS weapons. I'm going to assume that its just a case of copy pasting and renaming a few things to reflect the different sounds I want to change? Or is there more to it? Can I assign everything the same Class? (Rifle_Base_F) or do I need to assign different classes depending on what kind of gun i want to change the sounds for?

Share this post


Link to post
Share on other sites

Yes, it would be copy paste. In any case check the original inheritance of the weapon since your config is going to break rhs_weap_m4_base since original config doesn't inherit from Rifle_Base_F! Always check original inheritance with i.e. All in one config or with in game config viewer

Share this post


Link to post
Share on other sites
7 hours ago, reyhard said:

Yes, it would be copy paste. In any case check the original inheritance of the weapon since your config is going to break rhs_weap_m4_base since original config doesn't inherit from Rifle_Base_F! Always check original inheritance with i.e. All in one config or with in game config viewer

To clarify, you mean I need to use the same ClassBase that is used in the weapon's config for RHS? If that's the case, easy enough.

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

×