Jump to content
Sign in to follow this  
AmishShogun

Custom Gun sound will not work.

Recommended Posts

Hello, Below is my Weapons.hpp

I am the lead coder for the Napoleonic Wars mod found here http://steamcommunity.com/sharedfiles/filedetails/?id=436943890&searchtext=

I for the love of god cannot get the custom file to play. Any help or suggestions/nudges in the right direction?

class CfgMagazines

{

class Default;

class CA_Magazine;

class HandGrenade;

class 20Rnd_762x51_Mag;

class ice_musket_mag: 20Rnd_762x51_Mag

{

scope = 2;

count = 1;

displayName = "0.7 Ball";

descriptionShort = "10 Round Mag";

picture = "\ice123_musket\icon\ball_ca.paa";

ammo = "ice_musket_ammo";

displaynameshort = "0.7 Ball";

tracersevery = 1;

mass = 0.1;

};

class ice_musket_mag2: 20Rnd_762x51_Mag

{

scope = 2;

count = 1;

displayName = "0.7 Ball";

descriptionShort = "10 Round Mag";

picture = "\ice123_musket\icon\ball_ca.paa";

ammo = "ice_musket_ammo2";

displaynameshort = "0.7 Ball";

mass = 0.1;

};

};

class CfgAmmo

{

class Default;

class BulletCore;

class BulletBase;

class Grenade;

class GrenadeHand;

class B_762x51_Ball;

class ice_musket_ammo : B_762x51_Ball

{

hit = 10;

indirectHit = 0;

indirectHitRange = 0.200000;

cartridge = "";

visibleFire = 0.400000;

audibleFire = 0.400000;

visibleFireTime = 50;

cost = 4;

typicalSpeed = 220;

soundHitBody1[] = {"\ice123_musket\sounds\hitbody.ogg",1,1};

soundHit[] = {"\ice123_musket\sounds\hit_ground.ogg", 1, 1};

//reloadAction = "GestureReloadMusket";

model = "\ice123_musket\ball";

};

class ice_musket_ammo2 : GrenadeHand

{

hit = 12;

indirectHit = 0;

indirectHitRange = 0.200000;

model = "\ice123_musket\ball";

cartridge = "";

visibleFire = 0.400000;

audibleFire = 0.400000;

visibleFireTime = 50;

explosive = 0;

deflecting = 0;

cost = 4;

whistleDist = 0;

typicalSpeed = 220;

soundHitBody1[] = {"\ice123_musket\sounds\hitbody.ogg",1,1};

soundHit[] = {"\ice123_musket\sounds\hit_ground.ogg", 1, 1};

explosionEffects = "NoExplosion";

CraterEffects = "NoCrater";

};

};

class CfgCloudlets

{

class Default;

class MusketCloud1: Default

{

interval = 0.01;

circleRadius = 0;

circleVelocity[] = {0,0,0};

particleShape = "\A3\data_f\ParticleEffects\Universal\Universal";

particleFSNtieth = 16;

particleFSIndex = 12;

particleFSFrameCount = 8;

particleFSLoop = 1;

angleVar = 0.5;

animationName = "";

particleType = "Billboard";

timerPeriod = 1;

//lifeTime = 0.8;

lifeTime = 7;

moveVelocity[] = {"2*directionX","2*directionY","2*directionZ"};

rotationVelocity = 1;

//weight = 0.05;

weight = 0.05;

//volume = 0.04;

volume = 0.04;

//rubbing = 1.05;

rubbing = 0.1;

size[] = {0.3,0.7,1,1.2,1.4,1.6,1.8};

color[] = {{0.9,0.9,0.9,0.08},{0.9,0.9,0.9,0.036},{0.9,0.9,0.9,0.012},{0.9,0.9,0.9,0.001}};

animationSpeed[] = {1.2};

randomDirectionPeriod = 0.1;

randomDirectionIntensity = 0.05;

onTimerScript = "";

beforeDestroyScript = "";

destroyOnWaterSurface = 1;

//sizeCoef = 1.2;

sizeCoef = 7;

colorCoef[] = {1,1,1,1};

//animationSpeedCoef = 1;

animationSpeedCoef = 0.2;

position[] = {"positionX + 0.12 * directionLocalX","positionY + 0.12 * directionLocalY","positionZ + 0.12 * directionLocalZ"};

lifeTimeVar = 0;

positionVar[] = {0,0,0};

MoveVelocityVar[] = {1,1,1};

rotationVelocityVar = 20;

sizeVar = 0;

colorVar[] = {0,0,0,0};

randomDirectionPeriodVar = 0;

randomDirectionIntensityVar = 0;

};

};

