PDA

View Full Version : How do you add sounds to weapons (I forgot how to do it)



die harder
12th May 12, 6:23 PM
Hello, I haven't been modding hw2 in a little bit and I need to know how do I get my sound effects added to a weapon I made. I have the .fda ready to go and I have made a folder in the sound/sfx/etg with my weapons name i just don't really know what to do from here.

Pouk
12th May 12, 6:48 PM
With the events file.

die harder
12th May 12, 7:08 PM
oh, right thanks.

----------

Oh no wait that didn't work I add a line like this:

event2 = {{"anim", "Fire"}, {"animtime", "0"}, {"marker", "Weapon_L_Muzzle"}, {"fx", "muzzle_flash_combo"}, {"sound", "weapon/usc_70mmrotary/usc_70mmrotary"}, {"fx_nlips", "on"},},

and I don't hear any sounds when the weapon fires.

Pouk
12th May 12, 8:50 PM
Did you also put the "Fire" into the animations part of the events file? Does your ship file weapon line look something like this: StartShipWeaponConfig(NewShipType, "weapon_name", "hardpoint_name", "Fire") ?

die harder
20th May 12, 9:02 PM
Tired that and still didn't work, and my sound file diffidently converted correctly.

Shakuhachi
20th May 12, 11:21 PM
Go to "Scripts/Weaponfire" and find the weapon folder and look at the wf file it should look something like this:

hitfx = "shield_hit_beam_combo"
bulletfx = "century_antiproton_beam"
nopenetratefx = "ion_dmg_ring_spray"
blowthroughfx = "blowthrough_generic"
deathtype = "deathBeam"
scartype = "Beam"
firefx = "century_muzzle"
fire_sfx = "WEAPON/ARRAY/SHIP/FIRE/CENTURY_ANTIPROTON"
hit_sfx = "WEAPON/FRIGATE/IMPACT/WEAPON_FRIGATE_TORPEDO_HIT"
nopentrate_sfx = "WEAPON/FRIGATE/IMPACT/WEAPON_FRIGATE_TORPEDO_HIT"
hit_clamp =
{ 0.5, 1.25, }

You want to edit where it says (fire_sfx = "WEAPON/ARRAY/SHIP/FIRE/CENTURY_ANTIPROTON)
Change the filepath to wherever you need it to go and you should be set! Hopefully you won't have anymore problems and this should help you! Good Luck! ;)

die harder
21st May 12, 12:25 AM
Still didnt work just going to post what i have and see if anyone can find a problem.

Events file:
animation2 =
{
name = "Weapon_L",
length = 2,
loop = 0,
parent = "",
minimum = 0,
maximum = 0,
markers =
{
"",
},
},

event2 =
{
{
"anim",
"Weapon_L",
},
{
"animtime",
"0",
},
{
"marker",
"Weapon_L_Muzzle",
},
{
"fx",
"muzzle_flash_combo_plasma",
},
{
"sound",
"weapon/usc_70mmrotary/USC_70MMROTARY",
},
{
"fx_nlips",
"on",
},
},
.ship file:

StartShipWeaponConfig(NewShipType, "usc_70mmrotary", "Weapon_L", "Weapon_L")

weapon fire:

hitfx = "dmg_cloud_combo_small"
bulletfx = "kinetic_large_bullet_combo"
nopenetratefx = "nopen_generic"
deathtype = "deathCannon"
scartype = "Kinetic_Small/Kinetic_Small"
hit_sfx = "WEAPON/FRIGATE/IMPACT/WEAPON_FRIGATE_FLECHETTE_CANNON_HIT"
firefx = "muzzle_flash_combo_small_capital"
fire_sfx = "sound/sfx/weapon/usc_70mmrotary/usc_70mmrotary"


hit_clamp =
{
1,
1,
}

That's all I have.
Not sure if the fire_sfx needs the /sound tried it and still no sound played.

Shakuhachi
21st May 12, 8:56 AM
Does the hit_sfx work at least? But try taking "sound" out of "sound/sfx/weapon/etc..." Maybe its looking for the sound folder within the sound folder, if you understand what I mean. If that doesn't work maybe upload the sound effect file and I can give it some hands on time.

Stargazer
21st May 12, 2:52 PM
And your sound file is really placed in Data:sound/sfx/etg/weapon/usc_70mmrotary/ ?

die harder
22nd May 12, 2:34 AM
My sound file is no longer placed in the etg folder I reorganised the sound folder for my mod so that it goes Data:/sound/sfx/weapon not sure if this matters or not.

Also my sound if is working I tested it my replacing some music with the file diffidently working and the hit_sfx is also working.

Now also tried a few other sounds and they don't work either.

Stargazer
22nd May 12, 11:28 AM
Could you try if the sound plays when you put it in the "etg" folder? Because I think the root directory for all these sound file references is "data:sound/sfx/etg/".

Another thing you could try is a direct link; in your case: "data:sound/sfx/weapon/usc_70mmrotary/usc_70mmrotary". HW2 should recognize that you point to a file from the data folder.

die harder
23rd May 12, 12:40 AM
Alright did that Stargazer still no sound playing....

And hw2.log doesn't show anything.

BloodFleet
25th May 12, 4:33 PM
well...an example of what I do.

put sound in sound\sfx\etg\weapon
(and of course configure its .lua file accordingly)

then go to weaponfire (.wf) file and have
fire_sfx = "WEAPON/NewWeaponFileNameHere"

really all you should have to do...unless its a missile, in that case you gotta do each firepoints effects in the ships .events file, for that I'd look at existing ones like the vaygr destroyer.