Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

**Tutorial** Making multi HpFire weapons that aren''t silent

Here you find the different tutorials on editing and MODing Freelancer

Post Sat Nov 27, 2004 7:29 pm

**Tutorial** Making multi HpFire weapons that aren''t silent

Hi everyone

A quick introduction to what a multi HpFire weapon is; Each gun has a firing point, in the model, it is defined by a hardpoint. The hardpoint is called HpFire## (HpFire01) and can be placed anywhere on the gun. When you add another HpFire## hardpoint (HpFire02) the gun will fire from 2 places, adding a third will make 3 firing points, and so on.

Now, this has been something that's been possible for many moons, but the problem has always been that, when you make another hardpoint, you lose the sound that the gun makes. It is apparently a problem that Microsoft couldn't fix, if you look in the weapon models folder, there are many models that are unused, most have multiple HpFires. The sound has been the reason people haven't used multifire guns. But I've discovered a way around it and will share it with you all.

First of all, you will need a weapon model with more than one HpFire. You can make your own (you can download Harrier's tutorial on creating weapon models here) or use one of the unused models already in the game. Here is a list of weapons that have multiple HpFire hardpoints.

br_auto_shotgun.cmp
ku_auto_blaster.cmp
br_turret01.cmp
br_turret02.cmp
br_turret04.cmp
br_turret04b.cmp
ku_turret03.cmp
li_turret04.cmp
li_turret05.cmp
liner_turret01.cmp
prison_turret01.cmp
rh_turret01.cmp
rh_turret02.cmp
rh_turret03.cmp
utility_turret02.cmp
utility_turret03.cmp
weapons_platform_turret.cmp

Ok, now you'll need to make a new weapon (or edit an old one, but that's kind of pointless considering how easy it is to make a new one). If you need help doing that, you can use my tutorial here.

After you have created your weapon. You will need to look at the line DA_archetype and change it to the model of your choice and then assign the correct .mat file to the material_library line.

br_auto_shotgun.cmp - use br_equip.mat
ku_auto_blaster.cmp - use ku_equip.mat
br_turret01.cmp - use br_turret.mat
br_turret02.cmp - use br_turret.mat
br_turret04.cmp - use br_turret.mat
br_turret04b.cmp - use br_turret.mat
ku_turret03.cmp - use ku_turret.mat
li_turret04.cmp - use li_turret.mat
li_turret05.cmp - use li_turret.mat
liner_turret01.cmp - use ge_turret.mat
prison_turret01.cmp - use ge_turret.mat
rh_turret01.cmp - use rh_turret.mat
rh_turret02.cmp - use rh_turret.mat
rh_turret03.cmp - use rh_turret.mat
utility_turret02.cmp - use ge_turret.mat
utility_turret03.cmp - use ge_turret.mat
weapons_platform_turret.cmp - use ge_turret.mat

I'm not 100% certain on a couple of those but am fairly confident they are correct. If you run into any problems let me know.

Now that we have your weapon finished and using a multi HpFire weapon, we need to get this baby to make some sound. Don't worry about trying to edit weapon_equip to accomplish this. Instead, go look at your custom effect (if you have made one), if you havent made one, follow the instructions in my weapons tutorial to make one. After you have the effect made, go into effects.ini and search for your effect. Add the line snd_effect = yoursoundeffect, for example

snd_effect = Fire_Tachyon2

and then save the file. Your gun will use whichever sound you put in effects.ini. You can experiment to find which sound suits your gun best.

Have fun and if you find problems let me know.

Post Sun Feb 13, 2005 8:42 pm

My codding isnt working...

<data file="DATA\Audio\sounds.ini" method="append">
<source>

