TIOcoop spacer TIOcoop spacer TIOcoop
Game Menu New

NovaHQ Top 50



Community Forums › Mods › General Mod Chat › Adding New Sound Profile
Adding New Sound Profile

Post new topic    Reply to topic    Printer Friendly Page     Forum Index ›  General Mod Chat

View previous topic :: View next topic  
Author Message
~BLÃÐE~
Site Admin
Site Admin


Joined: Jun 15, 2008
Posts: 370
Location: Gold Coast - AU
PostPosted: Mon Oct 09, 2017 4:20 pm
Post subject: Adding New Sound Profile

I will do a tutorial on adding a new Sound Profile to the game.

The Motor Bike sound is a KX500 motocross bike, i want to change it so it sounds like a Harley Davidson.

Ok you will need some files from the game to start with. You can grab them from the localres.pff file in your local game directory.

ITEMS.def
sndprof.def
game.lwf

You will need the JO Mod Tools as well
The first tool we will need is the DeSRC to decrypt the .def files
Then the lwfbuilder to convert the lwf to text

We will open the ITEMS.def and find "Drivable Motorcycle" listing
Code::
begin "Drivable Motorcycle"
  id 100074
  sid dcycle2			// this is a unique identifier must be different always and then never change
  type vehicle
  graphic Dcycle2

  attrib: AIData noscar neutral PlayerControl exp1 forceasset DynamicShadow
  shadow  shadow1.tga   3.5  5.4  0.0  0.0
  hp 1500    //was 1000
  armor 10 10
  criticalhp 500	//was 300
  criticaldrain 15
  score 50
  radarsig 500
  ai_function cveh
  render_function cveh
  move_function cbike
    turn_rate 90     //was 50
	turn_rate2 12	 //was 10
    acceleration 25  //was 25
    deceleration 70  //was 50
    slip_speed 0     //was 20
    player_speed 90  //was 96//was 88 //was 105//was 120 //actual road speed is claimed to be 160kph for KLR 650
    slip_slope	50   //was 40
    max_slope	60   //was 50
    spring		1
    spring_comp 15	 //was 35
    shock		1
    mass		1	 //was  2
    minai		1
    physics     1
    lean		30
    lean_velocity 40 
   torque 	9
	particlefx   Effect_whiteExhaust FX00
	particlefxw2 fx_cycle_dust_01p FX01 fx_cdust_01p_SN
	particlefxs fx_cycle_dust_01 FX01 fx_cdust_01_SN
  husk Dcycle2X
  husk_sub_part_types 01_HULL 02_CHUNK_M 03_WHEEL 04_WHEEL 05_CHUNK_M 06_CHUNK_M 07_CHUNK_M 08_CHUNK_M 09_CHUNK_M 10_CHUNK_M 11_CHUNK_M 12_CHUNK_M
  default_aip d_buggy
  unit_type 12
  particledeath fx_cycle_gen_exp
  particleh2odeath Effect_H2OVeExp
  particlefinale fx_cycle_land
  particleother Effect_SmkNStemNP
  
  sound_profile SP_DirtBike
end

Copy and Paste it back into ITEMS.def
We will use this code and change it a bit to as below
Code::
begin "Drivable Harley Motorcycle"
  id 107000
  sid dcycle2			// this is a unique identifier must be different always and then never change
  type vehicle
  graphic Dcycle2

  attrib: AIData noscar neutral PlayerControl exp1 forceasset DynamicShadow
  shadow  shadow1.tga   3.5  5.4  0.0  0.0
  hp 1500    //was 1000
  armor 10 10
  criticalhp 500	//was 300
  criticaldrain 15
  score 50
  radarsig 500
  ai_function cveh
  render_function cveh
  move_function cbike
    turn_rate 90     //was 50
	turn_rate2 12	 //was 10
    acceleration 25  //was 25
    deceleration 70  //was 50
    slip_speed 0     //was 20
    player_speed 90  //was 96//was 88 //was 105//was 120 //actual road speed is claimed to be 160kph for KLR 650
    slip_slope	50   //was 40
    max_slope	60   //was 50
    spring		1
    spring_comp 15	 //was 35
    shock		1
    mass		1	 //was  2
    minai		1
    physics     1
    lean		30
    lean_velocity 40 
   torque 	9
	particlefx   Effect_whiteExhaust FX00
	particlefxw2 fx_cycle_dust_01p FX01 fx_cdust_01p_SN
	particlefxs fx_cycle_dust_01 FX01 fx_cdust_01_SN
  husk Dcycle2X
  husk_sub_part_types 01_HULL 02_CHUNK_M 03_WHEEL 04_WHEEL 05_CHUNK_M 06_CHUNK_M 07_CHUNK_M 08_CHUNK_M 09_CHUNK_M 10_CHUNK_M 11_CHUNK_M 12_CHUNK_M
  default_aip d_buggy
  unit_type 12
  particledeath fx_cycle_gen_exp
  particleh2odeath Effect_H2OVeExp
  particlefinale fx_cycle_land
  particleother Effect_SmkNStemNP
  
  sound_profile SP_Harley
