Weapons - by LordFjord
Things you need:
- bini.exe (get it from
www.lancersreactor.com)
(no nessessary if u get the FL SDK)
- any editor (notepad will do fine)
- FLMM to test the results
- FL SDK 1.3. get it from lancersreactor.
- patience (a LOT of this)[/list
Make your own mod for testing!
You will have to make a new mod where you will insert all the things you build.
Easiest way is to copy an existing minimod or to make a new custom mod (will handle that in a seperate tut).
Files you need to uncompress with bini:
Edit: this section is outdated. just copy the files from the FL SDK 1.3.
all are in the \DATA\EQUIPMENT directory of Freelancer
weapon_equip.ini -all specifications of weapons
weapon_good.ini -here u make the guns available for sale
market_misc.ini -location of guns/stuff being sold
A bit theory:
All guns and ammo types are specified in weapon_equip.ini.
Sections are:
[Motor - this is the "engine" of the missile
[Explosion - this specifies if your gun has area effect. only works if you also have a [Motor section.
[Munition - this is the actual shot of your gun, damage values, ranges,... are all defined here
[Mine - use this instead of [Munition for Mines
[Gun - this is the gun/launcher mounted on your ship
[MineDropper - use this instead of [Gun for mines
[LOD - defines LevelOfDetail ranges for bigger gun models
[Munition and [Gun are required, the others are optional.
You can make a missile without an explosion, a gun with an explosion, ...
I'm not sure if you can change the order how they are defined, i would always keep it as they were.
A simple weapon only needs the [Munition and [Gun sections.
This example is based on the energy missiles I made. I added an explosion effect to make this tutorial as complete as possible.
Below that you can also find a Mine example.
[u
Weapon_Equip.ini [/u
Explanation of all entries
[Motor
Optional, specifies if your weapon will have some form of "engine".
<pre><font size=1 face=Courier><font size=1 face=Courier>[Motor
nickname = energy_missile01_motor
lifetime = 3.000000
accel = 200.0000
delay = 0 </font> </font></pre>
nickname
Reference for [Munition. Pick a name of your choice that fits to the general scheme <gunname>_motor.
lifetime
Time in seconds where the engine will be active.
accel
Acceleration provided by the engine (not the gun).
I think this is a meter/sec^2 value.
delay
Time in seconds after launch where the engine will activate.
[Explosion
Optional, specifies if the impact of the projectile is followed by an explosion.
<pre><font size=1 face=Courier><font size=1 face=Courier>[Explosion
nickname = energy_missile01_explosion
effect = gf_piratestationexplode
lifetime = 0.000000, 0.000000
process = disappear
strength = 100
radius = 50
hull_damage = 100.000000
energy_damage = 20.00
impulse = 0 </font> </font></pre>
nickname
Reference for [Munition. Pick a name of your choice that fits to the general scheme <gunname>_explosion.
effect
Visual effect of the explosion. You can basically use every impact/explosion effect in the game. Example: battleship explosions for guns-impacts.
lifetime
Two values, both in seconds - min max duration of explosion FX.
process
??? always has 'disappear' as a value. I guess this is the effect after the explosion, i.e. it vanishes after blowing up
strength
???
radius
Area effect of damage values in meters.
hull_damage
The explosion damage. This also adds shield damage, according to the [ShieldEquipConsts
HULL_DAMAGE_FACTOR = 0.500000
entries in constants.ini.
energy_damage
Extra shield damage. Can have a negative value to make hull-only damaging weapons.
The total shield damage is calculated by:
total emp damage = energy_damage + HULL_FACTOR_DAMAGE * hull_damage
see constants.ini for the entry.
impulse
Kinetic effect on the target. Depends also on target's mass.
[Munition
Required. This will specify the projectile of your weapon.
<pre><font size=1 face=Courier><font size=1 face=Courier>[Munition
nickname = energy_missile01_ammo
explosion_arch = energy_missile01_explosion
loot_appearance = ammo_crate
units_per_container = 10
hp_type = hp_gun
requires_ammo = false
hit_pts = 2
hull_damage = 400
energy_damage = 200
weapon_type = W_Photon01
one_shot_sound = fire_plasma2
detonation_dist = 2.00000
munition_hit_effect = li_missile01_impact
lifetime = 3.0000
Motor = energy_missile01_motor
force_gun_ori = false
const_effect = li_missile01_drive
HP_trail_parent = HPExhaust
seeker = LOCK
time_to_lock = 0
seeker_range = 2000
seeker_fov_deg = 35
max_angular_velocity = 5.000000
cruise_disruptor = true
ids_name = 459791
ids_info = 459721
mass = 1
volume = 0.000000 </font> </font></pre>
nickname
Reference for [Gun. Pick a name of your choice that fits to the general scheme <gunname>_ammo.
explosion_arch
Optional. Reference from [Explosion.
loot_appearance
Specifies how 'dropped ammo' will look like.
units_per_container
Number of ammo units in a container.
hp_type
Use hp_gun for guns & missiles, hp_torpedo for torpedoes.
requires_ammo
true/false - Specifies if the Gun uses ammo or not.
hit_pts
Damage required to shoot down the projectile. Only important for missiles and torpedoes.
hull_damage
The damage caused on impact. same calculations for emp damage as in [Explosion
energy_damage
Extra shield damage. Can have a negative value to make hull-only damaging weapons. same calculations for emp damage as in [Explosion
weapon_type
Type of the weapon to create different affectivity against the shield types. See list below.
detonation_dist
Only important if the Weapon has an [Explosion. At this distance (in meters) to the target the projectile will blow up.
munition_hit_effect
The visual effect of the projectile impact. See list below.
lifetime
The lifetime of the projectile in seconds. This combined with the speed will specify the range of the gun.
motor
Optional. Reference from [Motor.
force_gun_ori
true/false Specifies if the launcher is swivel or not.
const_effect
Visual look of the projectile. See list below.
HP_trail_parent
??? is always HPExhaust
seeker
Optional, only for seekers. Set to 'LOCK' if you want to make a homing projectile. "DUMB" for nonseeking weapons.
time_to_lock
Optional, only for seekers. Changes have no effect here.
seeker_range
Optional, only for seekers. Within this range, the projectile will home in.
seeker_fov_deg
Optional, only for seekers. Field of view of the seeker where it will lock in degree.
max_angular_velocity
Optional, only for seekers. This is the "agility" of the projectile.
cruise_disruptor
Optional. The projectile will disrupt cruise engines on impact.
ids_name
ID reference
ids_info
infocard reference
mass
Mass of the projectile. You can increase this to have a kinetic effect on impact.
volume
Amount of cargo space the ammo will use in the cargo hold per unit.
[Gun
This is the launcher/gun itself.
<pre><font size=1 face=Courier><font size=1 face=Courier>[Gun
nickname = energy_missile01
ids_name = 459789
ids_info = 459790
DA_archetype = equipment\models\weapons\li_rad_launcher.cmp
material_library = equipment\models\li_equip.mat
HP_child = HPConnect
hit_pts = 400
explosion_resistance = 1.000000
debris_type = debris_normal
parent_impulse = 20
child_impulse = 80
volume = 0.000000
mass = 10
hp_gun_type = hp_gun_special_7
damage_per_fire = 0
power_usage = 200
refire_delay = 1.000
muzzle_velocity = 300.000000
toughness = 2.400000
flash_particle_name = ci_capgun_01_flash
flash_radius = 15
light_anim = l_gun01_flash
projectile_archetype = energy_missile01_ammo
dry_fire_sound = fire_dry
separation_explosion = sever_debris
auto_turret = false
turn_rate = 90
lootable = true
LODranges = 0, 20, 60, 100 </font> </font></pre>
nickname
Reference for market_misc.ini. Pick a name of your choice that fits to the general scheme <gunname>.
ids_name
ID reference
ids_info
infocard reference
DA_archetype
Visual look of the launcher/gun. See list below.
material_library
Skin for the launcher/gun. You have to take one that fits to the DA_archetype you chose.
HP_child
??? all guns have HPConnect here.
hit_pts
The damage the gun can take until it is destroyed.
explosion_resistance
Value 0-1. Explosion damage reduction. 1 means complete immunity, all built in guns have 1.
debris_type
??? all guns have debris_normal here. Guess this is the remaining debris when the gun was destroyed.
parent_impulse
???
child_impulse
???
volume
Amount of cargo space the gun will need.
mass
Mass of the gun. This will be added to the total mass of the ship. Units are unknown.
hp_gun_type
This specifies the mount-type and/or level of the gun. See list below.
damage_per_fire
??? Probably damage to the gun itself per shot. Didn't work at first tests.
power_usage
Energy used per shot.
refire_delay
Delay between two shots in seconds.
muzzle_velocity
Speed of the projectile at launch. A [Motor can change the speed after launch.
toughness
???
flash_particle_name
The flash effect at firing the gun (can be deleted if not used), a list will be added later as this is not that important. Until then, look up the effect of your favourite gun.
flash_radius
Flash radius in meters.
light_anim
Flash animation.
projectile_archetype
Reference to the [Munition that the gun will use.
dry_fire_sound
Sound the gun makes when it is fired but it cant fire (on cruise, in lanes)
seperation_explosion
Explosion when destroyed.
auto_turret
Turrets have all true. Seems to be a part of a not-finished autoturret function. NPCs will use this as an autoturret if set to true.
turn_rate
The turn-speed of the launcher/gun in degree/second.
lootable
Is the launcher/gun lootable? true/false
LODranges
Level of detail entries for the launcher. Use the same values as a gun with the same DA_archetype.
[u
Mine example(a mine from the game) [/u
Very similar to [Munition / [Gun. Most have an [Explosion section ahead, it's the same as for guns, so i leave that away here.
I will only comment the things here that are different to [Munition or [Gun
[Mine
Almost the same as [Munition
<pre><font size=1 face=Courier><font size=1 face=Courier>[Mine
nickname = mine01_mark01_ammo
explosion_arch = mine01_mark01_explosion
loot_appearance = ammo_crate
units_per_container = 10
requires_ammo = true
hit_pts = 2
one_shot_sound = fire_mine_regular
detonation_dist = 4
lifetime = 10
force_gun_ori = true
DA_archetype = equipment\models\mines\br_plasma_mine.3db
material_library = equipment\models\br_equip.mat
ids_name = 265165
ids_info = 266165
mass = 0.100000
volume = 0.000000
owner_safe_time = 4
linear_drag = 0.400000
seek_dist = 400
top_speed = 60
acceleration = 200
const_effect = li_mine01 </font> </font></pre>
owner_safe_time
The time in seconds where the owner can't trigger the mine.
linear_drag
This is the 'agility' of the mine.
seek_dist
The distance in meters where the mine will start to move.
top_speed
The top-speed of the mine. This is independent from the ships's speed. ('normal' projectile speeds are added to the current moving speed of the firing ship)
acceleration
Acceleration of the mine in meters/secs^2 until it reaches top_speed.
[Minedropper
Almost the same as [Gun.
<pre><font size=1 face=Courier><font size=1 face=Courier>[MineDropper
nickname = mine01_mark01
ids_name = 263165
ids_info = 264165
DA_archetype = equipment\models\weapons\li_cm_dropper01.cmp
material_library = equipment\models\li_equip.mat
HP_child = HPConnect
hit_pts = 400
explosion_resistance = 1.000000
debris_type = debris_normal
parent_impulse = 20
child_impulse = 80
volume = 0.000000
mass = 10
damage_per_fire = 0
power_usage = 0
refire_delay = 1
muzzle_velocity = 20
toughness = 3.300000
projectile_archetype = mine01_mark01_ammo
dry_fire_sound = fire_dry
separation_explosion = sever_debris
lootable = true
LODranges = 0, 20, 60, 100 </font> </font></pre>
Difference to a normal gun:
no 'hp_gun_type = ' entry
The hardpoint type is hardcoded in the section name, so FL knows that it is mounted on Minedropper hardpoints by the [Mine section itself.
Now the hard work is finished. To the easy part:
weapon_good.ini
[Good
The gun as an item on the market.
<pre><font size=1 face=Courier><font size=1 face=Courier>[Good
nickname = energy_missile01
equipment = energy_missile01
category = equipment
price = 400000
item_icon = equipment\models\commodities\nn_icons\EQUIPICON_torplauncher.3db
combinable = false
free_ammo = energy_missile01_ammo, 10
ids_name = 459789
ids_info = 459790
shop_archetype = equipment\models\weapons\li_rad_launcher.cmp
material_library = equipment\models\ge_equip.mat </font> </font></pre>
nickname
Name reference to market_misc.ini.
equipment
Weapon-nickname from weapon_equip.ini.
category
Location where it is sold: 'equipment' is equipment dealer, 'commodity' is the market.
price
Price of the gun. Note that the price of the ammo specified in free_ammo will be added to this.
item_icon
The icon of the weapon in the shop.
combinable
Stackable or not? true/false
free_ammo
Amount of ammo that comes with the launcher when you buy it.
ids_name
ID-reference
ids_info
Infocard reference
shop_archetype
Model of the launcher.
material_library
Skin of the launcher.
; enery_missile ammo (only needed if 'requires_ammo = true' in [Munition)
[Good
The ammo on the market.
<pre><font size=1 face=Courier><font size=1 face=Courier>[Good
nickname = energy_missile01_ammo
equipment = energy_missile01_ammo
shop_archetype = equipment\models\weapons\li_rad_missile.3db
material_library = equipment\models\li_equip.mat
category = equipment
price = 1000.00
item_icon = equipment\models\commodities\nn_icons\EQUIPICON_missiles.3db
combinable = true </font> </font></pre>
It is getting easier and easier, now we just have to add it to a base that should sell the stuff.
market_misc.ini
Look up your favourite base, take Ca01_01_base for Ottawa.
Add following lines under the listed items:
<pre><font size=1 face=Courier><font size=1 face=Courier>MarketGood = energy_missile01, 0, -1, 10, 10, 0, 1
MarketGood = energy_missile01_ammo, 0, -1, 50, 50, 0, 1 </font> </font></pre>
to the format:
MarkerGood = <package>,<min. player level>, <min. reputation>, < unknown >, < unknown >, <0 = sell item>, <price multiplier>
To the < unknown >
Set these to 10 if it is a gun, 50 if it's ammo. I guess this specifies where at the equipment dealer it is sold (Weapons, ammo, equipment,...)
Now activate your mod, start a FLserver, start FL, join your server and enjoy!!!
Fjord
P.S: i might have missed some phpbb tags from the original formatting.
Edited by - LordFjord on 11/18/2004 6:29:22 AM