*** Tutorial *** Creating New Weapons
Here we go.
The first action for an editor/modder has to be backing up the files. We will be messing with the following files:
\data\equipment\weapon_equip.ini
\data\equipment\weapon_good.ini
\data\equipment\market_misc.ini
\exe\freelancer.ini
Make backups of those files then decompress them with bini.exe if you didn't do that before. Bini makes .ini.txt files. Delete the real files (which you got backups of) and rename those .ini.txt files to .ini files.
Here's the list of programs we'll use:
Notepad to open decompressed ini files.
Reshacker to modify the dll template
FL ini Referer to calculate the ids_name and ids_info numbers
Here's a template of a dll file that you are going to add in to your freelancer.ini.
Dll template
The template already has a weapon name and infocard entry. So you can just analyze it to understand.
Before we go further. Those ini files are read only so you might want to change their attributes first.
First Step:
-------------
What kinda weapon do you want to create ? Pulse, laser, neutron, tachyon, plasma, photon or particle ? Decide which one you want and just open weapon_equip.ini
We will make a pulse weapon as an example. Search for pulse01 in the file. Yeah we will get an existing weapon entry as a basis. Probably you'll find the entry below:
<pre><font size=1 face=Courier>
[Munition
nickname = fc_c_gun02_mark01_ammo
hp_type = hp_gun
requires_ammo = false
hit_pts = 2
hull_damage = 10.100000
energy_damage = 303
weapon_type = W_Pulse01
one_shot_sound = fire_pulse3
munition_hit_effect = pi_pulse_01_impact
const_effect = pi_pulse_01_proj
lifetime = 1
force_gun_ori = false
mass = 1
volume = 0.000100
[Gun
nickname = fc_c_gun02_mark01
ids_name = 263211
ids_info = 264211
DA_archetype = equipment\models\weapons\ge_shredder_shotgun.cmp
material_library = equipment\models\ge_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_gun_special_5
damage_per_fire = 0
power_usage = 24.240000
refire_delay = 0.250000
muzzle_velocity = 600
use_animation = Sc_fire
toughness = 0.400000
flash_particle_name = pi_laser_01_flash
flash_radius = 15
light_anim = l_gun01_flash
projectile_archetype = fc_c_gun02_mark01_ammo
separation_explosion = sever_debris
auto_turret = false
turn_rate = 90
lootable = true
LODranges = 0, 20, 40, 80, 100
</font></pre>
A weapon entry has two parts. Munition and Gun. Just copy and paste those lines to the end of the file. Now we'll mess up with some settings. Change nicknames. Munition would always have the suffix "_ammo" at the end of its nickname.
Gun section's nickname is the actual nickname of the weapon.
Now change the munition's nickname to gun_darkreign_ammo and gun section's nickname to gun_darkreign.
hull_damage is obvious to understand i think. Shield damage is calculated according to this as the half of the hull damage. Change this whatever you want. The number will show up exactly in the stats of the weapon in game.
Weapon_type is the type of weapon that how the weapon will damage the type of shields. This weapon types are defined in the file named weaponmoddb.ini
Much of the other settings in the munition section are obvious and unnecessary to change.
Now the gun section. You changed the nickname to gun_darkreign right ? Ok now look at the ids_name and ids_info lines. Keep one of those numbers in your mind. We'll change these lines later. The numbers point to the dll file which we will create for weapon name and info text displayed in the game.
hit_pts is the hitpoint of the gun. Just like ships, nothing special.
hp_gun_type is important because it points the class of the weapon. If you want your weapon to be used by any ship you can change it to hp_gun_special_1.
power_usage is obviously handle the power consumption of the weapon. The minimum standart power usage is 4.580000. This one uses 24.
refire_rate is the rate of firing. The quickest rate is 0.120000 which means 8.33 (I dunno how this is calculated to get 8.33 or 5.88 or 4 or 2 or 3.03)
muzzle_velocity is the projectile speed. It's an exact number so use 800 for 800m/s in game.
Some say flash_radius is the explosion radius of the weapon when hit the target and they say if you want to set it to 10000 it takes the ships around the target down as well. I havent tested this yet.
projectile_archetype is the ammo's nickname so change this to gun_darkreign_ammo
auto_turret is the boolean value to set the weapon as a turret or not.
lootable also is a boolean value to make the weapon lootable or not.
Ok, now save the file after your changes. Now open the weapon_goods.ini
We are going to make our weapon a good to be sold on bases. Now search the number that you kept in your mind here. It will lead you to the entry like this :
<pre><font size=1 face=Courier>
[Good
nickname = fc_c_gun02_mark01
equipment = fc_c_gun02_mark01
category = equipment
price = 7460
item_icon = equipment\models\commodities\nn_icons\EQUIPICON_gun.3db
combinable = false
ids_name = 263211
ids_info = 264211
shop_archetype = equipment\models\weapons\ge_shredder_shotgun.cmp
material_library = equipment\models\ge_equip.mat
</font></pre>
change the nickname to your weapons nickname (gun_darkreign in this case). Use the same name for the equipment. Price is price and here we face those ids_name and ids_info again. Don't change them yet. Save the file now.
This is for the weapon setup. Now we need to add this wepon to a list of a base. I'll use Planet Pittsburg for an example. Open market_misc.ini and search for the line "base = Li01_02_base". It looks like this :
<pre><font size=1 face=Courier>
[BaseGood
base = Li01_02_base
MarketGood = co_gun01_mark01, 0, -1, 10, 10, 0, 1
MarketGood = co_gun01_mark02, 0, -0.200000, 10, 10, 0, 1
MarketGood = co_turret01_mark01, 0, -1, 10, 10, 0, 1
MarketGood = co_turret02_mark01, 0, -1, 10, 10, 0, 1
.
.
.
</font></pre>
Now we'll add a line there. just copy the first marketgood line and paste it next to the second gun entry and change the name after "=" to "gun_darkreign" so it should look like this now:
<pre><font size=1 face=Courier>
[BaseGood
base = Li01_02_base
MarketGood = co_gun01_mark01, 0, -1, 10, 10, 0, 1
MarketGood = co_gun01_mark02, 0, -0.200000, 10, 10, 0, 1
MarketGood = gun_darkreign, 0, -1, 10, 10, 0, 1
MarketGood = co_turret01_mark01, 0, -1, 10, 10, 0, 1
MarketGood = co_turret02_mark01, 0, -1, 10, 10, 0, 1
.
.
.
</font></pre>
Save the file.
Edited by - Catscratcher on 27-05-2003 20:51:10