Sat Sep 01, 2007 7:22 am by Ogu
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.