class MusketCloud

{

class MusketCloud1

{

simulation = "particles";

type = "MusketCloud1";

position[] = {0,0,0};

intensity = 1;

interval = 1;

lifeTime = 0.05;

};

};

class GunParticles;

class Mode_SemiAuto;

class Mode_Burst;

class Mode_FullAuto;

class FullAuto;

class cfgWeapons {

class Default;

class PistolCore;

class Pistol;

class Rifle;

class RifleCore;

class MGun;

class MGunCore;

class ItemCore; // External class reference

class InventoryItem_Base_F; // External class reference

class HeadgearItem;

class Uniform_Base;

class UniformItem;

class Vest_Base;

class VestItem;

class B_Soldier_base_F;

class U_B_CombatUniform_mcam;

class arifle_MX_F;

class ice123_england_cloth : Uniform_Base {

scope = 2;

displayName = "Red Cloth";

picture = "\ice123_musket\icon\england_co.paa";

model = "\ice123_musket\infantry_red.p3d";

//hiddenSelections[] = {"Camo"};

//hiddenSelectionsTextures[] = {"\ice123_swat\swat_co.paa"};

class ItemInfo : UniformItem {

uniformModel = "-";

uniformClass = "ice123_musket_dude1";

containerClass = "Supply20";

mass = 80;

};

};

class ice123_france_cloth : Uniform_Base {

scope = 2;

displayName = "Blue Cloth";

picture = "\ice123_musket\icon\france_co.paa";

model = "\ice123_musket\infantry_blue.p3d";

class ItemInfo : UniformItem {

uniformModel = "-";

uniformClass = "ice123_musket_dude2";

containerClass = "Supply20";

mass = 80;

};

};

class ice123_musket: Rifle

{

scope = 2;

scopeWeapon = 2;

scopeMagazine = 2;

dispersion = 0.015;

muzzles[] = {"this"};

model = "\ice123_musket\musket.p3d";

picture = "\ice123_musket\icon\musket_ca.paa";

uipicture = "\A3\weapons_f\data\UI\icon_regular_CA.paa";

optics = 1;

modelOptics = "-";

sound[] = {"\ice123_musket\sounds\musket", 4,4};

opticsZoomMin = 0.320000;

opticsZoomMax = 0.500000;

distanceZoomMin = 50;

distanceZoomMax = 50;

displayName = "Musket";

selectionFireAnim = "zasleh";

displayNameMagazine = "Ball";

shortNameMagazine = "ball";

drySound[] = {};

magazines[] = {"ice_musket_mag","ice_musket_mag2"};

minRange = 2;

reloadMagazineSound[] = {"A3\sounds_f\weapons\reloads\new_MX.wav",0.1,1,30};

minRangeProbab = 0.100000;

midRange = 100;

midRangeProbab = 0.800000;

maxRange = 350;

maxRangeProbab = 0.040000;

//reloadtime = 10;

recoil = "recoil_auto_mk200";

recoilprone = "recoil_auto_prone_mk200";

magazineReloadTime = 15;

reloadAction = "GestureReloadMusket";

// class GunParticles

// {

// class FirstEffect

// {

// effectName = "MusketCloud";

// positionName = "Usti hlavne";

// directionName = "Konec hlavne";

// };

// class SecondEffect

// {

// positionName = "Nabojnicestart";

// directionName = "Nabojniceend";

// effectName = "CaselessAmmoCloud";

// };

// };

class GunParticles: GunParticles

{

class effect1

{

positionName = "usti hlavne";

directionName = "konec hlavne";

effectName = "MusketCloud";

};

class SecondEffect

{

positionName = "Nabojnicestart";

directionName = "Nabojniceend";

effectName = "CaselessAmmoCloud";

};

};

class Library

{

libTextDesc = "A brown bess musket.";

};

};

};

