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

A gun that fires from a torp hardpoint?

The general place to discuss MOD''ing Freelancer!

Post Fri Aug 31, 2007 8:48 pm

A gun that fires from a torp hardpoint?

I'm trying to make a big "dumb fire" cannon that does a lot of damage, but uses a lot of energy per shot and has a very low refire rate. I'd like to have it only mountable on a torpedo hardpoint and to only fire when the key assigned to fire torpedoes is pressed, so it isn't always firing along with the regular guns.

I've got the weapon set up and mountable on the torp hardpoint, but instead of firing when the torp key is pressed, it still fires with the right mouse button along with the normal guns. Everything else works the way I'd like it to, so is there some magic setting I've missed somewhere that determines whether something fires using the right click, torpedo, CD, or missile keys?

Ogu

Post Sat Sep 01, 2007 7:22 am

It depends on what type of weapon you've coded it as. If you coded it as a [MineDropper then the mine dropper key would fire it. If you coded it as a missile, then the missile key would fire it, and so on.

I usually code it as a torpedo. If you want it to act as a gun and not home in on ships or accelerate, you'll need to make change the [Motor so it doesn't provide any extra thrust:

[Motor
nickname = torpedo01_mark01_motor
lifetime = 0
accel = 0
delay = 0

The explosion bit might be a bit tricky, but you should be able to change the effect to a regular gun hit effect (such as li_laser_01_impact). Of course, you can add your damage here if you want. Be sure to set the radius to 0 so you don't damage nearby ships. You should be able to set the damages here to 0 and use them under the [Munition as well, I don't have any code handy so I'm not 100% sure on that.

[Explosion
nickname = torpedo01_mark01_explosion
effect = li_laser_01_impact
lifetime = 0.000000, 0.000000
process = disappear
strength = 0
radius = 0
hull_damage = 0
energy_damage = 0
impulse = 0

Make it so it doesn't require ammo, since it should be a gun. I've given it some damage here, so it'll do that on impact. Change the sound to that of a gun and set the detonation distance as 1. Change the const_effect to that of a gun, change seeker to DUMB so it doesn't home in and time to lock to 0. I'm not sure about seeker range, since it shouldn't be needed it can probably be 0 - though leaving it at 700 or 100 or whatever shouldn't hurt. Seeker fov can be 0 (since it doesn't need to lock) and angular velocity can be 0 so it can't turn. The archetype and mat are probably fine - the const_effect should cover them up for the most part. Notice how I didn't say anything about lifetime - that'll be below.

[Munition
nickname = torpedo01_mark01_ammo
explosion_arch = torpedo01_mark01_explosion
loot_appearance = ammo_crate
units_per_container = 1
hp_type = hp_torpedo
requires_ammo = false
hull_damage = 1000
energy_damage = 0
hit_pts = 2
one_shot_sound = fire_laser1
detonation_dist = 1
lifetime = 3
Motor = torpedo01_mark01_motor
force_gun_ori = false
const_effect = li_laser_01_proj
HP_trail_parent = HPExhaust
seeker = DUMB
time_to_lock = 0
seeker_range = 1500
seeker_fov_deg = 0
max_angular_velocity = 0
DA_archetype = equipment\models\torpedoes\ge_torpedo.3db
material_library = equipment\models\ge_equip.mat
ids_name = 265163
ids_info = 266163
mass = 1
volume = 0.000000

You can change the archetype and mat to those of a gun. The refire, power usage and velocity can be edited to whatever you want, just like a gun. I'm giving this one a power usage of 50 and a speed of 700m/s. Lets go back up to the lifetime (above) and make it 1 - this will make the range of your gun 700m. If you wanted it to be 1400m, change it to 2, etc.

[Gun
nickname = torpedo01_mark01
ids_name = 263163
ids_info = 264163
DA_archetype = equipment\models\weapons\li_laser_beam.cmp
material_library = equipment\models\li_equip.mat
HP_child = HPConnect
hit_pts = 1405
explosion_resistance = 1.000000
debris_type = debris_normal
parent_impulse = 20
child_impulse = 80
volume = 0.000000
mass = 10
hp_gun_type = hp_torpedo_special_1
damage_per_fire = 0
power_usage = 50
refire_delay = 2
muzzle_velocity = 700
toughness = 12.100000
projectile_archetype = torpedo01_mark01_ammo
dry_fire_sound = fire_dry
separation_explosion = sever_debris
auto_turret = false
turn_rate = 90
lootable = true
LODranges = 0, 20, 60, 100

And that should be it. You might have to fiddle with some things, but this should work for the most part.

Post Sat Sep 01, 2007 1:05 pm

Thanks, that's what I thought. I'd originally just had the same settings as any other gun and just changed the HP types to torpedo. I did a bit more work, but wasn't quite there yet.

I've double checked what I've done against what you have here and I was on the right track, but I still have one little issue - the visible fire effect. When the const_effect in Munition is set to li_torpedo01_drive, it looks like a torpedo. When I change it to a beam effect, like li_laser_01_proj, the shot becomes invisible (well, I can still see the torpedo cmp flying out of the gun like a fat bullet). I've tried a variety of things, but it seems that the only way I can get a visible effect is to set the const_effect to a type of torpedo or missile, both of which are way too large. Any ideas?

Edited by - Cancerous Ordo on 9/1/2007 2:05:36 PM

Ogu

Post Sun Sep 02, 2007 9:13 am

You could try removing the model of the torp from the [Munition section:
DA_archetype = equipment\models\torpedoes\ge_torpedo.3db
material_library = equipment\models\ge_equip.mat

Also, get rid of this:
HP_trail_parent = HPExhaust
You probably don't need any trails behind the munition.

Let me know how you make out.

Post Mon Sep 03, 2007 2:56 am

It turns out that the visibility problem was in data\fx\effects.ini. Despite changing the effect type to EFT_WEAPON_PROJ, it required a vis_effect entry to be visible - a vis_beam entry, regardless of type, wouldn't work. I originally just wanted a thin beam spear that looked like tracer fire. I ended up going with vis_effect = pi_pulse_01_proj and vis_generic = min_laser_01_proj. It looks a lot like a photon torpedo from Star Trek. Not the effect I was after, but it looks really cool, the weapon works, and I'm happy. Thanks for all the help!

Return to Freelancer General Editing Forum