[Sound
nickname = fire_tachyon6
file = audio\sounds\weapons\fire_tachyon6.wav
range = 60, 500
crv_pitch = 9
attenuation = -7

</source>
</data>

<data file="DATA\FX\effects.ini" method="append">
<source>

[Effect
nickname = Blaster_gun01
effect_type = EFT_WEAPON_PROJ
vis_beam = Blaster_gun01
snd_effect = fire_tachyon6

</source>
</data>

Post Tue Feb 15, 2005 5:25 pm

Loso, what is the problem with it? Is it invisible or inaudible? Fill me in and I'll try to help solve the bug

Post Tue Feb 15, 2005 7:27 pm

I get no sound out of the mod.

I added this techyon one, it works on my single fire weapons.

Post Fri Jan 06, 2006 7:34 am

**Very Big BUMP**

I've just started learning how to do weapons, and I got this to work easy enough but does anybody know how to get rid of the echo that happens about 0.5 seconds after you stop firing.

**shuffles of with a new headache**

Post Fri Jan 06, 2006 9:33 pm

do you mean the sound replays? it could be your computer...what kind of system are you running

Post Sat Jan 07, 2006 8:49 am

It happens just as the bullets disappear from view, you get a repeat of the fireing effect.

As for my system don't laugh as its very basic. A 3.5 year old Samsung notebook running XP with SP2, 2GHz P4, 256Mb RAM, 64Mb integrated Intel 82845GL, there isn't really a sound card as it's part of the motherboad and I haven't found any new drivers for it in nearly 3 years of looking.

**shuffles of with a new headache**

Post Sat Jan 14, 2006 7:52 pm

Sounds like my old system...Except I had a 2.4GHz P4 and 512 RAM instead. That probably is the reason for the sound echo. After you subtract the 64 from the 256 you are left with just 192 MB of memory and a weak integrated sound chip. I know the feeling If anyone knows otherwise, correct me...but I believe that when you attach a sound effect to a visual effect (thats what this tutorial does), the sound follows the effect. So if the "bullet" was say 600k away from you, you wouldn't hear it. That's why I think it's a case of an audio hang. Only way I can think of solving it is to adjust your audio properties. Maybe adjust the hardware acceleration?

Post Thu Jan 19, 2006 9:39 pm

The issue isn't with your system or your sound card. The "repeat" lies with the sound itself. Since the sound is now attached to the effect itself, then the sound will play for the entire lifetime of the effect. If the sound is shorter than the effect's total lifetime then the sound will loop.

To solve this issue, either extend the sound to be longer than the effect, or shorten the lifetime of the effect til it's shorter than the length of the sound effect.

Problem Solve.

Post Tue Jan 24, 2006 11:42 pm

How do u shorten/lengthen the length of the effect?

Post Thu Jan 26, 2006 6:50 pm

In the [munition} entry of a weapon you will see the following line:

lifetime = *whatever*

That defines the length of time that the effect will exist before disappearing. All you would have to do is set that number to the length (in seconds) of the firing sound. Then, to achieve the range you desire out of the weapon, you simply need to compensate by upping the muzzle velocity when it fires.

Range = Muzzle_Velocity(meters per second) x Lifetime(in seconds)

OR

You could also attach the sound to the weapon's flash effect that you see when it fires, and that would solve your problem as well. Personally, I've adopted the muzzle flash sound only because there is no possibility of looping and the sound won't be cut off by a close-range impact of the weapon. Perfect fix for this situation.

Post Sun Oct 08, 2006 8:23 am

parabolix i run into same problem as Loso ... the damn dual-ion-cannon keeps silent:

[Sound
nickname = fire_photon2
file = AUDIO\SOUNDS\sw_WEAPONS\fire_ion_armek.wav
range = 60, 500
crv_pitch = 9
attenuation = -7
_________________________________________________________
[Effect
nickname = sw_effect_armeklightion_proj
effect_type = EFT_WEAPON_PROJ
vis_beam = sw_effect_armeklightion
snd_effect = fire_photon2
_________________________________________________________
[Munition
nickname = sw_turret_armeksw7adual_01_ammo
hp_type = hp_gun
requires_ammo = false
hit_pts = 2
hull_damage = 0
energy_damage = 300
weapon_type = W_Laser01
one_shot_sound = fire_photon2
munition_hit_effect = rh_plasma_03_impact
const_effect = sw_effect_armeklightion_proj
lifetime = 1.4
force_gun_ori = true
mass = 1
volume = 0.000100

[Gun
nickname = sw_turret_armeksw7adual_01
DA_archetype = equipment\models\sw_weapons\small_dualturret_01.cmp
;material_library = equipment\models\li_equip.mat
HP_child = HPConnect
hit_pts = 1500
explosion_resistance = 1.000000
debris_type = debris_normal
parent_impulse = 20
child_impulse = 80
volume = 0.000000
mass = 10
hp_gun_type = hp_turret_special_2
damage_per_fire = 0
power_usage = 320
refire_delay = 0.230000
muzzle_velocity = 500
use_animation = Sc_fire
toughness = 12.700000
light_anim = l_gun01_flash
projectile_archetype = sw_turret_armeksw7adual_01_ammo
separation_explosion = sever_debris
auto_turret = false
turn_rate = 60
lootable = true
LODranges = 0, 2000
ids_name = 0 ;GENERATESTRRES("Armek SW7a Dual Turret"
ids_info = 0 ;GENERATEXMLRES("<xml><RDL><PUSH/><TEXT>TODO: infocard for Armek SW7a Dual Turret</TEXT><PARA/><POP/></RDL></xml>"






Edited by - Holzbein on 10/8/2006 9:30:01 AM

Dev

Post Mon Oct 09, 2006 3:28 pm

Perhaps this will clear some things up:

When you attach a sound effect to the projectile, you are quite literally doing exactly that. The sound effect will travel with the projectile as it moves, meaning that (depending on the range of the sound effect used) it may attenuate quickly and even get cut off; even if no attenuation occurs, the sound effect will still be shifted in pitch as a result of the doppler effect (which the game simulates). Going off on a bit of a tangent, to alter the amount that sound effects have their pitch shifted due to relative velocity, change the "ear_doppler_factor" in data/audio/soundcfg.ini. Anyway, the important point is that you should expect the sound effect to be attached to the projectile, not the weapon. To test that your sound effect is indeed working, set the projectile velocity to near-zero and see if you can hear it.

Whether or not the sound effect and visual effect loop is dependent on the type of effect. Weapon effects, such as EFT_WEAPON_PROJ, will generally loop until the source of the effect goes away (in this case, when the projectile runs out of life or hits something). To investigate which effect types loop and which do not, check out effect_types.ini (-1 for run_time means infinite). As a side note, if you remove these EffectType entries entirely, the effect types will default to infinite or finite run times, depending on what they are (for example, if you use the hack to allow you to see vis_beam effects at longer range).

All things told, attaching the sound effect to the muzzle flash is likely the best solution, as AT suggested. It may be wise to remove the visible flash effect, as it will only appear at the first HpFire hardpoint; however, the sound effect will still play, and it will not be subject to unexpected attenuation and pitch shift.

Post Tue Oct 10, 2006 9:08 am

thx alot for the info, i have managed to get the sound audiable on the beameffect, but u r right it stops when the projectile stops, so i have tryed to add the sound to the muszzleflash ... damn its silent again:

[Effect
nickname = sw_effect_armeklightion_flash
effect_type = EFT_MUZZLE_FLASH
vis_effect = ci_photon_01_flash
snd_effect = fire_photon2
________________________________________
and i added this line to my turret ([Gun) what was left out for some reason^^:

flash_particle_name = sw_effect_armeklightion_flash

is there somthing wrong, flash is visble but silent?

Edited by - Holzbein on 10/10/2006 10:11:59 AM

Dev

Post Tue Oct 10, 2006 9:18 am

Hmm... if I recall correctly, you should remove the one_shot_sound from the munition entry. If that also doesn't work, use the sound somewhere else just to make sure that the sound itself is not the problem.

Return to Freelancer Editing Tutorial Forum