FAForever / fa

Lua code for FAF
221 stars 228 forks source link

Simplify and robustify transport cargo killing and veterancy #6091

Closed clyfordv closed 2 months ago

clyfordv commented 3 months ago
  1. When killing cargo, the instigator unit is provided. The engine then counts kills for score and unitview purposes.
  2. Similarly, the mass of all cargo is distributed to the killer(s) (via lua) with VeterancyComponent.VeterancyDispersal.
  3. For transports with external storage, cargo is cached so impact effects can be delayed/applied properly when the transport hits the ground.
  4. Lastly, the new function explicitly kills all units (previously relied on the engine to do it), which (hopefully) addresses a bug where units who were supposed to die escaped their fate.

And hopefully all in a much more straightforward way than before!

clyfordv commented 3 months ago

Fixed ctrl-k, probably had something to do with removing the part with comments to the effect of "do not remove this part or it won't work".

MrRowey commented 3 months ago

Please Request a review from me once PR is Complete :)

clyfordv commented 3 months ago

Alright we should be solid (tested it this time!)

Improvements:

Possible issues:

Minor issues:

Future ideas:

MrRowey commented 3 months ago

@relent0r will any of the changes here affect ai ?

clyfordv commented 3 months ago

I mediated on it for a bit, trimming down to a single damage type ("TransportDamage") felt right. Let me know if there's any objections.

relent0r commented 2 months ago

@relent0r will any of the changes here affect ai ?

I don't see anything that would impact the default AI. The changing from OnKilled to Kill might impact other AI's that are tracking deaths of units. But it looks like we are trying to make it consistent between files so makes sense.

MrRowey commented 2 months ago

@lL1l1 you happy with the changes so far? if so can you approve the PR so I know

clyfordv commented 2 months ago

killedInTransport flagging variable is renamed back, so we should be squared away