[6.20] M/smaller ships won't fire EMP missiles against other M/smaller ships.

Ask here if you experience technical problems with X4: Foundations.

Moderator: Moderators for English X Forum

Post Reply
Mookau
Posts: 109
Joined: Tue, 8. Sep 20, 05:31
x4

[6.20] M/smaller ships won't fire EMP missiles against other M/smaller ships.

Post by Mookau » Fri, 29. Mar 24, 20:24

OS: Linux
Version: 6.20
Language: English
Modified: No
Game Start: Budgeted Start

Problem:
S\M ships equipped with EMP missiles won't fire them when attacking another ship of M size or smaller.

How to Reproduce:
Load a fighter with missile launchers, and only EMP missiles. Tell them to attack a (M or smaller) target and they will chase them but never fire a shot.
Alternatively - arm a fighter with mixed weapon loadouts (missiles + normal weapons), they will fire their regular weapons, but not any of their EMP missiles.

Loading the save below, there are two Asps with loadouts as above.
Use either Asp to target any M or smaller ship in the area.
Watch them do their attack runs, noting their missile amounts in their loadout, and that they never use them.

Save File:
https://drive.google.com/file/d/1OnZA4i ... sp=sharing

Notes:
This bug was actually sent to me by DeadAir. I double checked and tested the bug myself, and can confirm that fighters will never fire EMPs in the above situation.

Research:
There appears to be a bug within the "fight.attack.object.fighter.xml" with the line:

Code: Select all

<do_if value="not $target.isclass.ship_xs and ((not this.ship.dps.lasers.all and this.ship.dps.missiles.all) or (this.ship.dps.missiles.all gt 0 and player.age gt $delaymissiles))">
Firstly the section: "this.ship.dps.missiles.all gt 0" is a problem because EMP missiles have an 'explosiondamage' of 0 (as listed in the missile_emp_mk1_macro.xml file). Thus 'this.ship.dps.missiles.all' can never be greater than 0 for a ship loaded with only EMPs, so ships with mixed weapons will never fire their EMP missiles.

Secondly, the section: "not this.ship.dps.lasers.all and this.ship.dps.missiles.all" is intended to filter out ships so that we are left with ships that only have missiles, however it doesn't check the existence of missile weapons, instead it checks if the weapon groups have any DPS. A 0 here will evaluate to false, so this check fails as well due to EMPs having 0 damage.


Fix:

A fix that maintains the status quo would be to change the check from the missile dps amount to the missile storage amount.

Code: Select all

<do_if value="not $target.isclass.ship_xs and ((not this.ship.dps.lasers.all and this.ship.ammostorage.missile.count) or (this.ship.ammostorage.missile.count gt 0 and player.age gt $delaymissiles))">
Alternatively, though it would be a mechanical change, giving EMP missiles a damage amount should also fix it.

Mookau
Posts: 109
Joined: Tue, 8. Sep 20, 05:31
x4

Re: [6.20] M/smaller ships won't fire EMP missiles against other M/smaller ships.

Post by Mookau » Tue, 23. Apr 24, 08:36

Beep boop.

Apologies, I know bumping is generally frowned upon, but this issue persists even in the beta. I believe all the posts about bugs since the beta released have drowned this (and my other post) out a bit.

Alan Phipps
Moderator (English)
Moderator (English)
Posts: 30483
Joined: Fri, 16. Apr 04, 19:21
x4

Re: [6.20] M/smaller ships won't fire EMP missiles against other M/smaller ships.

Post by Alan Phipps » Tue, 23. Apr 24, 13:34

You have one supportive/similar report from another player.
A dog has a master; a cat has domestic staff.

Post Reply

Return to “X4: Foundations - Technical Support”