Share this post


Link to post
Share on other sites

Which sounds are you having trouble with? You have multiple sounds listed in your config :)

Share this post


Link to post
Share on other sites

You need to define the firing sounds within a "fire mode". Inheriting from rifle is probably what is messing you up, here. Try this (untested):

	class ice123_musket: Rifle
{
	scope = 2;
	scopeWeapon = 2;
	scopeMagazine = 2;
	dispersion = 0.015;
	muzzles[] = {"this"};
	model = "\ice123_musket\musket.p3d";
	picture = "\ice123_musket\icon\musket_ca.paa";
	uipicture = "\A3\weapons_f\data\UI\icon_regular_CA.paa";
	optics = 1;
	modelOptics = "-";
	sound[] = {"\ice123_musket\sounds\musket", 4,4};
	opticsZoomMin = 0.320000;
	opticsZoomMax = 0.500000;
	distanceZoomMin = 50;
	distanceZoomMax = 50;
	displayName = "Musket";
	selectionFireAnim = "zasleh";
	displayNameMagazine = "Ball";
	shortNameMagazine = "ball";
	drySound[] = {};

	magazines[] = {"ice_musket_mag","ice_musket_mag2"};
	reloadMagazineSound[] = {"A3\sounds_f\weapons\reloads\new_MX",0.1,1,30 };
	magazineReloadTime = 15;

	modes[] = {"Single"};
	class Single: Mode_SemiAuto
	{
		dispersion = 0.00018; // set to whatever you want
		soundContinuous = 0;
		reloadTime = 10;
		recoil = "recoil_auto_mk200";
		recoilprone = "recoil_auto_prone_mk200";

		sounds[] = {"StandardSound","SilencedSound"};
		class BaseSoundModeType
		{
			weaponSoundEffect = "DefaultRifle";
			closure1[] = {"A3\sounds_f\weapons\closure\closure_rifle_2",1.7782794,1,10};
			closure2[] = {"A3\sounds_f\weapons\closure\closure_rifle_3",1.7782794,1,10};
			soundClosure[] = {"closure1",0.5,"closure2",0.5};
		};
		class StandardSound: BaseSoundModeType
		{
			begin1[] = {"\ice123_musket\sounds\musket", 4,4};
			soundBegin[] = {"begin1", 1};
		};
		class SilencedSound: BaseSoundModeType
		{
			begin1[] = {"\ice123_musket\sounds\musket", 4,4};
			soundBegin[] = {"begin1",1};
		};

		minRange = 2;
		minRangeProbab = 0.100000;
		midRange = 100;
		midRangeProbab = 0.800000;
		maxRange = 350;
		maxRangeProbab = 0.040000;
		aiRateOfFire = 3;
		aiRateOfFireDistance = 500;
	};

	reloadAction = "GestureReloadMusket";

	class GunParticles: GunParticles
	{	
		class effect1
		{
			positionName = "usti hlavne";
			directionName = "konec hlavne";
			effectName = "MusketCloud";
		};
		class SecondEffect
		{
			positionName = "Nabojnicestart";
			directionName = "Nabojniceend";
			effectName = "CaselessAmmoCloud";
		};
	};

	class Library 
	{
		libTextDesc = "A brown bess musket.";
	};
};

Share this post


Link to post
Share on other sites

In addition, you have to have a "StandardSound" class now with the sound definitions in it, the old way of doing it (Arma 2 and earlier) no longer works.

Share this post


Link to post
Share on other sites

Another thing that may help you as well is that you can browse through the in-game config within the editor. (Tutorial here:

)

If you know or already know how to access the config editor, head through to CfgWeapons and find a classname that is a weapon, then look at it's config there and see what you can find that is missing from your config. :)

Hope it helps!

Rawner135

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  

×