Phobos icon indicating copy to clipboard operation
Phobos copied to clipboard

[Minor] Attach effect when weapon fire

Open CrimRecya opened this issue 11 months ago • 8 comments

AttachEffect will directly act on the target at the instant after firing.

[SOMEWEAPON]                                       ; WeaponType
AttachEffect.AttachTypes=                          ; List of AttachEffectTypes
AttachEffect.CumulativeRefreshAll=false            ; boolean
AttachEffect.CumulativeRefreshAll.OnAttach=false   ; boolean
AttachEffect.CumulativeRefreshSameSourceOnly=true  ; boolean
AttachEffect.RemoveTypes=                          ; List of AttachEffectTypes
AttachEffect.RemoveGroups=                         ; comma-separated list of strings (group IDs)
AttachEffect.CumulativeRemoveMinCounts=            ; integer - minimum required instance count (comma-separated) for cumulative types in order from first to last.
AttachEffect.CumulativeRemoveMaxCounts=            ; integer - maximum removed instance count (comma-separated) for cumulative types in order from first to last.
AttachEffect.DurationOverrides=                    ; integer - duration overrides (comma-separated) for AttachTypes in order from first to last.

More general expansion for #1472 .

CrimRecya avatar Dec 29 '24 06:12 CrimRecya

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

github-actions[bot] avatar Dec 29 '24 06:12 github-actions[bot]

I would say we should still keep AE for warhead only, especially when we can use ExtraWarheads and such to provide different effects for different technos in one shot. Adding a connection between weapon and AE would make the system overcomplicated, while not gaining much

Coronia avatar Jan 15 '25 06:01 Coronia

I would say we should still keep AE for warhead only, especially when we can use ExtraWarheads and such to provide different effects for different technos in one shot. Adding a connection between weapon and AE would make the system overcomplicated, while not gaining much

The biggest advantage of weapon AE over warhead AE is that it is completed in an instant. It can produce different effects with the order of unit update, and the warhead AE will not take effect until all bullets are updated and detonated. Sometimes, it is too late.

CrimRecya avatar Jan 15 '25 06:01 CrimRecya

Why make this when you could design something like an InstantWarhead detonation that skips all these checks too and gives us more flexibility to what the instantly applied effects actually are? Not just AE, and you skip having to redo all nuAE tags on WeaponTypes.

Speederovsky avatar Jan 15 '25 16:01 Speederovsky

Why make this when you could design something like an InstantWarhead detonation that skips all these checks too and gives us more flexibility to what the instantly applied effects actually are? Not just AE, and you skip having to redo all nuAE tags on WeaponTypes.

Your idea touched me. If killing some units in the process of traversing all units will not cause problems in the iterator due to DTOR or quantity reduction (maybe, not sure), it is worth trying.

CrimRecya avatar Jan 15 '25 17:01 CrimRecya

After evaluation, InstantWarhead is considered to be unhelpful to the content of this pr. The same warhead is required if AE needs to be used to search target by the weapon. That is, InstantWarhead should be used as the Boolean value of a projectile with Inviso=true, so that the projectile will detonate immediately after it is set in position, instead of waiting for a uniform update time.

CrimRecya avatar Jan 20 '25 08:01 CrimRecya

I didn't quite get why is InstantWarhead unsuitable, can you elaborate?

Metadorius avatar Jan 20 '25 08:01 Metadorius

I didn't quite get why is InstantWarhead unsuitable, can you elaborate?

As discussed with Starkku before, if the weapon needs to use AE to target (such as IgnoreFromSameSource), the warhead of the weapon must be the same. If it wants to replace the requirement that PR can solve, it should move to the target position immediately after the projectile is generated, and then detonate immediately (to ensure that the Warhead is the same). If we use a new logic similar to ExtraWarhead to carry a new warhead, we can not achieve the purpose of this PR. In short, it should be possible, but it is different from the goal of this PR.

CrimRecya avatar Jan 20 '25 08:01 CrimRecya