Jump to content
Sign in to follow this  
Intruder

Config.cpp and car horn sounds

Recommended Posts

I've retextured a sports car and I just wanted to know what I have to put in the config.cpp file to change the original 'sportscarhorn' sound to a custom sound file located in a 'sounds folder' within the new addon car folder.

any ideas?

Share this post


Link to post
Share on other sites

You have to make a new horn weapon and change the sound to your custom sound.

Share this post


Link to post
Share on other sites

This is all new to me, would the weapons class in the cpp file look like this:

class CfgWeapons

{

class CarHorn: Default

{

scopeWeapon=1;

ammo="";

displayName="";

reloadTime=0.000000;

drySound[]={"Vehicles\carhorn",0.100000,1};

canLock=0;

optics=0;

enableAttack=0;

magazines[]={};

};

};

This was in one of the tutorials over at OFPEC site.

Share this post


Link to post
Share on other sites

No, that's the default. In your .cpp it would look something like this:

class CfgWeapons

{

class Default {};

class CarHorn: Default {};

class CHorn: CarHorn {

drySound[]={"addondirectory\hornsound",0.100000,1};

soundContinuous=1

};

};

Share this post


Link to post
Share on other sites

Could you take a look at the cpp file for me? The addon folder is 'INT_metpol_car', and the sound files are in the 'carsnd' folder

// some basic defines

#define TEast 0

#define TWest 1

#define TGuerrila 2

#define TCivilian 3

#define TSideUnknown 4

#define TEnemy 5

#define TFriendly 6

#define TLogic 7

#define true 1

#define false 0

// type scope

#define private 0

#define protected 1

#define public 2

class CfgPatches

{

class INTmetpolcar {

units[] = {INTmetpolcar};

weapons[] = {};

requiredVersion = 1.07;

};

};

class CfgVehicles

{

class All {};

class AllVehicles: All {};

class Air: AllVehicles {};

class Plane: Air {};

class A10: Plane {};

class Cessna: A10 {};

class Land: AllVehicles {};

class LandVehicle : Land {};

class Car: LandVehicle {};

class SkodaHelper: Car {};

class SkodaBase: SkodaHelper {};

class Rapid: SkodaBase {};

class INTmetpolcar: Rapid {

model="\INT_metpol_car\INTmetpolcar";

displayName="INT UK Police Car";

crew=Civilian3;

soundEngine[]={"\INT_metpol_car\carsnd\engine1.ogg",db10,2.4};

maxSpeed=600;

};

class CfgWeapons

{

class Default {};

class CarHorn: Default {};

class CHorn: CarHorn {

drySound[]={"INT_metpol_car\carsnd\siren1.ogg",0.100000,1};

soundContinuous=1

};

};

};

Share this post


Link to post
Share on other sites

It "almost" works:

// some basic defines

#define TEast 0

#define TWest 1

#define TGuerrila 2

#define TCivilian 3

#define TSideUnknown 4

#define TEnemy 5

#define TFriendly 6

#define TLogic 7

#define true 1

#define false 0

// type scope

#define private 0

#define protected 1

#define public 2

class CfgPatches

{

class INTmetpolcar {

units[] = {INTmetpolcar};

weapons[] = {};

requiredVersion = 1.07;

};

class CHorn {

units[] = {};

weapons = {CHorn};

requiredVersion = 1.07;

};

};

class CfgVehicles

{

class All {};

class AllVehicles: All {};

class Land: AllVehicles {};

class LandVehicle : Land {};

class Car: LandVehicle {};

class SkodaHelper: Car {};

class SkodaBase: SkodaHelper {};

class Rapid: SkodaBase {};

class INTmetpolcar: Rapid {

model="\INT_metpol_car\INTmetpolcar";

displayName="INT UK Police Car";

crew=Civilian3;

soundEngine[]={"\INT_metpol_car\carsnd\engine1.ogg",db10,2.4};

maxSpeed=600;

weapons[] = {"CHorn"};

};

class CfgWeapons

{

class Default {};

class CarHorn: Default {};

class CHorn: CarHorn {

displayNameMagazine=CHorn;

shortNameMagazine=CHorn;

scopeWeapon=public;

scopeMagazine=public;

drySound[]={"INT_metpol_car\carsnd\siren1.ogg",0.100000,1};

soundContinuous=1

};

};

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  

×