end

So we changed the listing name to Drivable Harley Motorcycle
Changed the id number to 107000 so it is not a duplicate number being used.
Changed sound_profile to SP_Harley

Save, close.
Now we need to encrypt the ITEMS.def with the DeSRC tool again.
That is the ITEMS.def finished

We have added a new item Harley Motorcycle to the game but at this point it will still sound like a motocross bike.

Next we will open the sndprof.def file and look for SP_DirtBike
Copy and Paste it under the original

Code::
begin "SP_DirtBike"		Drivable JO Motorcycle
	enginestart			V_KX500_START
	soundloop_1			V_KX500_ILP			1 1.2		// idle
	soundloop_2			V_KX500_DLP			.9 1.1 0	// 	.8 1.2 	// drive .8 1.5 4
//	soundloop_3			V_KX500_REVSE		.8 1.3		// reverse
	enginereverse		V_KX500_SHIFT 	// gearshift oneshot
	enginehighrev		V_KX500_HIREV // Paul place airborne high-rev here
	enginestop			V_KX500_STOP
	sounddeath			EXPLO_KX500 
	sound_impact		IMP_HUSK_CYL_GRND		//Husk impact sound
	sound_impactwater	IMP_HUSK_CYL_WATER	//Husk impact sound
	// SSAudio1			V_KX500_HORN		// horn
	SSAudio2			TIRE_SKID		// Skid
	SSAudio3			IMP_V_CYCLE		// alive Collision
//	warning				V_CRITICAL_ALARM
	sound_impactorganic	IMP_V_KX500_ORG
	sound_rollover		IMP_V_CYCLE_ROLL
	sound_land			IMP_V_CYCLE_LAND
	tumble_skid			IMP_TMBL_DSKID
end 

We need to change some of the coding as below

Code::
begin "SP_Harley"		Drivable Harley Motorcycle
	enginestart			V_HX000_START
	soundloop_1			V_HX000_ILP			1 1.2		// idle
	soundloop_2			V_HX000_DLP			.9 1.1 0	// 	.8 1.2 	// drive .8 1.5 4
//	soundloop_3			V_HX000_REVSE		.8 1.3		// reverse
	enginereverse		V_HX000_SHIFT 	// gearshift oneshot
	enginehighrev		V_HX000_HIREV // Paul place airborne high-rev here
	enginestop			V_HX000_STOP
	sounddeath			EXPLO_KX500 
	sound_impact		IMP_HUSK_CYL_GRND		//Husk impact sound
	sound_impactwater	IMP_HUSK_CYL_WATER	//Husk impact sound
	// SSAudio1			V_KX500_HORN		// horn
	SSAudio2			TIRE_SKID		// Skid
	SSAudio3			IMP_V_CYCLE		// alive Collision
//	warning				V_CRITICAL_ALARM
	sound_impactorganic	IMP_V_KX500_ORG
	sound_rollover		IMP_V_CYCLE_ROLL
	sound_land			IMP_V_CYCLE_LAND
	tumble_skid			IMP_TMBL_DSKID
end

Change soundprofile to SP_Harley and rename title to Drivable Harley Motorcycle.

Because we want new sounds we have to add a new sound listing so lets change the V_KX500 to V_HX000
enginestart V_HX000_START
soundloop_1 V_HX000_ILP
soundloop_2 V_HX000_DLP
soundloop_3 V_HX000_REVSE
enginestop V_HX000_STOP

Save, close.
That is the sndprof file done.

Now we need to add the sounds to the game.lwf
Open and search for V_KX500_DLP and you will find 6 listings with KX500.
Copy them all and Paste them at the bottom of that list under V_TAXI STOP (about line 5901)

Code::
begin multi
  varname "V_KX500_DLP"
  playlist 898
  target 10000
end

begin multi
  varname "V_KX500_HIREV"
  playlist 899
  target 10000
end

begin multi
  varname "V_KX500_ILP"
  playlist 900
  target 10000
end

begin multi
  varname "V_KX500_SHIFT"
  playlist 901
  target 10000
end

