Flak Turrets implementation
-
Btw.: There is a logical explanation for the lag-problem.
With a acceleration time of 0.1 seconds, that means the serverload MUST be less than 100ms for the physics engine to actually accelerate the projectile. (since in that case the server tics at around 100ms, āforgettingā the acceleration event)
Im not really sure how the physics engine works in detail, but I think that is basically the reason for slow acceleration times not working good on slow servers.
-> Try a longer acceleration time.
-
Why not give no acceleration and simply put a muzzle_velocity? I do believe thatād work fine, although I canāt test anything ATMā¦
Also, I remember FLWT also uses pseudo-flak guns, but they arenāt missiles. We just strapped an explosion on top of a normal weapon and it works. Only thing Iām not sure of is whether the detonation distance works in that case.
-
The way I had it working before is the best implementation so far. It is a combination of muzzle velocity and acceleration from the missile. I have managed to get the ākill yourselfā bug under control. It still happens every once in awhile, but its nowhere near as bad as before. Also the flak itself works perfectly. Too perfectly actually. It completely destroys my idea of balance, but thatās a discussion for somewhere else.
Also no, you cannot have a muzzle velocity with no acceleration. I cannot remember off the top of my head why not, but I know for a fact it does not work.
Also, you cannot attach an explosion to a bullet. Freelancer will not correctly apply an explosion to a projectile unless it is clearly defined as a missile. If you apply an explosion to a bullet, the explosion effect will play, but none of its gameplay values such as explosion radius, hull damage, etc, are calculated.
-
[Gun] nickname = CAPITAL_1 ids_name = 458972 ids_info = 0 DA_archetype = ..\DATA\equipment\models\weapons\li_laser_beam.cmp material_library = ..\DATA\equipment\models\li_equip.mat HP_child = HPConnect hit_pts = 52400 explosion_resistance = 1.000000 debris_type = debris_normal parent_impulse = 20 child_impulse = 80 volume = 0.000000 mass = 50 hp_gun_type = hp_turret_special_07 damage_per_fire = 0 power_usage = 9000000 refire_delay = 1 muzzle_velocity = 1500 use_animation = Sc_fire toughness = 1.000000 flash_particle_name = sp_distortion_02_flash flash_radius = 45 light_anim = l_gun01_flash projectile_archetype = CAPITAL_1_AMMO separation_explosion = sever_debris auto_turret = true turn_rate = 90 lootable = true LODranges = 0, 20, 60, 100 [Munition] nickname = CAPITAL_1_AMMO hp_type = hp_gun requires_ammo = false hit_pts = 2 weapon_type = W_Global one_shot_sound = fire_capship munition_hit_effect = ci_capgun_01_impact const_effect = CAPITAL_1_PROJ lifetime = 1 force_gun_ori = false mass = 1 volume = 0.000100 detonation_dist = 25 explosion_arch = CAPITAL_1_EXPLOSION hull_damage = 2500 energy_damage = 750 [Explosion] nickname = CAPITAL_1_EXPLOSION effect = CAPITAL_1_EXPLOSION lifetime = 0.000000, 0.000000 process = disappear strength = 100 radius = 50 impulse = 10000
I donāt actually NEED the damage to be spread over the radius, so for me this works just fine. Impulse is dealt properly. If you absolutely need to have damage dealt over a certain damage radius or if you want it to have a detonation distance, fine, but otherwise this makes a much lighter version of the flak gun, all while retaining its graphical look and feel.
-
A flak gun without a detonation distance and without explosion radius is not really a flak gun.
And yeah, I also cannot remember the reason for muzzle velocity alone not working, but the bottom line was: not working
Anyways, on our server the flaks work pretty good
-
The flak is working perfectly for the moment. I have not had any stuck flak missiles at all yet. I canāt exactly say what fixed it, but I am happy. I also found a way to put my flak in and be balanced. In the video I am not the one using the flak, but rather the Battleship piloted by another is. Itās great fun to watch and fly through. I am piloting a support gunboat for taking out fighters.
-
Wow Why, that is pretty ace stuff. Who was that with you? I take it none of the server lag issues were really worked out? lol
Also, I really need to try out some of you and KJās Cap Ship work. I might as well start working it into RC122, since I want to wait for M0tah to finalize his next Hook build before release.
-
Wow Why, that is pretty ace stuff. Who was that with you? I take it none of the server lag issues were really worked out? lol
Also, I really need to try out some of you and KJās Cap Ship work. I might as well start working it into RC122, since I want to wait for M0tah to finalize his next Hook build before release.
Iām waiting for you and M0tah of great mod long long time. ;D
-
Wow Why, that is pretty ace stuff. Who was that with you? I take it none of the server lag issues were really worked out? lol
Also, I really need to try out some of you and KJās Cap Ship work. I might as well start working it into RC122, since I want to wait for M0tah to finalize his next Hook build before release.
Iām not sure what did it, but I havenāt had any problem at all with the flak exploding the barrels anymore. Iām pretty sure it had to do with setting the missiles to dumbfire, also giving their turret turn speed a really high value helped some as well. Iāve been testing on the KJs server the whole time. He was the other pilot.
-
@w0dk4, Iām monkeying about with the flak cannons using your code up there but Iām finding that a lot of the ābulletsā are exploding as soon as they leave the barrel. Should I be increasing the lifetime a bit?
R
-
@w0dk4, Iām monkeying about with the flak cannons using your code up there but Iām finding that a lot of the ābulletsā are exploding as soon as they leave the barrel. Should I be increasing the lifetime a bit?
R
Try increasing the hit points of the actual ammunition (its 2) to 2000 or something, this way the bullets dont destroy themselve
-
As a believer in open source material, here is the source code for my flak guns. Highlighted are the important bits.
[Motor]
nickname = li_battleship_flak_turret01_motor
lifetime = 1
accel = 500
delay = 0[Explosion]
nickname = li_battleship_flak_turret01_explosion
effect = explosion_super_flak
lifetime = 0.000000, 0.000000
process = disappear
strength = 0
radius = 250
hull_damage = 750
energy_damage = 0
impulse = 50[Munition]
nickname = li_battleship_flak_turret01_ammo
ids_name = 263383
explosion_arch = li_battleship_flak_turret01_explosion
hp_type = hp_gun
requires_ammo = false
hit_pts = 1000000 ;so that flak doesnt kill itself
one_shot_sound = null
detonation_dist = 75
lifetime = 1
Motor = li_battleship_flak_turret01_motor
force_gun_ori = false
const_effect = li_flakcannon01_proj
HP_trail_parent = HPExhaust
seeker = DUMB
time_to_lock = 0
DA_archetype = equipment\models\torpedoes\ge_torpedo.3db
material_library = equipment\models\ge_equip.mat
mass = 200
volume = 0.000100
;type = LOOT[Gun]
nickname = li_battleship_flak_turret01
ids_name = 263383
ids_info = 264383
DA_archetype = equipment\models\turret\li_turret04.cmp
material_library = equipment\models\li_turret.mat
HP_child = HPConnect
hit_pts = 25000 ;LEquip
explosion_resistance = 0.1
debris_type = debris_turret_small
parent_impulse = 0
child_impulse = 0
volume = 16.000000
mass = 10
hp_gun_type = hp_turret_special_9
damage_per_fire = 0
power_usage = 170
refire_delay = 0.5
muzzle_velocity = 500
toughness = 10
light_anim = l_gun01_flash
projectile_archetype = li_battleship_flak_turret01_ammo
separation_explosion = sever_debris
auto_turret = true
turn_rate = 1000
lootable = true
dispersion_angle = 18 -
@ w0dk4 and Why485. May I have permission to add your effects and some of your code into my mod as well?
Thanks,
RoboOh, and while Iām awaiting permissions, Iām testing as a learning experience. This is my code so far:
<data file="data\equipment\weapon_equip.ini" method="sectionreplace" options="1:0, 1:1">[Motor] nickname = li_battleship_flak_turret01_motor <dest>lifetime = 1 accel = 166.666702</dest> <source> lifetime = 0.100000 accel = 10000</data> <data file="data\equipment\weapon_equip.ini" method="sectionreplace" options="1:0, 1:1">[Explosion] nickname = li_battleship_flak_turret01_explosion <dest>effect = gf_explosion_super_flak lifetime = 0.000000, 0.000000 process = disappear strength = 100 radius = 16 hull_damage = 81.500000 energy_damage = 0 impulse = 0</dest> <source> effect = flu_flakcannon01_impact lifetime = 0.000000, 0.000000 process = disappear strength = 80 radius = 250 hull_damage = 1000 energy_damage = 500 impulse = 1800</data> <data file="data\equipment\weapon_equip.ini" method="sectionreplace" options="1:0, 1:1">[Munition] nickname = li_battleship_flak_turret01_ammo <dest>hit_pts = 2 one_shot_sound = fire_capship detonation_dist = 4 lifetime = 5 Motor = li_battleship_flak_turret01_motor force_gun_ori = false const_effect = li_flakcannon01_proj HP_trail_parent = HPExhaust seeker = DUMB DA_archetype = equipment\models\weapons\li_rad_missile.3db material_library = equipment\models\li_equip.mat mass = 1 volume = 0.000100</dest> <source> hit_pts = 2000 one_shot_sound = fire_capship detonation_dist = 100 lifetime = 0.900000 Motor = li_battleship_flak_turret01_motor force_gun_ori = false const_effect = sp_doomsday_03_proj HP_trail_parent = HPExhaust seeker = DUMB time_to_lock = 0 DA_archetype = equipment\models\weapons\li_rad_missile.3db material_library = equipment\models\li_equip.mat mass = 1 volume = 0.0 ids_name = 1 ids_info = 1</data> <data file="data\equipment\weapon_equip.ini" method="sectionreplace" options="1:0, 1:1">[Gun] nickname = li_battleship_flak_turret01 <dest>hit_pts = 4800 explosion_resistance = 1.000000 debris_type = debris_turret_small parent_impulse = 20 child_impulse = 80 volume = 50.000000 mass = 10 damage_per_fire = 0 power_usage = 0 refire_delay = 0.500000 muzzle_velocity = 83.300003 toughness = 1.600000 flash_particle_name = li_flakcannon01_flash flash_radius = 15 light_anim = l_gun01_flash projectile_archetype = li_battleship_flak_turret01_ammo separation_explosion = sever_debris auto_turret = true turn_rate = 90</dest> <source> hit_pts = 69500 explosion_resistance = 1.000000 debris_type = debris_turret_small parent_impulse = 20 child_impulse = 80 volume = 0.000000 mass = 10 damage_per_fire = 0 power_usage = 0 refire_delay = 0.250000 muzzle_velocity = 1 toughness = 10.600000 flash_particle_name = rtc_nomad_torpedo_flash flash_radius = 35 light_anim = l_gun01_flash projectile_archetype = li_battleship_flak_turret01_ammo separation_explosion = sever_debris auto_turret = true turn_rate = 270 dispersion_angle = 18 hp_gun_type = hp_turret_special_10</data> <data file="data\FX\WEAPONS\weapons_ale.ini" method="append" options="1:0, 1:1"><source> [VisEffect] nickname = gf_explosion_super_flak ;created by Why485, modded by w0dk4 alchemy = fx\explosions\gf_explosion_super_flak.ale effect_crc = 290209852 textures = fx\sarma.txm textures = fx\lightbeam.txm textures = fx\standardeffects.txm textures = fx\kioncannon.txm</data> <data file="data\FX\effects.ini" method="append" options="1:0, 1:1"><source> [Effect] nickname = gf_explosion_super_flak effect_type = EFT_WEAPON_IMPACT vis_effect = gf_explosion_super_flak</data>
I downloaded the effects file at the link you gave w0dk4, renamed the extension from *.tale to *.ale (was I supposed to do that?), and put the file in the FX\EXPLOSIONS directory.
The problem Iām seeing so far is that the effect just isnāt working. Do I need to do something else that Iāve missed? -
Freelancer is very, very picky with anything effects related. As such, when I code effects I try to keep the structure, formatting, and placement as similar to the vanilla files as possible. One such example is the way my flak effect is coded into the game.
The way you have the effect setup is something akin to a muzzle flash or bullet effect. This was not what the effect was based on, and I believe something hard-coded in Freelancer is causing this difference to shut down the effect. My effect was based on the Patriotās explosion effect, and as such it is setup exactly the same way as the Patriot explosion, except for the names and crc being different.
This is all the code that I used in order to get my flak explosions to work in the FX folder.
\DATA\FX\effects_explosion.ini
[Effect]
nickname = explosion_super_flak
effect_type = EFT_EXPLOSION_SHIP
vis_effect = gf_explosion_super_flak
;snd_effect = med_explosion1
snd_effect = flak_explosion_sound
lgt_effect = elite_flash_to_red
lgt_range_scale = 30
lgt_radius = 30\DATA\FX\EXPLOSIONS\explosions_ale.ini
[VisEffect]
nickname = gf_explosion_super_flak
alchemy = fx\explosions\gf_explosion_super_flak.ale
effect_crc = 290209852
textures = fx\sarma.txm
textures = fx\lightbeam.txm
textures = fx\standardeffects.txm
textures = fx\kioncannon.txm -
Iāll give that a try. Thanks.
Also, I notice the Munition still used the explosion_arch = li_battleship_flak_turret01_explosion. This has no bearing on the actual effect I presume?
R