The Starport
  • Categories
  • Recent
  • Users
  • Groups
  • Starport Blog
  • Knowledge Base
  • The Forge
  • Discord
  • Register
  • Login

Flak Turrets implementation

Scheduled Pinned Locked Moved Coding
40 Posts 12 Posters 28.4k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Why485
    wrote on global:last_edited_by,
    #29

    I originally had that exact same issue you are describing robocop. But after much tweaking and unexpected side effects, the flak code that I posted works flawlessly for me. I have not had a single stuck flak bullet in a very, very long time.

    1 Reply Last reply
    0
  • R Offline
    R Offline
    robocop Historic Supporter
    wrote on global:last_edited_by,
    #30

    Yeah, I’m using your code and finding the problems fixed. Thanks much.

    Do you remember the formula offhand on how to figure out range of missiles? I know the muzzle velocity, lifetime of the motor, and the lifetime of the munition all factor in, but I don’t remember the details.

    R

    1 Reply Last reply
    0
  • F Offline
    F Offline
    FriendlyFire
    wrote on global:last_edited_by,
    #31

    Well, classical physics should work fine normally 😉

    RANGE = MUZZLE_VELOCITY * LIFETIME + (ACCELERATION * MOTOR_LIFETIME ^ 2) / 2 + (MUZZLE_VELOCITY + ACCELERATION * MOTOR_LIFETIME) * (LIFETIME - MOTOR_LIFETIME)

    That should work, although it may be possible to simplify it a bit ;D

    1 Reply Last reply
    0
  • A Offline
    A Offline
    Aeril
    wrote on global:last_edited_by,
    #32

    I don’t know why, but i don’t get this effect to work. I wanted to modify the Battleship Flaks already implemented in the discovery mod, because they aren’t realy flakguns in my eyes. So i placed the gf_explosion_super_flak.ale in the fx/explosions folder and modified the entry in weapon_equip:

    [Motor]
    nickname = li_battleship_flak_turret01_motor
    lifetime = 1
    accel = 500
    delay = 0
    
    [Explosion]
    nickname = li_battleship_flak_turret01_explosion
    effect = li_flakcannon01_impact
    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
    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
    
    [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
    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_10
    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
    

    the effects_explosion:

    [Effect]
    nickname = li_flakcannon01_impact
    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
    

    and the explosions_ale

    [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
    

    The weapon has the new values, but the effect is just one small explosion, like it was before.

    1 Reply Last reply
    0
  • W Offline
    W Offline
    w0dk4
    wrote on global:last_edited_by,
    #33

    the effect is only one explosion, so there is nothing wrong there

    use disperison_angle (or similar, cannot remember right now) and multiple fire hps to get a decent looking flak-explosion-screen

    1 Reply Last reply
    0
  • FRF Offline
    FRF Offline
    FR Historic Supporter
    wrote on global:last_edited_by,
    #34

    Might want to try

    dispersion_angle = ……

    and maybe

    DA_archetype = equipment\models\weapons\br_auto_shotgun.cmp
    material_library = equipment\models\br_equip.mat

    which will give you a gun with 5 HpFire.
    😉

    1 Reply Last reply
    0
  • A Offline
    A Offline
    Aeril
    wrote on global:last_edited_by,
    #35

    I have used dispersion_angel (last line in weapon_equip). But i can’t use another archetyp, because it is a optional modification. Or am i wrong, that the archetyp have to be the same for the people without the mod and those, which have the mod?

    1 Reply Last reply
    0
  • FRF Offline
    FRF Offline
    FR Historic Supporter
    wrote on global:last_edited_by,
    #36

    …… i suppose both (archetype + dispersion) have 2 be on the client
    and should be on the server 2.

    Hit detection is usually done on the client (w0dk4 is the man 2 ask 😉 )
    and dispersion effects that.

    It’s a funny thing 4 ‘2nd hand weapons’ ;D
    and 2.5 make it hard 2 hit anything.

    1 Reply Last reply
    0
  • A Offline
    A Offline
    Aeril
    wrote on global:last_edited_by,
    #37

    The mod will be on the server, but it must be an optional mod for the client, so i can’t use different archetyps. Robocop said on the last page, that he got it to work with Why485’s code, so i used it, too.

    1 Reply Last reply
    0
  • O Offline
    O Offline
    OPR8R
    wrote on global:last_edited_by,
    #38

    hit detection is done on client AND on the server side

    it simply depends on which kind of hit detection you mean coz there are different kinds

    1 Reply Last reply
    0
  • A Offline
    A Offline
    Aeril
    wrote on global:last_edited_by,
    #39

    I don’t mean any hit detection. I am wondering, why i see just one explosion, while i used the same code as Why485. This is, what i asked for.

    1 Reply Last reply
    0
  • FRF Offline
    FRF Offline
    FR Historic Supporter
    wrote on global:last_edited_by,
    #40

    @Aeril:

    I don’t mean any hit detection ……

    … so dispersion and the numbers of HpFire effect that,
    that was just an argument,
    if you might need those changes client and/or server side.

    1 Reply Last reply
    0

  • Story Mission level requirement
    C
    CommanderArgelo
    0
    11
    52

  • Crash Offsets
    J
    josbyte
    0
    231
    251.4k

  • Capital ships shield collision detection
    C
    CommanderArgelo
    0
    3
    17

  • Dropping a phantomloot cargo from an NPC
    C
    CommanderArgelo
    0
    5
    26

  • Incorrect Shield Value on HUD
    C
    CommanderArgelo
    0
    4
    19

  • @Adoxa - Wheel Scroll plugin improvements
    AingarA
    Aingar
    0
    3
    20

  • Release: Advanced Renderer v. 1.1 beta 1
    S
    SWAT_OP-R8R
    3
    50
    428

  • German Mod Tutorials? 2024 Mod Tutorial?
    S
    SWAT_OP-R8R
    0
    18
    66
  • First post
    Last post
0
  • Categories
  • Recent
  • Users
  • Groups
  • Starport Blog
  • Knowledge Base
  • The Forge
  • Discord