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 ** Making a "Flak" Gun and a One-Shot

Here you find the different tutorials on editing and MODing Freelancer

Post Sun May 08, 2005 11:22 am

** Tutorial ** Making a "Flak" Gun and a One-Shot

Hi,
These tutorials will teach you how to do two new guns :
-A “Flak”-looking gun, which in fact means that it will propel ships away when these get hit. All with a nice explosion.
-A one shot to kill weapon based on the same technique.

Posts following…

Edited by - FriendlyFire on 5/8/2005 5:44:41 PM

Post Sun May 08, 2005 11:24 am

Flak Gun

First of all, go in EQUIPMENT\weapons_equip.ini and paste this :
<pre><font size=1 face=Courier>
[Explosion
nickname = Flak01_explosion ;That’s the name of the explosion.
effect = Flak01_impact ;This references to the Special Effect we’ll define later.
lifetime = 0.000000, 0.000000 ;This I think defines the lifetime of the projectile’s archetype once it hits the target.
process = disappear ;This tells the archetype to disappear when lifetime is expired.
strength = 500 ;This is to tell the global strength of the explosion. I don’t think it affects the game really.
radius = 50 ;Radius of the explosion. Bigger means damage is done wider. I don’t know if it affects the damage if this one is set in Munition though.
impulse = 1000 ;That’s the interesting value. Bigger means the ships will go further away. Experience with this to get what you’d like to see.

[Munition
nickname = Flak01_ammo ;Name of the Munition
explosion_arch = Flak01_explosion ;That refers to the upper stated Explosion.
hp_type = hp_gun ;Gun means it is considered as a gun. hp_torpedo is the other possibility.
requires_ammo = false ;Does not require ammo to be bought.
hit_pts = 2 ;HitPoints of the munition. If someone manages to destroy ammo, tell me!
one_shot_sound = fire_Flak01 ;Sound of the gun when shot. Can be whatever you want, even custom.
detonation_dist = 25 ;How far can the munition detonate from its target. This means the shot does not have to touch the target, only pass by it.
lifetime = 2 ;How many seconds will the projectile last.
force_gun_ori = false ;Does not lock the weapon to forward fire only.
const_effect = flak_proj ;That’s the Special Effect of the projectile, as it will appear while flying. We define it later.
ids_name = 265151 ;Name
ids_info = 266151 ;Information Card
mass = 1 ;Mass of the munition
volume = 0.000000 ;Its volume
weapon_type = W_Flak ;Weapon type. Can be an existing one or, like me, a custom one. Defines how does the weapon damages each type of shield.
hull_damage = 900 ;Hull damage caused by each shot.
energy_damage = 350 ;Shield damage caused by each shot. It is the number written + half of the Hull damage.

[Gun
nickname = Flak01_turret ;Nickname of the turret itself.
ids_name = 458912 ;Name
ids_info = 458912 ;Information Card
DA_archetype = equipment\models\turret\utility_turret03.cmp ;Archetype of the gun. This one I think looks really like Flak.
material_library = equipment\models\ge_turret.mat ;Material of the turret. Goes with the Archetype.
HP_child = HPConnect ;Default HardPoint for the Child.
hit_pts = 6752 ;Hit Points of the Gun itself. Bigger means harder to destroy/disable.
explosion_resistance = 1.000000 ;I have no idea…
debris_type = debris_turret_large ;Debris thrown when the gun is destroyed.
parent_impulse = 20 ;I think it does not do anything.
child_impulse = 80 ;Nor this.
volume = 0.000000 ;Volume…
mass = 10 ;Mass…
hp_gun_type = hp_turret_special_10 ;Gun type, hp_turret, hp_gun, hp_torpedo ranging from 1 to 10 (Torpedo is 1 or 2)
damage_per_fire = 0 ;? I think it’s the damage done to the possessor of the gun…
power_usage = 300 ;Power used per shot.
refire_delay = 0.4 ;How long is the time lap between 2 shots.
muzzle_velocity = 800 ;How many meters the shot covers per second. Multiplied with the lifetime in Munition, it gives the range.
toughness = 24.500000 ;???
projectile_archetype = Flak01_ammo ;Refers to the upper stated Munititon.
dry_fire_sound = fire_Flak01 ;Sound of the gun firing a shot.
separation_explosion = sever_debris ;Explosion of the gun itself when destroyed.
auto_turret = true ;NPCs use the turret automatically.
turn_rate = 120 ;How many degrees the turret can turn in a second.
lootable = false ;Cannot be looted.
</font></pre>

Once this is done, get into FX\effects.ini, and paste this :
<pre><font size=1 face=Courier>
[Effect
nickname = Flak01_impact ;Nickname of the blast effect
effect_type = EFT_EXPLOSION_MISSILE ;Defines it is a missile explosion (It’s the nearest to what we have here)
snd_effect = exp_Flak01 ;Sound effect, if wished.
vis_effect = li_mine01_blast25 ;Explosion effect. I suggest you to look into mines for fx, they look good, especially the smokey ones.

[Effect
nickname = flak_proj ;Nickname of the projectile effect
effect_type = EFT_WEAPON_PROJ ;Defines it is a projectile effect
vis_effect = ku_gunboat_maingun ;Refers to the Kusarian Gunboat Main Gun for the FX, I think it looks perfect for flaks.
vis_generic = ku_gunboat_maingun ;Same…
</font></pre>

And now have fun, put it in a loadout and try it! My best suggestion of use is to replace the Flak Guns of Battleships by these, and to up the impulse a little. Hehe

FF

Post Sun May 08, 2005 11:24 am

One Shot to kill Gun

Now I wont comment this one. It is simple enough, based on the same logic of the Flak gun, except that the impulse is lowered to zero, and damage is done both at the Explosion and at the Munition. Example follows :
<pre><font size=1 face=Courier>
[Explosion
nickname = OneShot_explosion
effect = li_missile02_impact
lifetime = 0.000000, 0.000000
process = disappear
strength = 100
radius = 30
impulse = 0
hull_damage = 999999
energy_damage = 999999

[Munition
nickname = OneShot_ammo
explosion_arch = OneShot_explosion
hp_type = hp_gun
requires_ammo = false
hit_pts = 2
one_shot_sound = fire_tachyon4
detonation_dist = 25
lifetime = 2
force_gun_ori = false
const_effect = rh_tachyon_03_proj
ids_name = 265151
ids_info = 266151
mass = 1
volume = 0.000000
weapon_type = W_Tachyon01
hull_damage = 999999
energy_damage = 999999

[Gun
nickname = OneShot_turret
ids_name = 458913
ids_info = 458913
DA_archetype = equipment\models\turret\utility_turret03.cmp
material_library = equipment\models\ge_turret.mat
HP_child = HPConnect
hit_pts = 6752
explosion_resistance = 1.000000
debris_type = debris_turret_large
parent_impulse = 20
child_impulse = 80
volume = 0.000000
mass = 10
damage_per_fire = 0
power_usage = 300
refire_delay = 0.4
muzzle_velocity = 400
toughness = 24.500000
projectile_archetype = OneShot_ammo
dry_fire_sound = fire_tachyon4
separation_explosion = sever_debris
auto_turret = true
turn_rate = 120
lootable = false
</font></pre>

Have fun!

FF

Post Sun May 08, 2005 11:37 am

Say wha!?!?!!?!?!


No Guts
---------------
No Glory

Post Sun May 15, 2005 4:09 pm

Does the OneShot not strip the shields and then a second shot destroy the hull? I was just curious, thinkin' about one for a few weapons in my mod.

Ro9ue
_________________________________
"Do or do not. There is no try."
- Jedi Master Yoda

Post Sun May 15, 2005 4:37 pm

Nope. If the damage you enter is high enough, it will eat through the shield AND the hull.

Because damage is given two times :
-In the explosion
-In the munition

It affects the ship two times, so if the shield left is lower than the damage given, it goes all boom at the same time!

Post Sun May 15, 2005 4:48 pm

Pure evil

Post Mon May 16, 2005 7:04 am

Heh.. I wonder how many tutorials based off my code will appear in the coming years..

Check out the latest beta's of the Freelancer S.D.K. 1.5 and Freelancer Explorer v2.x

Post Mon May 16, 2005 7:41 am

whaaa?
If your code is like this one, then it's pure hazard...
I worked this one alone lol

Though I was sure someone surely already managed to make this work (As the idea itself is pretty simple in itself), I did not (And I swear) take the code from anywhere else but my own head.

FF

Post Mon May 16, 2005 11:33 am

You know, if you set the damage values to -1...well...take a guess

(It really works, believe me - I've made and tested guns with them lol)

There hasn't been anything that is destroyable that hasn't been destroyed by me with one of these babies

L.D.

Post Tue May 17, 2005 7:44 am

@FriendlyFire - I was kidding nobody pays attention to who made what anymore. My code for this was released nearly two years ago.

Check out the latest beta's of the Freelancer S.D.K. 1.5 and Freelancer Explorer v2.x

Post Tue May 24, 2005 4:38 am

i've made that onehitkill gun a long time ago.. i've noted it several times.

except mine works in MP. so i decided not to release anyhting more about it.

Post Tue Oct 25, 2005 12:34 pm

The one-hit-kill gun doesn't work! I copied the code down exactly but it simply works like any other gun, only doing hull damage when their shields are down. Also, other guns I've tried to make with a blast effect also do no damage with the blast, although missiles still work fine. Can anyone tell me what's going on here?

Return to Freelancer Editing Tutorial Forum