-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify and robustify transport cargo killing and veterancy #6091
Simplify and robustify transport cargo killing and veterancy #6091
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the changes with continentals of SACU or harbingers, a T1 transport with SACU/harbingers, a carrier full of strategic bombers, and a CZAR. The veterancy distribution works.
In the suggestions, I fixed two bugs I found:
- units don't detach from air transports nor spawn wrecks on transport death. They also play death effects when the transport dies.
- Units in carriers (transport internal storage) play death effects/weapons (but aircraft don't have death weapons so its less noticeable). They shouldn't do this because it looks bad.
There is another bug that I'm unsure of the best way to fix:
- transports/carriers can't be ctrl-k'd.
This bug is caused becauseEntity:Kill()
is separate fromEntity:Kill(instigator, damageType, excessDamageRatio)
, and the latter is called if any 3 arguments are passed to :Kill, even if they are nil, and the arguments must be valid (instigator is Unit | nil, damageType is string, excessDamageRatio is number
).
Solutions: Add(nil, '', 0)
to selfdestruct.lua:45, addif not instigator then damageType = '' excessDamageRatio = 0 end
to the AirTransportUnit and AircraftCarrierUnitKill
functions, or use BaseUnitKill(self) when instigator == nil inside the unit classes and inside killcargo.
The best fix would just be whatever is most easily documented I guess.
Future? possible improvements:
- wrecks from transports' internal storages
- can an internal storage + external clamps transport exist? If so, would it break the logic?
Don't forget the changelog by the way.
Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com>
Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com>
Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com>
Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com>
Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com>
Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com>
…ing "needs to be defined"
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". |
Please Request a review from me once PR is Complete :) |
Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com>
Alright we should be solid (tested it this time!) Improvements:
Possible issues:
Minor issues:
Future ideas:
|
@relent0r will any of the changes here affect ai ? |
I mediated on it for a bit, trimming down to a single damage type ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it and found no errors.
Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com>
Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com>
Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com>
Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com>
Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com>
Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com>
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. |
@lL1l1 you happy with the changes so far? if so can you approve the PR so I know |
killedInTransport flagging variable is renamed back, so we should be squared away |
commit ceb09ce Author: Josh <row.josh02@gmail.com> Date: Tue Apr 23 09:35:48 2024 +0100 Balance : TML Hp Reduction & Adds Death Weapon (FAForever#6104) Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com> commit 23ebe48 Author: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Mon Apr 22 12:06:13 2024 -0700 Fix units not rebuilding on army transfer (FAForever#6106) commit 5f7b2a9 Author: clyf <clyfordv@gmail.com> Date: Mon Apr 22 04:15:20 2024 -0400 Simplify and robustify transport cargo killing and veterancy (FAForever#6091) Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com> commit d3ef3c0 Author: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Sun Apr 21 10:02:18 2024 -0700 Inherit all damage data in Ahwassa bomb script (FAForever#6102) commit f925f48 Author: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Sat Apr 20 22:21:57 2024 -0700 Refactor collision beams (FAForever#6065) commit 24abffa Author: G C <37224614+Hdt80bro@users.noreply.github.com> Date: Sat Apr 20 08:45:44 2024 -0700 Quicken inevitable voting results (FAForever#5088) commit 2547d18 Author: (Jip) Willem Wijnia <w.b.wijnia@gmail.com> Date: Sat Apr 20 09:28:24 2024 +0200 Introduce basic anti-spam protection from taunts (FAForever#6099) commit 1635090 Author: (Jip) Willem Wijnia <w.b.wijnia@gmail.com> Date: Sat Apr 20 09:25:23 2024 +0200 Revert "Remove mass from dead trees and tree groups" (FAForever#6101) commit ca94bd8 Author: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Fri Apr 19 15:09:17 2024 -0700 Revert "Remove mass from dead trees and tree groups" (FAForever#6100) commit 524fc7f Author: clyf <clyfordv@gmail.com> Date: Fri Apr 19 10:42:27 2024 -0400 Fix being able to detach the external factory of the primary unit (FAForever#6093) commit 7993337 Author: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Thu Apr 18 00:53:13 2024 -0700 Revert hoplite firing from transports (FAForever#6094)
VeterancyComponent.VeterancyDispersal
.And hopefully all in a much more straightforward way than before!