begin multi
  varname "V_KX500_START"
  playlist 902
  target 10000
end

begin multi
  varname "V_KX500_STOP"
  playlist 903
  target 10000
end

Once that is done we have to edit the code to suit.
We will start with changing the playlist numbers, so the last one used was the Taxi with 1021.
So change the playlist number to continue on, 898 will become 1022 and so on.
We also need to change the varname from KX500 to say HX000 so it will look like below

Code::
begin multi
  varname "V_HX000_DLP"
  playlist 1022
  target 10000
end

begin multi
  varname "V_HX000_HIREV"
  playlist 1023
  target 10000
end

begin multi
  varname "V_HX000_ILP"
  playlist 1024
  target 10000
end

begin multi
  varname "V_HX000_SHIFT"
  playlist 1025
  target 10000
end

begin multi
  varname "V_HX000_START"
  playlist 1026
  target 10000
end

begin multi
  varname "V_HX000_STOP"
  playlist 1027
  target 10000
end 

Next part is adding the playlist for the sounds.
Again we will search but this time for the playlist numbers, listid 898.
Remember our original list was from 898 to 903, copy the list and paste it at the bottom of the page as below

Code::
begin playlist
  listid 898
  distance 300 
  value 15
  sndparm	"LP500D2"	65535 0 0 230 255 0 0
end

begin playlist
  listid 899
  distance 300 
  value 15
  sndparm	"125REV1"	58981 0 6553 175 255 0 0
  sndparm	"125REV2"	52428 0 6553 175 255 0 0
  sndparm	"125REV3"	52428 0 6553 175 255 0 0
end

begin playlist
  listid 900
  distance 300 
  value 15
  sndparm	"LP500I2"	65535 0 0 120 255 0 0
end

begin playlist
  listid 901
  distance 20 
  value 15
  sndparm	"HUMVSH1"	39317 3 0 110 255 0 0
end

begin playlist
  listid 902
  distance 300 
  value 15
  sndparm	"500STUP"	65535 0 9830 205 255 0 0
end

begin playlist
  listid 903
  distance 300 
  value 23
  sndparm	"500OFF4"	65535 0 0 100 255 0 0
  sndparm	"500OFF2"	65535 0 0 100 255 0 0
  sndparm	"500OFF3"	65535 0 0 100 255 0 0
end

Now change the sndparm names, i just changed 1 number or letter so it is unique

Also change the playlist number to suit 1022 as below, make sure they marry up correctly or it will give an error when converting back to lwf file.

Code::
begin playlist
  listid 1022
  distance 300 
  value 15
  sndparm	"LPH00D2"	65535 0 0 230 255 0 0
end

begin playlist
  listid 1023
  distance 300 
  value 15
  sndparm	"125REV4"	58981 0 6553 175 255 0 0
  sndparm	"125REV5"	52428 0 6553 175 255 0 0
  sndparm	"125REV6"	52428 0 6553 175 255 0 0
end

begin playlist
  listid 1024
  distance 300 
  value 15
  sndparm	"LPH00I2"	65535 0 0 120 255 0 0
end

begin playlist
  listid 1025
  distance 20 
  value 15
  sndparm	"HUMVSH1"	39317 3 0 110 255 0 0
end

begin playlist
  listid 1026
  distance 300 
  value 15
  sndparm	"H00STUP"	65535 0 9830 205 255 0 0
end

begin playlist
  listid 1027
  distance 300 
  value 23
  sndparm	"H00OFF4"	65535 0 0 100 255 0 0
  sndparm	"H00OFF2"	65535 0 0 100 255 0 0
  sndparm	"H00OFF3"	65535 0 0 100 255 0 0
end

Last step is adding the sounds
Go back to the top of the page where the sounds are listed, find the last listing which is
sound "TAXIOFF" 100 taxiOFF.wav (at about line 1286)

Now add the following to that list
Code::
sound "H00STUP"	205	HarStup.wav
sound "H00OFF4"	100	Harley4.wav
sound "H00OFF2"	100	Harley2.wav
sound "H00OFF3"	100	Harley3.wav
sound "LPH00D2"	230	lpH00d2.wav
sound "125REV4"	175	125rev4.wav
sound "125REV5"	175	125rev5.wav
sound "125REV6"	175	125rev6.wav
sound "LPH00I2"	120	lpH00i2.wav

Save the game.txt and close
You need to convert it back to a LWF file now, so open the lwfbuilder and convert TEXT to LWF
If you get an error you most likley didn't change or marry up the id numbers, playlist numbers

Ok so now we have the 3 files ready to re pack back into the game.
ITEMS.def
sndprof.def
game.lwf

