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** - Weapons

Here you find the different tutorials on editing and MODing Freelancer

Post Thu Nov 18, 2004 6:25 am

**Tutorial** - Weapons

Another one, again, very old. I know that there are 100 other weapon tuts out there.
I didnt cover the FX creation part, but the rest should be pretty complete, including some useful lists.

Fjord

Post Thu Nov 18, 2004 6:27 am

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.

[uWeapon_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.


[uMine 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

Post Thu Nov 18, 2004 6:27 am

*****************************************************
- Very useful lists of variable values -
A note to the format: <1-4> means enter a value here, in this case 1 to 4, i.e.: fire_photon1 is a valid entry for fire_photon<1-5>, while fire_photon6 is not.
*****************************************************


[Munition
'one_shot_sound = '

This is the soundeffect used if u pull the trigger

fire_missile_regular
fire_missile_homing
fire_missile_emp
fire_cruise_disruptor
fire_torpedo
fire_mine_regular
fire_mine_tracking
fire_photon<1-5>
fire_laser<1-5>
fire_tachyon<2-5> (1 is never used)
fire_particle<1-5>
fire_neutron<2-5> (1 isnever used)
fire_pulse<1-5>
fire_plasma<1-5>
fire_capship
fire_capship_forward_gun
fire_no1
fire_no_cruise_disruptor

fire_no_torpedo
fire_no_capship

*****************************************************
[Munition
'munition_hit_effect = '

This is the effect of the impact.
These all can also be used in the [Explosion section in the 'effect = ' entry.

Pirates:
pi_photon_<01-04>_impact
pi_laser_<01-04>_impact
pi_tachyon_<01-04>_impact
pi_particle_<01-04>_impact
pi_neutron_<01-04>_impact
pi_pulse_<01-03>_impact
pi_plasma_<01-03>_impact
pi_capgun_01_impact

Liberty:
li_laser_<01-04>_impact
li_plasma_<01-04>_impact
li_capgun_01_impact

Bretonia:
br_tachyon_<01-04>_impact
br_particle_<01-03>_impact
br_capgun_01_impact

Kusari:
ku_neutron_<01-04>_impact
ku_photon_<01-04>_impact
ku_capgun_01_impact
Rheinland:
rh_tachyon_<01-04>_impact
rh_plasma_<01-04>_impact
rh_capgun_01_impact

Civilian:
ci_laser_<01-03>_impact
ci_pulse_<01-04>_impact
ci_photon_<01-04>_impact
ci_tachyon_<01-04>_impact
ci_capgun_01_impact

Nomad:
rtc_nomadtorpedo_impact
no_capgun01_impact
no_gun01_rank01_impact

codenames:
sp_annihilator_<01-03>_impact
sp_bloodhound_<01-03>_impact
sp_destabilizer_<01-03>_impact
sp_distortion_<01-03>_impact
sp_doomsday_<01-03>_impact

*****************************************************
[Munition
'const_effect = '

This is the "look" of the projectile, mostly you will only notice this one in a firefight.

Liberty:
li_laser_<01-04>_proj
li_plasma_<01-04>_proj
li_missile<01-02>_drive
li_empmissile_drive
li_cruisedis01_drive
li_torpedo01_drive
li_mine<01-02>
li_capgun_01_proj
li_cruiser_maingun
li_flakcannon01_proj

Bretonia:
br_tachyon_<01-04>_proj
br_particle_<01-04>_proj
br_missile<01-02>_drive
br_empmissile_drive
br_mine<01-02>
br_gunboat_maingun
br_capgun_01_proj
br_flakcannon01_proj

Kusari:
ku_neutron_<01-04>_proj
ku_photon_<01-04>_proj
ku_missile<01-02>_drive
ku_empmissile_drive
ku_cruisedis01_drive
ku_torpedo01_drive
ku_mine<01-02>
ku_gunboat_maingun
ku_capgun_01_proj
ku_flakcannon01_proj

Rheinland:
rh_tachyon_<01-04>_proj
rh_plasma_<01-04>_proj
rh_missile<01-02>_drive
rh_empmissile_drive
rh_mine<01-02>
rh_gunboat_maingun
rh_capgun_01_proj
rh_flakcannon01_proj

Pirate:
pi_missile<01-02>_drive
pi_mine<01-02>
pi_photon_<01-04>_proj
pi_laser_<01-04>_proj
pi_tachyon_<01-04>_proj
pi_particle_<01-04>_proj
pi_neutron_<01-04>_proj
pi_pulse_<01-03>_proj
pi_plasma_<01-03>_proj
pi_capgun_01_proj

Civilian:
ci_photon_<01-04>_proj
ci_tachyon_<01-04>_proj
ci_laser_<01-04>_proj
ci_pulse_<01-04>_proj
ci_capgun_01_proj

Nomad:
no_gun01_rank01_proj
no_cruisedis01_drive
rtc_nomadtorpedo_proj
no_capgun01_proj

Codenames:
sp_annihilator_<01-03>_proj
sp_bloodhound_<01-03>_proj
sp_destabilizer_<01-03>_proj
sp_distortion_<01-03>_proj
sp_doomsday_<01-03>_proj

*****************************************************
[Munition
'DA_archetype = '(.3db files) and 'material_library = '(.mat files)

These are the icons for ammo in the stores. Don't mix these!

equipment\models\weapons\li_rad_missile.3db
equipment\models\li_equip.mat

equipment\models\torpedoes\ge_torpedo.3db
equipment\models\ge_equip.mat

equipment\models\mines\br_plasma_mine.3db
equipment\models\br_equip.mat

*****************************************************
[Gun
'DA_archetype = '(.cmp files) and 'material_library = '(.mat files)

This is the model and skin of the gun. Don't mix these!
Note: one .mat file can contain skins for several guns!

Liberty:
equipment\models\weapons\li_rad_launcher.cmp
equipment\models\weapons\li_cm_dropper01.cmp
equipment\models\weapons\li_auto_cannon.cmp
equipment\models\weapons\li_laser_beam.cmp
equipment\models\weapons\li_smlturret.cmp
equipment\models\weapons\li_heavy_ion_blaster.cmp
equipment\models\weapons\li_plasma_blaster.cmp
equipment\models\li_equip.mat

equipment\models\turret\li_turret<01-04>.cmp
equipment\models\turret\li_turret04b.cmp
equipment\models\turret\li_turret05.cmp
equipment\models\turret\li_turret05b.cmp
equipment\models\turret\li_cruiser_gun01.cmp
equipment\models\li_turret.mat

Generic:
equipment\models\weapons\co_proton_cooker.cmp , these have funny names
equipment\models\weapons\co_raildaddy.cmp
equipment\models\weapons\co_shock_therapy.cmp
equipment\models\weapons\ge_shredder_shotgun.cmp
equipment\models\ge_equip.mat

equipment\models\turret\utility_turret<01-03>.cmp
equipment\models\turret\prison_turret01.cmp
equipment\models\turret\liner_turret01.cmp
equipment\models\turret\weapons_platform_turret.cmp
equipment\models\turret\weapons_platform_mturret.cmp
equipment\models\ge_turret.mat

equipment\models\turret\sp_turret<01-02>.cmp ;station turrets
equipment\models\sp_turret.mat

Equipment\models\weapons\no_fighter_gun.cmp
Equipment\models\hardware.mat

Bretonia:
equipment\models\weapons\br_mass_driver.cmp
equipment\models\weapons\br_railgun.cmp
equipment\models\br_equip.mat

equipment\models\turret\br_turret<01-04>.cmp
equipment\models\turret\br_turret04b.cmp
equipment\models\turret\br_gunboat_gun01.cmp
equipment\models\br_turret.mat

Kusari:

equipment\models\weapons\ku_ion_blaster.cmp
equipment\models\ku_equip.mat

equipment\models\turret\ku_turret<01-04>.cmp
equipment\models\turret\ku_gunboat_gun01.cmp
equipment\models\ku_turret.mat

Rheinland:
equipment\models\weapons\rh_gamma_beamer.cmp
equipment\models\weapons\rh_proton_blaster.cmp
equipment\models\rh_equip.mat

equipment\models\turret\rh_turret<01-04>.cmp
equipment\models\turret\rh_gunboat_gun01.cmp
equipment\models\rh_turret.mat

Weird stuff:
Equipment\models\turret\dyson_turret01.cmp ;now it's getting freaky
Solar\Solar_mat_dyson_city.mat

Solar\dockable\nomad_lair_turret<01-02>.cmp
material_library = solar\nomad.mat
solar\nomad.mat

*****************************************************
Hardpoints
'hp_gun_type = '


<pre><font size=1 face=Courier>hp_gun_special_<1-10> ; 'normal' gun/missile hardpoints. You set level of the gun here.
hp_turret_special_<1-10> ; 'normal' turret hardpoint. You set level of the turret here.
hp_torpedo_special_1 ; torpedo
hp_torpedo_special_2 ; cruise disruptor </font></pre>

*****************************************************
Weapon types
'weapon_type = '

This specifies as what kind of projectile your ammo will be treated. Important for different effectivity against different shield types.

<pre><font size=1 face=Courier>W_Photon01
W_Laser01
W_Tachyon01
W_Particle01
W_Neutron01
W_Pulse01
W_Plasma01 </font></pre>

Post Tue Nov 15, 2005 10:56 am

Let's save this great tutorial for future generations with a good, solid *BUMP*!

Edited by - ww2jacob on 11/15/2005 10:57:16 AM

Post Fri Apr 14, 2006 4:44 am

Very handy, thanks!

Return to Freelancer Editing Tutorial Forum