We also need some wave file for sound effects, you have the names of the .wav file just need the .wav file now.

I found a site which has a good listing of sounds you can use
www.grsites.com/archiv...offset=144
It says they are free as long as not used for commercial purpose, so download a few .wav files to suit what you are doing.
For me i grabbed the Harley sounds.

I use a great little free program Wave Editor www.wave-editor.com/ to edit the sound files, it is quick and easy to use.
At this point it might be worth grabbing the original bike sounds from the game so you know how long and the type of sound used.

They are:
lp500d2.wav
125rev1.wav
125rev2.wav
125rev3.wav
lp500i2.wav
500stUp.wav
500off4.wav
500off2.wav
500off3.wav

You can find them in the localres.pff file of the game directory
They will need to be decompressed with the BFC1Extractor.exe from the JO Mod Tools to be herd

Now we have the 3 files plus the new sounds we need to pack it back into the game.
The best way to do this is to use a program call PackIt
Pack the files back into the game and away you go.

Open you mission editor add the new item "Drivable Harley Motorcycle" to a map and go have a listen to your new sounds.

If your into graphics you might be able to re-skin the KX500 to look like a Harley Davidson
Back to top
View user's profile Visit poster's website ICQ Number
~BLÃÐE~
Site Admin
Site Admin


Joined: Jun 15, 2008
Posts: 370
Location: Gold Coast - AU
PostPosted: Mon Oct 09, 2017 5:08 pm
Post subject: Re: Adding New Sound Profile

While doing sounds, someone asked me how to add a siren to the Fire Engine from the AW2 Mod.

Open the sndprof.def
This time we will use the SP_FuelTruck as our base.
Again create a new Sound Profile called SP_FireTruck

This time we will only change the
Code::
soundloop_2			V_HEMTT_DLP

to
Code::
soundloop_2			V_FIRETK

Code::
begin "SP_FireTruck"	Drivable Fire Truck
	enginestart			V_HEMTT_START
	soundloop_1			V_HEMTT_ILP		.8 1.2
	soundloop_2			V_FIRETK		.7 1.1
	soundloop_3			V_HEMTT_REVSE	.8 1.2
	enginereverse		V_HEMTT_SHIFT	// gearshift oneshot
	enginehighrev //		V_ATV_HORN // Paul place airborne high-rev here
	enginestop			V_HEMTT_STOP
	sounddeath			EXPLO_HEMTT
	sound_impact		IMP_HUSK_H_GRND		//Husk impact sound
	sound_impactwater	IMP_DEBLRG_WATER	//Husk impact sound
	//SSAudio1			V_TRUCK_HORN // horn
	SSAudio2			TIRE_SKID	// Skid
	SSAudio3			IMP_V_TRUCK		// alive Collision
	warning				V_CRITICAL_ALARM
	sound_impactorganic	IMP_V_ORGANIC
	sound_rollover		IMP_V_SUV_ROLL
	sound_land			IMP_V_SUV_LAND
	tumble_hithard      IMP_TMBL_LG	// new Tumble sounds
	tumble_hitmed       IMP_TMBL_MED
	tumble_hitsoft      IMP_TMBL_SM
	tumble_skid			IMP_TMBL_DSKID
end

You might notice the horn has been edited out to it doesn't work, just delete the 2 // from the front of SSAudio1 line, now the horn works (spacebar button)
Code::
SSAudio1			V_TRUCK_HORN // horn
Save and close

Open the game.lwf
At the bottom of the first section add a new sound
Code::
sound "firetk1"	120	firetk1.wav

Now add the varname
Code::
begin multi
  varname "V_FIRETK"
  playlist 1028
  target 10000
end

Next add the playlist
Code::
begin playlist
  listid 1028
  distance 300 
  value 15
  sndparm	"firetk1"	65535 0 9830 205 255 0 0
end

Open the ITEMS.def find the Fire Truck entry change the SP_FuelTruck to SP_FireTruck
Save and close
Encrypt the file
Pack the files and your new firetk1.wav sound

So what we did was delete the truck driving sound and replaced it with a siren. When the Fire Truck moves the siren will come on automatically
Back to top
View user's profile Visit poster's website ICQ Number
Display posts from previous:   
Post new topic    Reply to topic    Printer Friendly Page    Forum Index ›  General Mod Chat
Page 1 of 1
All times are GMT + 10 Hours



Jump to:  


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum




Delta Force Xtreme 2
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster
copyright@nova-outpost.com
Interactive software released under GNU GPL, Code Credits, Privacy Policy